1
0
Fork 0
Commit graph

32709 commits

Author SHA1 Message Date
Gert-dev
3a202f58ce
onscreen/native: Use EGLSyncs instead of cogl_framebuffer_finish
cogl_framebuffer_finish can result in a CPU-side stall because it waits for
the primary GPU to flush and execute all commands that were queued before
that. By using a GPU-side EGLSync we can let the primary GPU inform us when
it is done with the queued commands instead. We then create another EGLSync
on the secondary GPU using the same fd so the primary GPU effectively
signals the secondary GPU when it is done rendering, causing the latter
to wait for the former before copying part of the frames it needs for
monitors attached to it directly.

This solves the corruption that cogl_framebuffer_finish also solved, but
without needing a CPU-side stall.

(cherry picked from commit 3a40413f7cf036622da3c22c609b703c138c709c)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4015>
Signed-off-by: Mingi Sung <sungmg@saltyming.net>
2024-10-21 15:26:26 +09:00
Gert-dev
69cc9a7c0e
egl: Add helpers to manage and wait for EGLSync objects
This adds meta_egl_create_sync and meta_egl_destroy_sync to be able to
create and dispose EGLSync objects, respectively, as well as
meta_egl_wait_sync to be able to wait for an EGLSync on the GPU.

(cherry picked from commit d2e70c15ec1cf6b6f7cd8c8825a5d92a1f89b35b)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4015>
Signed-off-by: Mingi Sung <sungmg@saltyming.net>
2024-10-21 15:26:26 +09:00
Christian Kirbach
74cf8ac0f0 Update German translation 2024-10-20 20:16:54 +00:00
Sebastian Keller
5bcaa7c80b wayland/pointer-constraints: Warp pointer after destroying resource
e994fbf02 moved warping the pointer to before the destruction of the
resource to prevent dereferencing the constraint after destruction.
This however meant that the constraint was still active when the motion
event caused by the warp is handled, which would constrain the pointer
back again to its original position.

This moves the warping of the pointer back to after the destruction of
the resource and instead just retrieves the seat earlier while the
constraint is still valid.

Fixes: e994fbf02 ("wayland/pointer-constraints: Warp pointer before destroying resource")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3696
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4098>


(cherry picked from commit cb34fafd57)
2024-10-19 20:27:08 +00:00
Florian Müllner
7848c15baf
Bump version to 47.1
Update NEWS.
2024-10-18 21:52:47 +02:00
Michel Dänzer
ee1e8d7c87 onscreen/native: Don't set sync_fd for KMS update if secondary GPU used
The sync_fd represents only the primary GPU work.

Fixes: c2621eca15 ("onscreen/native: Set latest cogl sync_fd on KMS update")

v2:
* Use g_steal_fd. (Georges Basile Stavracas Neto, Sebastian Wick)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4060>
(cherry picked from commit 118f294a48)
2024-10-18 20:48:26 +02:00
Michel Dänzer
e4cfa2332d onscreen/native: Rename create_timestamp_query to secondary_gpu_used
This describes the condition it represents, rather than what it's
currently used for.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4060>
(cherry picked from commit 64ce8b2071)
2024-10-18 20:48:20 +02:00
Michel Dänzer
d291a07261 kms/crtc: Complain and bail if DRM mode info isn't valid
Otherwise meta_calculate_drm_mode_refresh_rate returns 0.0, which
results in non-sense refresh_interval_us.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3982 fixed that
happening before. This is intended to catch if it ever happens again.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3980>
(cherry picked from commit 3cf3d5d1c6)
2024-10-18 14:59:57 +02:00
Bilal Elmoussaoui
7c5bb5b8b2 wayland/inhibit-dialog: Drop duplicated hide call
the destroy and the response handler, already hide the dialog
themselves. The calls here were unnecessary.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3048
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4034>
(cherry picked from commit 3eb5381c46)
2024-10-18 14:59:50 +02:00
Florian Müllner
8e2c8611f6 ci: Don't build our own gtk3
The gtk3 package in F41 includes the necessary bugfixes, so no need
for our own build.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4068>
(cherry picked from commit c215faaeef)
2024-10-18 14:57:22 +02:00
Sebastian Wick
bd2fa3b885 gir: Correct usage of the closure annotation
Quoting Ebassi https://www.bassi.io/articles/2023/02/20/bindable-api-2023/:

    Whenever you’re describing a function that takes a callback, you
    should always annotate the callback argument with the argument that
    contains the user data using the (closure argument) annotation

    You should not annotate the data argument with a unary (closure).

    The unary (closure) is meant to be used when annotating the callback
    type

