33164 Commits

Author SHA1 Message Date
Jonas Ådahl
5852fa277b events: Replace meta_verbose() with 'x11' debug logs
The two verbose logging calls were related to X11.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4005>
2025-01-16 00:48:42 +00:00
Jonas Ådahl
e893fc2518 compositor: Change meta_verbose() with 'render' debug topic
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4005>
2025-01-16 00:48:42 +00:00
Jonas Ådahl
511453c229 output/xrandr: Change meta_verbose() to 'backend' debug topic
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4005>
2025-01-16 00:48:42 +00:00
Jonas Ådahl
7fff9ff9f5 idle-manager: Replace meta_verbose() with 'dbus' debug topic
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4005>
2025-01-16 00:48:42 +00:00
Jonas Ådahl
66c7b05991 x11: Replace meta_warning() with g_warning()
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4005>
2025-01-16 00:48:41 +00:00
Jonas Ådahl
f44bf9fa40 x11: Replace some warnings with debug logs
These warnings were altered due to the vast majority of cases they are
in practice harmless and just cause bug reports or red herrings due to
people seeing warnings and treating them as something that might be
relevant, while they rarely are.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4005>
2025-01-16 00:48:41 +00:00
Jonas Ådahl
7e9c6489ca x11: Introduce and use 'x11' debug topic
This replaces all current `meta_verbose (...)` in x11/ with `meta_topic
(META_DEBUG_X11, ...)`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4005>
2025-01-16 00:48:41 +00:00
Sebastian Wick
86a16c3cfd backend/native: Set static seat id for headless directly
This also changes the seat it for headless from seat0 to
meta-headless-seat0.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4022>
2025-01-15 22:58:32 +01:00
Sebastian Wick
d42b6fd1e1 backend/native: Set no-libinput seat flag in seat id switch statement
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4022>
2025-01-15 22:58:25 +01:00
Sebastian Wick
a085281138 tests/dbus-runner: Clean up launching the tests
Move the wrapper functionality where it is actually used, use a single
mechanism to determine if we're already in a dbus-runner environment and
make the mocked launching simpler.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4022>
2025-01-15 22:56:29 +01:00
Sebastian Wick
35c45c24ce launcher: Fix indentation and rename variable which is no longer local
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4022>
2025-01-15 22:56:29 +01:00
Sebastian Wick
2bdd17650f launcher: Rename find_systemd_session and return a proxy directly
It's now left to handle getting the session proxy from the the display
session for when all the other cases didn't succeed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4022>
2025-01-15 22:56:29 +01:00
Sebastian Wick
78731515f2 launcher: Move PID based session lookup out of find_systemd_session
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4022>
2025-01-15 22:56:29 +01:00
Sebastian Wick
747da6960a launcher: Use the new get_session_proxy_from_id in get_session_proxy
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4022>
2025-01-15 22:56:29 +01:00
Sebastian Wick
8de42a326d launcher: Move XDG_SESSION_ID handling out of find_systemd_session
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4022>
2025-01-15 22:56:29 +01:00
Sebastian Wick
1f945691e7 launcher: Get the seat id from logind/dbus and drop fallbacks
The fallbacks were neccesarry for tests but we added some more advanced
logind mocking which will get us the right values from dbus. There is no
point in those fallbacks anymore.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4022>
2025-01-15 22:56:29 +01:00
Sebastian Wick
302fb21a68 launcher: Get session proxy earlier
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4022>
2025-01-15 22:56:29 +01:00
Sebastian Wick
32b7eae80c launcher: Pull finding the display session out of find_systemd_session
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4022>
2025-01-15 22:56:29 +01:00
Sebastian Wick
98b347b204 dbusmock/logind: Mock logind and remove KVM special handling
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4022>
2025-01-15 22:56:24 +01:00
Sebastian Wick
e1aeb86bc9 dbus-interfaces: Update the login1 dbus interface definition
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4022>
2025-01-15 22:49:15 +01:00
Michel Dänzer
82398945ea wayland/buffer: Do not get latest sync_fd if there are no release points
It's pointless busy work in that case.

