1
0
Fork 0
Commit graph

32727 commits

Author SHA1 Message Date
Sebastian Wick
b218fc5b7f tests/wayland-drm-lease: Let the test be skipped if not on a tty
By passing META_TEST_RUN_FLAG_CAN_SKIP instead of
META_TEST_RUN_FLAG_NONE.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4049>
2024-10-01 11:38:51 +00:00
Kamil Szczęk
57812546b9 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>
2024-10-01 11:18:13 +00:00
Joan Torres
36f1a38c3b clutter/color-state: Compare chromaticity with 0.0001f epsilon
This follows the precision used by the color management protocol on
primaries.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
2636ff7430 tests/wayland: Add color-management test
Right now multiple image_descriptions are created with different
parameters and are set to a surface.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
fcbd2e3840 clutter/color-state: Add support for gamma TF
This TF can't be defined as a TransferFunction enum because it needs a
gamma_exp value too.

Add to EOTFType enum a new type: EOTF_TYPE_GAMMA.

With this new type, now EOTFs are unions that can have either
a TransferFunction enum or a gamma_exp.

Set gamma_exp as uniform.

Add the support of it in the color management protocol.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
3b53f7cb6c clutter/color-state: Drop using default colorspace and default tf
Use the defaults explicitliy, which is SRGB for both.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
eff17bf1b5 clutter/color-state: Encapsulate primaries, tf and luminance
These properties now are tagged unions:
- ClutterColorimetry:
    Can be from colorspace or primaries;
- ClutterEOTF:
    Can be from known tf or custom gamma exp (next commit);
- ClutterLuminance:
    Can be defined explicitly or derived;

Make the color management protocol use them too.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
8d9c70acda clutter/color-state: Drop GObject properties
ColorState is inmutable so the GObject properties aren't necessary.

Also move ClutterColorstate and ClutterTransferFunction enums to
color-state.h now that they are not used as GObject properties.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
dbfacc06bc clutter/color-state: Add missing endline in get_inv_eotf
Keep consistency with get_eotf.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
2a3c5db4de clutter/color-state: Use to_string funcs and drop enum_to_string
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Jürgen Benvenuti
9eadeec742 Update German translation 2024-09-27 09:30:05 +00:00
Florian Müllner
f251e1f491 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>
2024-09-25 13:49:29 +02:00
Robert Mader
8e912a09d1 build: Disable asserts and cast checks in Mutter
For non-debug and non-plain cases - i.e. mainly release builds.

This ensures we use the same options in all places and draws a cleaner
distinction between g_assert() and g_return_if_fail() - the later will
still be done in release build while the former are meant for debug
only.

One advantage of doing this is that it allows us to use non-trivial
asserts more generously, such as calling `g_list_length()`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3424>
2024-09-24 14:07:23 +00:00
Christian Hergert
2666aabde2 tests: Avoid g_assert() use in unit tests
This is aimed towards allowing g_assert() to be compiled out of
release builds by ensuring they do not affect the testsuite.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4011>
2024-09-24 14:51:43 +02:00
Jonas Ådahl
bce2790f7f 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>
2024-09-23 22:53:01 +00:00
José Expósito
562beb9314 tests/wayland: Add lease without connectors error test
Add a test that:
- Creates a client
- Creates and submits a lease without connectors
- Check that the compositor returns the correct error

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00
José Expósito
973454dbdd tests/wayland: Add duplicated connector lease error test
Add a test that:
- Creates a client
- Creates a lease with a duplicated connector
- Check that the compositor returns the correct error

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00
José Expósito
c804222e40 tests/wayland: Add connector lease with leased connector test
Add a test that:
- Creates 2 clients
- Leases a connector using the first client
- Tries to lease the same connector using the second client
- Checks that the first lease succeeded
- Checks that the second lease failed

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00
José Expósito
e6178fae6d tests/wayland: Add connector lease test
Add a test that:
- Creates 2 clients
- Leases a connector using the first client
- Checks that the first client receives a lease_fd event
- Checks that both clients receive a connector withdrawn event
- Finishes the lease
- Check that both clients have access to the connector

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00
José Expósito
c366e32da6 tests/wayland: Add DRM lease device release test
Add a test that:
- Creates 2 clients
- Releases a device for each client
- Checks that releasing a device for one client doesn't affect the other
- Checks that an error is raised if a released client is used

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00
José Expósito
59c4054c91 tests/wayland: Add event queue
Add an event queue to the DRM lease client that allows to check that the
compositor sent the expected events in the expected order.

For the moment, the event queue is used to check that the initial
connection to the compositor works as expected.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00
José Expósito
97e50a7285 tests/wayland: Add DRM lease client basic test
Add the most basic possible test that checks that:
- The DRM lease protocol is available
- At least one device is advertised
- At least one connector is available for lease

Organize the code in a way that it is possible to created multiple DRM
lease clients at the same time as future tests will need this.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00
José Expósito
b4aba293b0 tests/wayland-test-utils: Add helper to start a client with args
Add a helper function similar to meta_wayland_test_client_new() that
allows to pass command line arguments to the test clients.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00
José Expósito
bc8a376b81 tests/wayland: Add DRM lease test scaffolding
Add the required files to run DRM lease using the KVM/tty backends.