Recently gobject-introspection became a bit more strict with this and
that generated some warnings:

    Warning: Cogl: invalid "closure" annotation: only valid on callback
    parameters

This commit fix all the closure annotations.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4058>
(cherry picked from commit 077eb80a8d)
2024-10-18 14:55:35 +02:00
Kamil Szczęk
293b659032 udev: Use current tags when looking for preferred primary devices
In some use cases there is a need to dynamically change the preferred
primary GPU, or get rid of the preference altogether. This is currently
not possible due to a change in udev introduced by systemd v247. This
version made the tags "sticky", meaning there is no way to remove them
once attached. When a tag gets removed, only the CURRENT_TAGS property
reflects that change, the removed tag will remain in the TAGS property.

This also bumps libgudev version to 238, since that version introduces
a function, which we need to get the current tags.

Related: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1562
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4055>
(cherry picked from commit 57812546b9)
2024-10-18 14:54:26 +02:00
Florian Müllner
05bfb3689d Add gvdb subproject to .gitignore
gvdb always uses a subproject wrap, so we never want to check
in the checked out sources.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4047>
(cherry picked from commit f251e1f491)
2024-10-18 14:54:12 +02:00
José Expósito
e16e8c0121 wayland/drm-lease: Fix reference count cycle
MetaWaylandDrmLeaseDevice and MetaWaylandDrmLeaseConnector hold a
reference to each other.

In both cases, the reference count was increased. Do not increase the
reference count when lease_connector->lease_device is stored to break
the reference count cycle.

Fixes: fb08a597e1 ("wayland/drm-lease: Advertize initial connectors")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
(cherry picked from commit 9c536939a1)
2024-10-18 14:53:45 +02:00
Jonas Ådahl
e9dbc4f6e4 drm-buffer: Handle both XR24 and AR24 in legacy path
drmModeAddFB() doesn't take a format, but depth and bits per pixel.
These can be used to determine whether there should be an alpha channel
or not, and is roughly assumed to result in either XR24 or AR24 if one
passes 24 or 32 as depth, with 32 as bpp.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3926>
(cherry picked from commit 86c9d602cd)
2024-10-18 14:53:29 +02:00
Jonas Ådahl
a113753ecb kms: Add some debug logging for added planes/connectors/CRTCs
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3926>
(cherry picked from commit fd598e1868)
2024-10-18 14:53:18 +02:00
Jonas Ådahl
81e907056d backend/native: Log more about what pixel formats are attempted
This might help identifying pixel format related issues.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4016>
(cherry picked from commit c2273784ce)
2024-10-18 14:53:04 +02:00
Doğukan Korkmaztürk
95f9bb2f03 stage-impl: Ensure that a sync object is created in headless mode
During an onscreen swap, the cogl_onscreen_swap_buffers_with_damage()
function ensures that the Cogl renderer creates a sync object every
frame. This sync object is later shared with the Wayland clients that
utilize the explicit sync protocol.

However, in headless mode, the function mentioned above is not called.
As a result, the sync object the Cogl renderer stores seems to be not
created. This causes cogl_context_get_latest_sync_fd() function to
return an invalid sync fd, causing Mutter to not be able to materialize
the sync timeline point that the clients wait for when the explicit sync
protocol is in use.

