33182 Commits

Author SHA1 Message Date
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
Cas Pascal
840b801487 Update Vietnamese translation 2025-01-01 07:17:57 +00:00
Cas Pascal
af9a31a9b0 Update Vietnamese translation
(cherry picked from commit 9e11a656945ccd1f457c38b6ed9d8c63d70683cb)
2025-01-01 06:57:18 +00:00
Bilal Elmoussaoui
5621134399 clutter: Make cairo dependant on fonts build option
As it is only used there. Once we have removed cairo usage from meta, we
can make it tests specific.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:12 +00:00
Bilal Elmoussaoui
32c5faf010 build: Add a new fonts option
Allowing to disable font rendering integration, making it possible to
build Mutter without pango/harfbuzz/fribidi dependencies.

This commit also adds a new clutter-pango header that is used to include
pango specific bits.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:12 +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
Bilal Elmoussaoui
fb48766710 clutter: Move pango helper to clutter/pango
As it is only used by the pango integration bits, so it can be disabled
along with the rest of it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:11 +00:00
Bilal Elmoussaoui
4313c2bb58 clutter: Move Text actor to clutter/pango
Similar to ClutterText node in the previous commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:10 +00:00
Bilal Elmoussaoui
c15bb5d49c clutter: Move TextNode to a separate header
By moving it into clutter/pango, we can make it optional along with all
the pango usages. See the next commits.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:09 +00:00
Bilal Elmoussaoui
2c308caf72 clutter/context: Make get_font_map private
It is only used internally by ClutterActor.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:09 +00:00
Bilal Elmoussaoui
c5ea9562e1 clutter/backend: Stop re-allocating font_options
There is no real need to re-create a new cairo_font_options_t now that
the API is internal. Instead, create the font_options once and just
update it attributes.

Actors already register for the emitted font-changed signal to re-create
a new PangoContext.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:08 +00:00
Bilal Elmoussaoui
17e7f9be51 clutter/backend: Remove unused font_name field
We already store the exact same thing in ClutterSettings.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:08 +00:00
Bilal Elmoussaoui
3153708e85 clutter/backend: Initialize default font options if no schema found
When the `org.gnome.desktop.interface` schema is not found, currently
we were not initializing the font_options which means we needed to
handle that on the backend side. Instead, generate the font_options at
that moment.

As the settings are loaded the moment we assign a backend to the
settings `_clutter_settings_set_backend` which is called just after the
backend is constructed which is too early for any actor to use it for
creating a PangoContext, so the change is safe.

Also, as the font_options getter is only used in ClutterActor when
creating the PangoContext, drop the getter. As we might just store that
info somewhere else in the future.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:07 +00:00
Bilal Elmoussaoui
727d923f12 clutter/settings: Simplify cairo_font_options creation further
Currently, we were first reading the settings, creating a FontSettings
struct and then mapping the string associated on that struct back to
their corresponding cairo type. A lot of dancing for not much benefits.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:06 +00:00
Bilal Elmoussaoui
f4d97bb53f clutter/backend: Mark [get|set]_font_options as private
The cairo_font_options is only meant to be consumed by ClutterActor when
creating a PangoContext and as those APIs are never used externally,
mark them private to not expose more cairo APIs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:06 +00:00
Bilal Elmoussaoui
53fd1e43f1 shaped-texture: Add missing cairo include
Would be needed with next commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:05 +00:00
Bilal Elmoussaoui
86fff39aa4 clutter/settings: Remove unused field
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:05 +00:00
Bilal Elmoussaoui
222ac59dc7 clutter/settings: Remove unused unscaled-font-dpi property
Nothing ever sets or use it, so remove it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:04 +00:00
Bilal Elmoussaoui
b559e5a14d clutter/settings: Drop xft font properties
As those properties are never set externally and just end up mapping the
gsettings values, in order to create a cairo_font_options_t.

Instead, simplify the whole thing and just create the
cairo_font_options_t from the resulting FontSettings.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:04 +00:00
Bilal Elmoussaoui
6c22b7faba cogl: Drop Rendererer.set_driver
As nothing uses it anymore. End users can still use the COGL_DRIVER variable
to force selecting a specific driver if needed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4194>
2024-12-27 13:25:40 +00:00
Bilal Elmoussaoui
ae48cf76f9 cogl/glx: Stop loading opengl module twice
As the Renderer takes care of doing that already as we enforce that the
DriverId is GL3 inside the glx winsys connection phase.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4194>
2024-12-27 13:25:40 +00:00
Bilal Elmoussaoui
d3fec7648d cogl/renderer: Simplify driver constraints logic
By just using the DriverId to get all the necessary details where
needed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4194>
2024-12-27 13:25:40 +00:00
Bilal Elmoussaoui
7d376dfddc clutter: Drop CLUTTER_DRIVER env variable
We already have a COGL_DRIVER that allows selecting a specific
CoglDriverId.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4194>
2024-12-27 13:25:40 +00:00
Bartłomiej Piotrowski
d2b726ebf7 ci: Switch to GNOME GitLab mirror of ci-templates
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4199>
2024-12-27 10:17:39 +01:00
Bilal Elmoussaoui
623c6c6cd3 clutter: Make debug helpers functions introspected
Fixes: e06592d3d ("util: Drop duplicated Clutter debug flags helpers")
Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8118

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4197>
2024-12-23 14:16:42 +01: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
Scrambled 777
dbb412647e Update Hindi translation 2024-12-22 14:06:48 +00:00