Fixes: e8b890ab53a6 ("wayland: Implement linux-drm-syncobj-v1")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4208>
2025-01-15 20:50:07 +00:00
Florian Müllner
6d9f0a5489
Bump version to 48.alpha
Update NEWS.
2025-01-12 22:30:51 +01:00
Bilal Elmoussaoui
358d554a32 backends/virtual-input: Get ClutterSeat from the virtual input
Instead of using the default one from the ClutterBackend.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4201>
2025-01-10 16:18:30 +00:00
Bilal Elmoussaoui
98e887df48 utils: Pass a CoglContext to meta_create_texture
Moves the global backend access from the function to the only
place where we don't have a way to get CoglContext in background
loading.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4201>
2025-01-10 16:18:29 +00:00
Bilal Elmoussaoui
5a2ef3ca4b cursor-sprite: Get Backend from cursor tracker
Instead of going through the global ClutterBackend

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4201>
2025-01-10 16:18:29 +00:00
Michel Dänzer
d908984d68 clutter/frame-clock: Use vblank_duration in calculate_next_update_time_us
In this scenario:

1. Only an "empty" content update (which results in no visible output
   change) from client A arrives before the frame deadline, so a frame
   event is sent for that at the deadline.
2. Another "empty" content update from client A results in a frame event
   being scheduled for the next frame deadline.
3. A non-"empty" content update from client B arrives before start of
   vblank, and the resulting output frame manages to hit the next
   display refresh cycle.

The result was that the frame events from steps 1+2 were sent during the
same display refresh cycle, so the frame rate reported by client A was
higher than the display refresh rate.

This change fixes that, at the cost of frame events being sent out
later in the display refresh cycle if there's no new frame for the
next cycle.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3559
Fixes: 8f27ebf87eee ("clutter/frame-clock: Start next update ASAP after idle period")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3878>
2025-01-10 14:59:10 +00:00
Sebastian Wick
aea1aee79e compositor-view/native: Check output color state for direct scanout
The stage view color state is not the output color state but usually a
linear version of it. For direct scanout, we need the view color state
to match the output color state instead.

Fixes: 20c7653d49 ("compositor-view/native: Don't scan out surface with color state mismatch")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4196>
2025-01-10 14:29:50 +00:00
Jonas Ådahl
e7ff05632d tests: Add test for emitting preferred surface scales
It tests both the wl_surface integer scale and fractional scales, for
toplevels, subsurfaces and cursor surfaces. It doesn't yet test DND
surfaces.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4205>
2025-01-09 16:34:35 +00:00
Jonas Ådahl
7273f30234 tests/wayland/client-utils: Allow creating role-less surfaces
This makes it easier to create e.g. subsurfaces or cursor surfaces that
inherit generic logic from the WaylandSurface test utility helper type.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4205>
2025-01-09 16:34:35 +00:00
Jonas Ådahl
ff58ef4bb7 tests/wayland/client-utils: Bind newer wl_compositor
Out of the new metadata, only gather the preferred scale, which will be
used in a later commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4205>
2025-01-09 16:34:35 +00:00
Jonas Ådahl
d579bf4a6c tests/cursor-tests: Move cursor state helper to test utils
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4205>
2025-01-09 16:34:35 +00:00
Jonas Ådahl
03553daacb wayland/cursor-surface: Update preferred scale monitor
Both when the renderer is set, which happens early shortly after
assigning the role, and when the cursor sprite is prepared at a specific
position, which happens as the cursor moves.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3829
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4205>
2025-01-09 16:34:35 +00:00
Jonas Ådahl
16e2c4785d wayland/surface: Add preferred scale monitor role vfunc
Use this new getter for getting the preferred surface scale.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4205>
2025-01-09 16:34:35 +00:00
Jonas Ådahl
29571397bc wayland/surface: Change a term from highest to preferred scale
It isn't always the highest scale for the surface, so change the
terminology in the common path to reflect this.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4205>
2025-01-09 16:34:35 +00:00
Robert Mader
235086c788 multi-texture-format: Use BT709 coefficients in the YUV shader
In order to be consistent with KMS, i.e. avoid noticable color changes when
switching between hardware plane offloading and compositing.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4204>
2025-01-09 15:28:25 +00:00
Robert Mader
377532f2f5 onscreen/native: Set default color encoding and range values
In order to ensure consistent behavior with the composited path as well as across
different KMS drivers. In the future we'll want to use other values as well,
requested by client via the upcoming color representation protocol.

Note that right now KMS drivers default to different values. Most use BT709 and
narrow range, notably Intel and AMD, but some others do not.