This change simply adds a call to the cogl_framebuffer_flush() function
to the offscreen swap path to make sure that there is a sync object that
can be shared with the clients, which will be signalled when all the
queued operations before the swap are completed.

Signed-off-by: Doğukan Korkmaztürk <dkorkmazturk@nvidia.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4056>


(cherry picked from commit 6a0cc1371c)
2024-10-15 13:07:26 +00:00
Jason Gerecke
6e1e870e5a backends/x11: Avoid potential crash in pad_switch_mode
The meta_input_device_get_wacom_device function may return NULL, so
we should check it before use. I'm not 100% sure that the code as
currently written could reach here with a NULL wacom_device, but
that could change in the future.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4070>
2024-10-07 10:06:52 -07:00
Jason Gerecke
0596ac25d2 display: Do not crash attempting to display OSD for unknown Wacom device
The gnome-control-center has recently allowed unknown tablets to appear
in its UI. The UI provides a "Map Buttons" button that tries to open the
OSD, but if a device is not known there may be no Wacom object to actually
act on.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3722
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4059>
2024-10-07 10:06:52 -07:00
José Expósito
9d99f538d6 wayland/drm-lease: Do not add connector twice on lease disappeared
lease_disappeared() was calling meta_drm_lease_disappeared() and
set_connectors_as_available().

meta_drm_lease_disappeared() emits the "revoked" signal, connected to
on_lease_revoked(), which marks the leased connectors as available by
calling set_connectors_as_available().

Therefore, calling set_connectors_as_available() again from
lease_disappeared() is redundant.

Remove the redundant call to set_connectors_as_available() and drop two
unused functions.

Fixes: fc44437876 ("wayland/drm-lease: Withdrawn leased connectors")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3675
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4029>


(cherry picked from commit 3199d4bbb8)
2024-10-02 11:41:09 +00:00
José Expósito
9890fe7375 wayland/drm-lease: Hold device fd when listing leases
In multi-GPU setups, when one of the GPUs is used to render the desktop
and the other one has all of their devices available for lease,
meta_kms_impl_device_list_lessees() can be called after the device fd
has been unhold.

Make sure to hold and unhold it in this function.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4030>


(cherry picked from commit 45bf41bf94)
2024-10-02 08:19:43 +00:00
Jonas Ådahl
70c0eca6b0 Revert "window/wayland: Use scale for configured rect in configuration"
This caused https://gitlab.gnome.org/GNOME/mutter/-/issues/2616.

This reverts commit 2a62e690a2.


(cherry picked from commit 2ea002c0df)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4041>


(cherry picked from commit bce2790f7f)
2024-09-23 23:34:52 +00:00
Florian Müllner
625965d956 ci: Rebase image to F41
Fedora has branched, so we can use the newer F41 as base of our
CI image to reduce the number of custom built components.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4040>
2024-09-20 18:06:26 +00:00
Florian Müllner
313a438a7c ci: Remove problematic vulkan driver
The powervr vulkan driver interferes with proper functioning
of the CI, so drop it.

See https://gitlab.gnome.org/GNOME/gtk/-/commit/7814d1fd759118f2f.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4040>
2024-09-20 18:06:26 +00:00
Florian Müllner
bf9cad0753 ci: Include vulkan drivers
GTK switched its default backend to vulkan, so we need the
corresponding drivers (or force an alternative GSK renderer
in tests)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4040>
2024-09-20 18:06:26 +00:00
Florian Müllner
11fca7df25 ci: Remove libX11 downgrade
https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/264
landed upstream and was backported in Fedora, so the tests should
work again with the libX11 version that is pulled in automatically.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4040>
2024-09-20 18:06:26 +00:00
Jürgen Benvenuti
f3e1e618a4 Update German translation 2024-09-20 17:28:17 +00:00
Daniel van Vugt
338bd62708 cogl/gles: Don't initialize glGetStringi
We never use it for ES, and for good reason: It only exists in ES 3.0
while our ES path only supports 2.0.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4019>
2024-09-20 15:29:06 +00:00
Daniel van Vugt
010d68ed5a cogl/gl: Don't initialize potentially unused/unsupported functions
`_cogl_context_get_gl_extensions` is their only user and it only uses
them for GL 3.0 so do the GL version check first.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4019>
2024-09-20 15:29:06 +00:00
Daniel van Vugt
390dd63341 cogl: Don't _cogl_context_get_gl_extensions before check_gl_version
Because for `COGL_DRIVER_GL3`, `_cogl_context_get_gl_extensions` needs to
know that the GL version *really* is >= 3.0 before it calls `glGetStringi`
which didn't exist prior to GL 3.0 or ES 3.0.

