Commit graph

10002 commits

Author SHA1 Message Date
Robert Mader
33db73f134 tests: client-helper: Add dmabuf protocol support
Allow querying supported formats and modifiers.
We use version 3 as it is easier to implement and also works
if no main device is present - such as when using llvmpipe.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-04-30 11:13:06 +02:00
Robert Mader
cd35c6c780 gl-renderer: Add YUV422 and YVU422 to yuv_formats
So we can test them on CI. For completeness and because they
are commonly used by SW decoders.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-04-30 11:13:06 +02:00
Robert Mader
d6f1b2a6a4 tests: client-buffer: Preparations for dmabuf support
Add stride alignment support make various cleanups in
order to support both shm and dmabufs. No changes in
test results intended.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-04-30 11:13:06 +02:00
Robert Mader
9f0ac15ce6 tests: Rename shm-buffer to client-buffer
In preparation to also test dmabufs.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-04-30 11:12:38 +02:00
Marius Vlad
6f94022e8c ivi-shell/layout: Create a temporary background curtain
Similar to 0ff5ac0f7b, "desktop-shell: Add a placeholder curtain on
new outputs", to address the 68761d3f11, "compositor: Ensure the
scene graph isn't empty at repaint".

This is needed to allow ivi-shell to start-up otherwise we hit the
assertion introduced with 68761d3f11.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-04-29 17:41:07 +03:00
Pekka Paalanen
edd00d9652 CI: restore junit results in Gitlab
Fix a typo that caused test results to not be found. This adds them back
to the MR and pipeline Gitlab pages.

Fixes: 68fd41a719

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-29 10:27:34 +03:00
Pekka Paalanen
294d4cabd4 gl-renderer: unpack linpow/powlin parameters differently
This consolidates the parameter unpacking for the two types of
parametric curves. The goal is code that reads better.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-28 16:46:43 +03:00
Pekka Paalanen
107e9ed69c gl-renderer use struct to de-dup curves in fragment.glsl
Using more structured types allows removing one of color_pre_curve() and
color_post_curve() completely, reducing code duplication.

Ideally I would have wanted to use a single type for a curve, having
both lut and par in it, but I am not sure the unused half would still be
eliminated during compilation.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-28 16:46:34 +03:00
Pekka Paalanen
dcb4a1012d gl-renderer: de-dup getting curve uniform locations
Reduce pasta, reads better.

Shame that the string manipulation is so cumbersome. All strings are
hardcoded literals though, so the assert is good enough.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-28 16:42:46 +03:00
Derek Foreman
52204f55ea frontend: Fix crash in output resize handler
The output resized signal sends a struct weston_output as the data, not
a struct weston_head.

Fixes 197c5e0084

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-04-24 12:20:53 -05:00
Vlad Zahorodnii
09c8902225 desktop-shell: Fix leaking weston_desktop_surface
If the view has become unmapped, the weston_desktop_surface should still
be unreferenced, otherwise it'll be leaked until the client disconnects.

Signed-off-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
2025-04-16 11:19:59 +00:00
Derek Foreman
4e1e922a28 kiosk-shell: Fix fullscreen_requests
In my haste to fix a crash in kiosk-shell, I made it potentially put
surfaces on wrong outputs instead.

Fixes e1ac6139ca
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-04-16 11:04:36 +00:00
Pekka Paalanen
007a1e1def gl-renderer: assert lut_3x1d scale and offset
Add asserts the same as what the color mapping 3D LUT uses, for
consistency since both implement a LUT with the same principles.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-15 14:07:05 +03:00
Pekka Paalanen
95cb915d32 gl-renderer: move color mapping asserts to load config
The frequency of checking remaing the same, but we can use an already
needed switch statement and do not need one just for the asserts. This
makes gl_shader_config_set_color_transform() nice and short.

The MAPPING_MATRIX assert was useless, the variable is set right above.