DRM lease tests need at least one connector available for lease. Instead
of adding the test to "wayland-unit-tests.c", add it to its own file and
set the environment variable MUTTER_DEBUG_LEASE_CONNECTORS=Virtual-1 to
make the only connector created by VKMS by default available for lease.

This commit doesn't add any tests, just the required files to start
adding them.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4031>
2024-09-23 22:38:10 +00:00
José Expósito
9c536939a1 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>
2024-09-23 22:38:10 +00:00
Jonas Ådahl
86c9d602cd 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>
2024-09-23 22:21:58 +00:00
Jonas Ådahl
fd598e1868 kms: Add some debug logging for added planes/connectors/CRTCs
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3926>
2024-09-23 22:21:58 +00:00
José Expósito
45bf41bf94 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>
2024-09-23 21:37:26 +00:00
Jonas Ådahl
c2273784ce 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>
2024-09-23 21:27:09 +00:00
Joan Torres
be39717639 cogl/pipeline/glsl: Display uniform updates on debug "show-uniforms"
When running with COGL_DEBUG=show-uniforms, display the values of the
uploaded uniforms.

This helps because it's not possible to know the uniform values only from
the shader source.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3965>
2024-09-23 20:50:31 +00:00
Joan Torres
9c0200570a cogl/boxed-value: Add function _cogl_boxed_value_to_string
This function returns a string of the boxed value considering type, size
and count; and adds a name.
e.g:

  vec2 scale = vec2(1.0000, 1.0000)

Also handle NULL cases on _cogl_boxed_value_equal.

This will be used by the next commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3965>
2024-09-23 20:50:31 +00:00
Joan Torres
1eba07f64f cogl/boxed-value: On _cogl_boxed_value_set_x, simplify mem alloc
Use _cogl_boxed_value_destroy to free the correspondent array instead of
free, which was only freeing float_array.

Add a new func _cogl_boxed_value_array_alloc to allocate the
corresponding array considering the type.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3965>
2024-09-23 20:50:31 +00:00
Joan Torres
3e629256ce cogl/boxed-value: On _cogl_boxed_value_set_x, update copying values
_cogl_boxed_value_transpose is only used for the matrix type.
Now is named _cogl_boxed_value_copy_transposed_value.
Gets the transposed value considering count (to store in array type or not).
The caller doesn't have to worry about count anymore.

Instead of calling memcpy, add function _cogl_boxed_value_copy_value
which copies the value to the corresponding boxed value property
considering type and count.
The caller doesn't have to worry about type and count anymore.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3965>
2024-09-23 20:50:31 +00:00
Joan Torres
afdd0be161 cogl/boxed-value: Use array types properly
There are three array properties, considering type:
1. float *float_array
2. int *int_array
3. void *array

Drop using array. This was inteded to be used when type is matrix and
count > 1, however some functions use it and others use
float_array. Fix this using always float_array, this starts to make all funcs
consistent handling the properties.

There's a mem leak when destroying the boxed value, only freeing the array
prop. Free the corresponding array considering the boxed value type to fix it.

_cogl_boxed_value_set_x func is still inconsistent, the next commits
will solve it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3965>
2024-09-23 20:50:31 +00:00
Joan Torres
cd65670f7a wayland/color-management: Support arbitrary primaries
The colorspace could be defined only with known colorspace names.
Now it can be defined with arbitrary primaries too.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3948>
2024-09-23 20:33:18 +00:00
Joan Torres
a27da4e88f clutter/color-state: Create colorspace transform from primaries
Colorspace transformation matrices were hardcoded considering only known
colorspaces like bt709 or bt2020.

Now that a colorspace can be defined from its primaries, allow getting the
colorspace transformation matrix from them and drop the hardcoding.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3948>
2024-09-23 20:33:18 +00:00
Joan Torres
95c9ba514d clutter/color-state: Add ClutterPrimaries
These primaries allow defining different colorspaces apart from the
known ones.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3948>
2024-09-23 20:33:18 +00:00
Joan Torres
49c01ca6a5 clutter/color-state: Set colorspace transform matrix as uniform
This is because next commits will generate the colorspace
mapping matrix from the colorspace primaries and won't be required
to define any color space mapping matrix.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3948>
2024-09-23 20:33:18 +00:00
Joan Torres
c05e3e74ac wayland/single-pixel-buffer: Use higher precision pixel formats
The single pixel buffer allows setting colors with 32 bpc.

Attempt to use pixel formats that allow higher precision than BGRA_8888.

First attempt to use half float format, fallback to ABGR_2101010 and
finally fallback to BGRA_8888.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3913>
2024-09-23 20:21:38 +00:00
José Expósito
3199d4bbb8 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>
2024-09-23 20:10:02 +00:00
Florian Müllner
4795e23f2c build: Bump API version
We have branched, so bump the API version for GNOME 48.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4042>
2024-09-23 13:00:51 +02: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