This was causing crashes on Xilinx Mali implementations that only support
ES 2.0 (hence `glGetStringi` == NULL), but were being forced to call
that function before the GL version check which should tell you the
function isn't supported.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4019>
2024-09-20 15:29:05 +00:00
Daniel van Vugt
656b836c62 cogl/egl: Restore support for EGL 1.4
It was dropped in 46.0 (683e917854) but we've now found that Xilinx Mali
only implements a strict interpretation of 1.4 [1] which doesn't support
looking up core functions [2] such as `glGetString`.

[1] https://github.com/Xilinx/mali-userspace-binaries/blob/master/Standards.txt
[2] https://registry.khronos.org/EGL/specs/eglspec.1.4.pdf § 3.10

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4019>
2024-09-20 15:29:05 +00:00
Jonas Ådahl
3bc3740a9e wayland/tablet-tool: Fix grabbing tablet devices
The NULL check was inverted, meaning we'd grab with no leader device.
That meant updates coming from the what-should-have-been leader device
getting lost because incorrectly being classified as non-leader of
the grab.

Fix this by only allowing to grab if we have a device, and always mark
the current tool device as the grab leader.

Fixes: e4004a7c4f ("wayland: Use the tool's current_tablet device instead of caching it")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4033>
2024-09-19 07:26:54 +00:00
Sebastian Wick
2ce64ac0c3 cogl/gles: Use unsized internal formats for RGB8, RGBA8 in GLES 2.0
GLES 2.0 does not have RGB8 and RGBA8 as sized internal formats. There
is OES_rgb8_rgba8 which adds RGB8 and RGBA8 but only for
RenderbufferStorageOES and not for TexImage2D which I wrongly assumed.
It seems like there is currently no GLES2 extension which adds RGB8 and
RGBA8 to TexImage2D so we have no choice but to fall back to unsized
internal formats in those cases as long as we don't want to drop GLES2
support.

This should be fine in practice and we should get our 8bpc textures.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3680
Fixes: 7f943613a8 ("cogl: Use sized internal renderable formats")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4036>
2024-09-19 04:48:03 +00:00
Daniel Mustieles
846fc458d3 Update Spanish translation 2024-09-18 10:04:00 +00:00
Jordi Mas i Hernandez
ee7795adcc Update Catalan translation 2024-09-18 05:11:36 +00:00
Joan Torres
e8a9d3a68e wayland/color-management: Fix SIGSEGV on dispose
meta_wayland_color_management_dispose func is only called when the compositor
is shutting down, in that case the wl_globals are already automatically removed.

meta_wayland_color_management_dispose calls wl_global_remove again,
this makes a SIGSEGV when color_management is enabled and mutter is being
shut down.

Stop calling wl_global_remove to fix it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4032>
2024-09-17 11:46:56 +00:00
Christian Hergert
971bf15f26 x11: Reduce chances XPending does recvmsg() syscall
XPending() will do a recvmsg() syscall if there are no items in the queue.
In most cases, this is unnecessary because we know that there is data to be
read of the connection or there are items already read which simply need
to be processed.

Discovering both of those conditions can be done without recvmsg() in the
hot paths.

Before this path, every iteration of the main loop had the potential to
submit a recvmsg() syscall. This reduces that overhead drastically.