BT709/narrow is arguably a much better default than BT601/narrow  as the former is
used for most contemporary video content and the later more for still images.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4204>
2025-01-09 15:28:25 +00:00
Robert Mader
5bb7a0f13e kms: Add support for color encoding and range plane properties
Which are required for correct YUV->RGB conversion. Note that encoding refers
to the matrix coefficients.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4204>
2025-01-09 15:28:25 +00:00
Derek Foreman
fd39ca9f20 wayland: Add support for FIFO commits
New protocol that allows a client to require that a previously flagged
content update must be presented before a content update can be applied.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3355>
2025-01-08 10:35:46 -06:00
Derek Foreman
14c70c4f53 wayland/commit-timing: Add support for the commit-timing-v1 protocol
Allow clients to add timestamps to content updates.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3355>
2025-01-06 09:21:15 -06:00
Derek Foreman
a645659440 wayland: Add timed transactions
Allow a transaction to have a timing constraint.

Any transaction with a timing constraint will be deferred at its initial
commit, without testing the target time. The timing constraints are cleared
later in an on_before handler immediately before repaint.

The new frame clock api to schedule later ticks is use to ensure we get an
appropraitely timed tick to clear the constraint.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3355>
2025-01-06 09:21:15 -06:00
Derek Foreman
5b214dc2b7 clutter/frame-clock: Allow scheduling an update in the future
Allow creating a queue of future times to tick at. This adds a new clock
state where we let the clock go idle, but will wake at a time in the
future to tick.

We can still schedule ticks while in this new state, but we're assured a
tick at or shortly after the scheduled time.

This will be used later by wayland code that schedules future presentation.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3355>
2025-01-06 09:21:12 -06:00
Bilal Elmoussaoui
8c1ec168c6 cogl/texture: Refactor Loader's new/free functions
By making them follow what other helpers alike do.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4200>
2025-01-02 18:04:27 +00:00
Bilal Elmoussaoui
4ee657e31f cogl/texture: Drop set_auto_mipmap vfunc
As it is only relavant for 2D textures.
Allows getting rid of the is-primitive property which was enforcing only 2D textures
can use the set_auto_mipmap function.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4200>
2025-01-02 18:04:27 +00:00
Bilal Elmoussaoui
f613c82ab5 cogl/texture: Remove unused get_max_waste vfunc
As only 2DSliced has one, no need for abstracting things were not
needed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4200>
2025-01-02 18:04:26 +00:00
Bilal Elmoussaoui
6d9ef4d52a cogl: Abstract GL specific bits of Buffer
By introducing a BufferImpl that handles the buffer
allocation/de-allocation bits and making the driver responsible for
creating the correct impl.
This allow moving various Buffer specific vfuncs from Driver as well as
getting rid of the gl_handle field from Buffer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4181>
2025-01-02 17:30:09 +00:00
Gert-dev
dfa3755f55 drm-buffer-gbm: Cache EGLImages created during screen-casting
This consolidates duplicate code in meta_drm_buffer_gbm_blit_to_framebuffer
to use the newly added meta_drm_buffer_gbm_create_native_blit_image, which
also has the side-effect of caching creation of the EGLImage per GBM BO.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4027>
2025-01-02 16:59:00 +00:00
Gert-dev
ada199621c meta/egl-gbm: Use g_autofd to clean up BO FD automatically
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4027>
2025-01-02 16:59:00 +00:00
Gert-dev
ca7345588f meta/egl-gbm: Avoid using fixed size for number of planes
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4027>
2025-01-02 16:59:00 +00:00
Gert-dev
507409f5d0 onscreen/native: Cache created secondary GPU EGLImages in copy path
Creating an EGLImage is rather expensive and is taking the bulk of the
time the secondary GPU copy path is using for each frame. By caching
these per GBM BO we avoid this expensive recreation, which seems to
significantly improve FPS throughput in these scenarios, e.g. an
AMD or Intel iGPU with an NVIDIA dGPU.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4027>
2025-01-02 16:59:00 +00:00
Gert-dev
110bdf0e9f meta/renderer: Split up meta_renderer_native_gles3_blit_shared_bo
Split off meta_create_gbm_bo_egl_image from
meta_renderer_native_gles3_blit_shared_bo.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4027>
2025-01-02 16:59:00 +00:00