Asserting the mapping type is valid happens already in
gl_shader_load_config_mapping().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-15 12:07:45 +03:00
Pekka Paalanen
cf6735a761 gl-renderer: refactor into gl_shader_load_config_mapping()
The new function parameters acts as shorthands, making the moved code a
little more concise. It also gains an assert for an invalid mapping
type, which previously would have been awkward to code.
gl_shader_load_config() becomes easier to read.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-15 11:57:32 +03:00
Pekka Paalanen
9ce3ce4250 gl-renderer: share color mapping union for gl_shader_config
Reduce divergence between the structs to maybe allow more consolidation
in the future.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-15 11:38:23 +03:00
Pekka Paalanen
77015ae226 gl-renderer: name the anonymous union in gl_renderer_color_mapping
This is both more consistent with other embedded unions, and it allows
to pull the union out into its own named type in the following patch.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-15 11:38:23 +03:00
Pekka Paalanen
d1e4ae5e1d gl-renderer: refactor into gl_shader_load_config_curve()
De-duplicate code.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-15 11:38:19 +03:00
Pekka Paalanen
05f5e400e9 gl-renderer: union gl_shader_color_curve_uniforms
This type name allows for code de-duplication.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-15 11:35:41 +03:00
Pekka Paalanen
a47fabeaa4 gl-renderer: share curve union for gl_shader_config
This will help reducing the duplicate open-coding of pre- and
post-curves in the following commits. This is also a step towards
eliminating the duplication between struct gl_shader_config and
gl_renderer_color_transform.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-15 11:34:38 +03:00
Pekka Paalanen
70b5ec5bfe color: use weston_mat3f for mapping step
Replace a plain array with a type-safe documented structure.
This will get more wide use later.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-14 17:11:43 +03:00
Pekka Paalanen
98ec0d9b6c color: structurize parametric curve data
Rather than using a two-dimensional array, provide names to the fields.
The fields are primarily used by their names, but we also need the data
as a flat array of floats, so use unions to achieve that: two different
views into the same data.

This makes the code more self-explanatory. In color-operations.c it
removes a handful of temporaries. Comparison in color-properties.c is
simplified. ARRAY_COPY() turns into an assignment.

MAX_PARAMS_PARAM_CURVE is eliminated. Instead of having to maintain a
copy in fragment.glsl, the definition there is automated.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-14 11:00:21 +00:00
Pekka Paalanen
f7bf732004 gl-renderer: make gl-renderer-internal.h selfcontained
This helps me with VScode when clangd doesn't claim this header to be
full of unknown stuff.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-14 11:00:21 +00:00
Derek Foreman
e1ac6139ca kiosk-shell: Fix fullscreen_requests
The output can be NULL, so that must be tested before looking up the
shell_output from the output.

Fixes 77dcbe381f

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-04-11 14:00:32 -05:00
xufeng wang
5eb316d77c libweston: fix crash when getting connector's property failed
When weston tries to update drm head info, if the connector is disconnected, it cannot get the connector's property.

If get connector's property failed, drm_connector_assign_connector_info returns -1 and head->connector->conn, head->connector->props_drm remain to be nullptr, but they are used in update_head_from_connector, so the crash occurs.

So just return ret when drm_connector_assign_connector_info returns -1, and head->connector, head->connector will not be used later.

Signed-off-by: xufeng wang <550002860@gehealthcare.com>
2025-04-11 15:58:22 +08:00
Leandro Ribeiro
8762c3bab5 color: implement perceptual quantizer transfer function
This implements WESTON_TF_ST2084_PQ.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-10 12:43:00 +00:00
Leandro Ribeiro
0af48f0415 color: add function to create 3x1D LUT from color curve
Some external API's (e.g. DRM/KMS) are not capable of dealing with
enumerated color curves. In such cases, we may need to create LUT's that
correspond to such curves and give them to such API's

So add function weston_color_curve_to_3x1D_LUT() to craft 3x1D LUT from
a color curve.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-10 12:43:00 +00:00
Leandro Ribeiro
2ac863397c color: add function to create color curve from tf
When we create a parametric color profile (we still do not fully
support, but plan to), a struct weston_color_tf_info is created.

So add a new function weston_color_curve_from_tf_info() to create a
color curve given a transfer function.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-10 12:43:00 +00:00
Leandro Ribeiro
0ebd2b5e0e color-lcms: rename a few functions
Since "color-lcms: recognize LCMS curves that matches transfer
functions", a few function names became slightly outdated. Rename them.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-10 12:43:00 +00:00
Leandro Ribeiro
ccf6db49b7 color-lcms: recognize LCMS curves that matches transfer functions
LittleCMS curves contain curves that are parametric. They may be
well-known curves, and we are not checking that. If that's the case,
we should create enumerated color curves, instead of parametric.

This can be helpful for renderers and/or backends that want to implement
the curve, as they may have access to an API that accept enumerated
curves.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-10 12:43:00 +00:00
Leandro Ribeiro
209882c7d4 color: add curve type enumerated
Not all color curves comes from parameters. For instance, with the
CM&HDR protocol users can set color curves from tf_info.

So let's add a new curve type to accommodate that.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-10 12:43:00 +00:00
Leandro Ribeiro
0fe575b4a9 color: move LINPOW/POWLIN to new enum weston_color_curve_parametric_type
This just makes the code more readable and should help us to avoid
mistakes in the future. No behavior changes.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-10 12:43:00 +00:00
Leandro Ribeiro
46920d8a61 color-lcms: define max number of params for LittleCMS curves
Follow-up of "color: define max number of params for parametric curves
and tf's". Let's do the same for LittleCMS parametric curves.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-10 12:43:00 +00:00
Leandro Ribeiro
037f2dbff1 color: define max number of params for parametric curves and tf's
Up to now we were using 10 as the max number of params for color curves
and transfer functions. But this came from LittleCMS, whose parametric
curves may contain up to 10 params.