XFlush() on the other-hand knows if it needs to write data or not and will
do no IO in the case the buffer is empty.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3653
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4006>
2024-09-17 11:12:41 +00:00
Christian Hergert
1247452d19 gwakeup: Reduce wake-ups to only first item in queue
We only need to wake up the other side of the GAsyncQueue if we transition
from 0 to 1 item in the queue. Otherwise, we can be certain that the other
side has received a wakeup and will eventually flush the queue.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4007>
2024-09-17 10:07:07 +00:00
Michel Dänzer
18eb1be491 window/x11: Use g_autoslist (MetaStrut) in meta_window_x11_update_struts
The wrong type resulted in a crash when returning from the function,
because g_slist_free was called instead of g_free for the old_struts
list data pointers.

Fixes: e005d035c0 ("boxes: Define cleanup function for MetaStrut and use auto-pointers")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4028>
2024-09-16 15:11:55 +02:00
Vincent Chatelain
75b8d3a166 Update French translation 2024-09-15 13:30:38 +00:00
Florian Müllner
8b8f052ff9
Bump version to 47.0
Update NEWS.
2024-09-14 22:36:50 +02:00
Jonas Ådahl
e69e4fa6db Revert "wayland: Check focus surface to set a pointer cursor"
This reverts commit b35129db61.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3541
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4026>
2024-09-14 20:21:32 +00:00
Carlos Garnacho
69b6e7ead6 wayland: Save session state in the background in a delayed manner
Track toplevels being saved, and save state some time after. This
will make session state somewhat remembered on shell crashes, as
long as there was time to snapshot the data in disk.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
2024-09-14 13:47:21 +00:00
Carlos Garnacho
8b9bf6b051 core: Add async save method to MetaSessionManager
Allow saving the session gvdb file in the background, with as little
overhead in the main thread as possible. We still need to serialize
all created/deserialized MetaSessionState to a GVDB hashtable there,
in order to avoid these being poked from the async task thread.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
2024-09-14 13:47:21 +00:00
Jonas Ådahl
8468888508 tests: Add some basic tests for XDG session management
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
2024-09-14 13:47:21 +00:00
Carlos Garnacho
6c3c17daa6 tests: Make test context able to create a session manager
And create an empty one when asked for it. This session data is not
saved on disk, except for the purpose of creating an empty file FD.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
2024-09-14 13:47:21 +00:00
Jonas Ådahl
74ce36f323 wayland: Implement the XDG session management protocol
The xdg_session_manager_v1 global interface is the generator
of xdg_session_v1 objects for clients. These will notify of an
unique ID that can be used for future instantiations.

Once a xdg_session_v1 object is obtained, toplevels can be added
to be managed by it, and clients may get a hint about whether the
toplevel was restored to a saved state.

Changes by Carlos Garnacho: Integrate with MetaSessionManager core
object. Flesh out event emission of xdg_session_v1 and
xdg_toplevel_session_v1 objects, handle sessions being
replaced/deleted.

Changes by Sebastian Wick:
* make lifetimes of xdg_sessions entirely determined by the wayland and
  handle its destruction via the signal
* fix session destruction vs deletion
* do not drop refcount of replaced session state temporarily to make
  sure the replacing session keeps the state
* disconnect signals of destroyed and replaced sessions
* disconnect window-unmanaging signal handler for
  MetaWaylandXdgToplevelSession
* call wl_resource_destroy in xdg_toplevel_session_remove to make it a
  destructor
* handle session being destroyed before topevel-sessions
* handle the toplevel going away before the topevel-sessions

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
2024-09-14 13:47:21 +00:00
Carlos Garnacho
2074e4e146 core: Add debug control setting for session management
We will at the moment want it guarded behind a setting.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
2024-09-14 13:47:21 +00:00
Carlos Garnacho
5c30483739 wayland: Add XDG Shell glue to cater for already restored windows
Make the restored state prevail, instead of letting the client still
pick an initial size.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
2024-09-14 13:47:21 +00:00