3734 Commits

Author SHA1 Message Date
Jonas Ådahl
d855623fb4 Replace HDR debug toggle with o.g.M.DisplayConfig API
HDR being enabled was controlled by toggling a property on
org.gnome.Mutter.DebugControl, which affected how the color space and
HDR metadata of the output was configured. Replace this with a higher
level MetaMonitor / MetaOutput level "color mode" enum, that is also
reflected in the monitor configuration API.

This enum is then used to derive the color space and HDR metadata at the
lower level where it matters. The ForceHDR debug control property is
still left there, as it only affects the color space and transfer
function of the view related to a monitor.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:09 +00:00
Jonas Ådahl
2fa0183a95 kms/connector: Add API to check color mode support
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:09 +00:00
Jonas Ådahl
0f9c9fdc20 monitor-config-manager: Put finding relevant configs into helper
Finding configurations relevant for inspiration when creating a new one
can be useful for finding more things to inherit from previous
configurations than the scale, so put the configuration gathering code
in a helper.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:09 +00:00
Jonas Ådahl
0f200efc6d monitor-config-manager: Rename helper finding logical monitor
It doesn't get a monitor, but a logical monitor, so name it according to
that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:09 +00:00
Jonas Ådahl
654d75b841 monitor-config-manager: Fix indentation
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:09 +00:00
Jonas Ådahl
a38f9c2d48 gpu: Don't include monitor manager header
Doing so pulls in too much, causing potential header include order
conflicts.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:08 +00:00
Jonas Ådahl
bfa0f3e2ab output: Fix include order
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:08 +00:00
Jonas Ådahl
a39e941f91 DisplayConfig: Advertise monitor color standard support
It'll be used to allow Settings to know whether it can enable HDR or
not.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:08 +00:00
Jonas Ådahl
f1e497acfa monitor: Add API to list supported color modes
Available modes are 'default', which is always added, and BT.2100,
which is added if the BT.2020 color space, and the PQ transfer function,
is supported by the output.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:08 +00:00
Sebastian Wick
ef0ff602b5 backends: Only build and use MetaLauncher if we have logind
Fixes: 23c2c0853c ("launcher: Move from backends/native/ to backends/")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3878
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4223>
2025-01-29 10:44:57 +00:00
Michel Dänzer
a211ed553b onscreen/native: Do not use modifiers if surface should be sharable
Importing a buffer allocated with a modifier into another GPU isn't
handled correctly yet in mutter. We'll want to fix that in the future,
for now just don't use modifiers in this case though, falling back to
GBM_BO_USE_LINEAR, to prevent issues due to mis-matched tiling
parameters.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3791
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4219>
2025-01-17 15:26:02 +00:00
Yao Wei (魏銘廷)
78c621aa1a backends/input-mapper: Synchronize device enabled state when adding device
When device is added to the mapper, the device may not be in a
desirable state. This changeset updates the device state when
the device is added to the input-mapper.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3834
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4188>
2025-01-17 05:27:24 +00:00
Jonas Ådahl
c9d8b0b5a9 screen-cast-stream-src/virtual: Track cursor updates via frame clock
When the cursor is captured via metadata, schedule updates when the
sprite changes or position moves, so we can gather the cursor change
during dispatch.