But out color curves and tf's are not tied to LittleCMS, so let's define
constants to help avoid confusion.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-10 12:43:00 +00:00
Leandro Ribeiro
52262cb06c shared: add weston_assert_uint32_lt_or_eq()
This will be useful in the next commits.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-10 12:43:00 +00:00
Derek Foreman
d9893c6af2 compositor: Fix a potential crash at shutdown
weston_global_destroy_save() can directly destroy a global if the
compositor state is WESTON_COMPOSITOR_OFFSCREEN.

Make sure we don't try to set_user_data after this has happened.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-04-10 12:02:26 +00:00
Robert Mader
81800294a9 gitlab-ci: Bump image
Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-04-08 21:53:45 +00:00
Robert Mader
682d420b50 gitlab-ci: Build kernel with udmabuf support
With udmabuf we can write test for dmabuf paths in a similar
manner to shm. It's available by default in most recent distros
and thus works OOTB on developer setups.

Drop vgem as it isn't needed any more and makes the CI use
kms_swrast (instead swrast), which isn't compatible with the
llvmpipe dmabuf implementation yet.
Using swrast also streamlines CI with running tests locally,
making debugging easier.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-04-08 21:53:45 +00:00
Robert Mader
57f48ab91c gitlab-ci: Update Mesa for llvmpipe dmabuf support
llvmpipe now supports EGL_EXT_image_dma_buf_import, allowing
us to test zwp_linux_dmabuf_v1 on CI.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-04-08 21:53:45 +00:00
Robert Mader
9675ef49f2 gitlab-ci: Update Meson
And clean up accordingly. This is required for the following commit.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-04-08 21:53:45 +00:00
Leandro Ribeiro
cb43a086b5 frontend: improve error message
We have the following error message in parse_color_characteristics():

name=%s: reserved name. Do not use ':' character in the name.

It gets confusing when "name" ends with ':'. So rephrase it to clarify
the error message in such case.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-03 17:50:02 +03:00
Leandro Ribeiro
d3ef4f9576 color: improve code that validates color gamut
First of all, we make it work for NaN CIE xy values.

We also improve the error message a bit. It was only printing that the
color gamut was invalid, but it didn't explain why. This adds the
explanation (out of valid range).

And finally, we make the code a bit shorter.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-03 17:49:53 +03:00
Leandro Ribeiro
25a10fa2cd color: add WL_EXPORT to param builder functions
The internal API to create parametric color profiles should be available
not only to libweston, but also to frontend. WL_EXPORT was missing from
the functions, so add that.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-04-03 17:49:40 +03:00
Pekka Paalanen
98becedfcd libweston: publish eotf and colorimetry mode to string
Frontend wants to print these sometimes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-03 17:49:20 +03:00
Pekka Paalanen
d26ab4360d color-lcms: transform_search_param well-formedness
Assert that the search param structure is well-formed, so that there
won't be cache misses due inconsistent fields.

Anything called from inside cmlcms_color_transform_get() can skip
asserting these.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-03 17:49:03 +03:00
Pekka Paalanen
ce80a059f1 color-lcms: use alloc/register in profile_from_params
This is a nice clean-up.

The parameter-based color profile is actually fully formed. The problem
of using it is dealt in the next patch.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-03 17:48:08 +03:00
Pekka Paalanen
5ef1432195 color-lcms: cmlcms_color_profile_alloc/register()
Split the create function into two parts, allocation and finalization.
All ICC-specific code is moved into callers, so that the parameter-based
profile creation can start using alloc/register too.

cmlcms_color_profile 120 bytes, so it's unlikely we could ever deal with
that allocation failing - don't even try.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-03 17:47:32 +03:00
Pekka Paalanen
385334b77a color-noop: improve profile error messages
While no-op does not support these, other color managers might. Change
the wording so that the user does not think that Weston does not support
these at all.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-03 17:46:45 +03:00
Marius Vlad
1030268c6d gitlab-ci.yml: Limit gcov and perfetto to just x86 build
This should speed up considerably the other builds / tests.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-04-03 07:58:05 +00:00
Michael Olbrich
83053f0ce4 backend-drm: make sure outputs are enabled during plane assignment
drm_output_propose_state() is called during from drm_assign_planes(). At this
point, the output is enabled, but it may be disabled in the current state, that
is copied.

So explicitly enable the output by setting dpms to WESTON_DPMS_ON.
The same thing is already done in drm_output_repaint() but that's to late for
drm_output_propose_state(). Move that to the fallback path when planes are
disabled. It's no longer needed in general and changing the state between the
atomic test and commit is not a good idea anyways.

Without this, the atomic commit may fail, even though the corresponding test was
successful.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2025-04-02 18:02:45 +00:00