Also use the new skipped-paint stage watch to avoid having to guess
whether something will be painted by peeking at the pending damage.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4067>
2025-01-16 01:04:14 +00:00
Jonas Ådahl
5846061449 stage: Add watch mode for 'skipped' signal
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4067>
2025-01-16 01:04:14 +00:00
Jonas Ådahl
57cd2bc4f7 stage: Move N_WATCH_MODES next to the enum
This makes it harder to forget to update.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4067>
2025-01-16 01:04:14 +00:00
Jonas Ådahl
8b9dbc58f8 monitor-manager/xrandr: Use g_warning() instead of meta_warning()
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4005>
2025-01-16 00:48:42 +00:00
Jonas Ådahl
902ea05fde cursor-renderer/native: Use g_warning() instead of meta_warning()
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4005>
2025-01-16 00:48:42 +00:00
Jonas Ådahl
da256a20cd monitor-manager/dummy: Replace meta_warning() with g_warning()
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
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
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
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
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
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
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
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
Bilal Elmoussaoui
b0b1e0ef4e clutter: Inline character direction detection helper
By doing so, we can make the fribidi dependency specific to having x11
backend or fonts rendering support.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:11 +00:00
Michel Dänzer
23f3c17f0c kms/impl-device: Use deadline timer for all updates
Not with VRR though, because the deadline timer fires at most every 33ms
then.

Previously, the deadline timer was used only for cursor-only updates.
Using it for other updates means they pick up the latest cursor position
available at the deadline, resulting in the lowest possible input→output
latency for cursor movement.

TTBOMK this unlocks the full potential of the KMS thread given the
current atomic KMS API.

v2:
* Don't call meta_kms_update_merge_from with twice the same update
  pointer.
v3:
* Don't arm deadline timer if crtc_frame->pending_page_flip is true.
v4:
* Tweak want_deadline_timer indentation per check-code-style CI job.
v5:
* Also check crtc_frame->await_flush for want_deadline_timer.
v6:
* Tweak coding style to keep lines shorter. (Jonas Ådahl)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3964>
2024-12-23 09:29:07 +00:00
Michel Dänzer
315dfaa5d4 kms/impl-device: Simplify meta_kms_impl_device_schedule_process logic
There's no need for a label.

No functional change intended.

v2:
* Keep early returns separate. (Jonas Ådahl)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3964>
2024-12-23 09:29:07 +00:00
Michel Dänzer
0d7752a07d kms/impl-device: Move error handling into ensure_deadline_timer_armed
No functional change intended.

v2:
* Fix coding style per CI.
v3:
* Fix ensure_deadline_timer_armed parameter indentation. (Jonas Ådahl)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3964>
2024-12-23 09:29:07 +00:00
Michel Dänzer
3353962c38 kms/impl-device: Move up ensure_deadline_timer_armed definition
Preparation for next commit, no functional change intended.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3964>
2024-12-23 09:29:07 +00:00
Michel Dänzer
37d1a20644 kms/impl-device: Use discard_update for pending_update as well
Previously it was just dropped on the floor with no feedback, which
could result in the main thread waiting for something which never
happens.

Fixes: 0d9fd1ead7a7 ("kms/impl-device: Destroy submitted update in disarm_all_deadline_timers")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3964>
2024-12-23 09:29:07 +00:00
Michel Dänzer
f8e8dad0f4 kms/impl-device: Refactor discard_update helper
No functional change intended.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3964>
2024-12-23 09:29:07 +00:00
Michel Dänzer
f8524159cc onscreen/native: Move discarded KMS update handling
To swap_buffer_result_feedback from page_flip_feedback_discarded. The
former is where META_KMS_ERROR_DISCARDED from disarm_all_frame_sources
gets handled here.

Fixes: af250506fbe8 ("kms/impl-device: Queue result when discarding submitted update")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3964>
2024-12-23 09:29:07 +00:00
Jonas Ådahl
aad237a04a renderer/native: Don't close DMA buf fds before handing them forward
We closed all the DMA buffer fds after creating the DMA buffer backed
CoglFramebuffer, which meant that the fds we passed to CoglDmaBufHandle
were already closed. This broke screen casting with DMA buffers.

Fixes: 8509b74532 ("Make DMA buffer allocation format and modifier aware")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4177>
2024-12-12 15:38:23 +00:00
Sebastian Wick
42ba494f07 backend/native: Remove meta_backend_native_get_launcher
We can go through MetaBackend to the launcher now and this commit
changes the last user over to it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4130>
2024-12-12 15:30:36 +01:00