Commit graph

10389 commits

Author SHA1 Message Date
Derek Foreman
5a3f3c7ca7 desktop-shell: Force scale to 1 for single pixel buffer
Now that we use single pixel buffer, we need to be careful to only use
scale of 1, as other scales are supposed to generate an INVALID_SIZE
protocol errors (because the buffer size is not an integer multiple
of the scale).

Right now a bad scale just breaks background repaints, but in the future
we'll properly validate scale, which would cause the shell client to
be disconnected.

Fixes: 6cc8f48cd ("clients: Paint desktop-shell color background with single-pixel-buffer")

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-10-18 11:51:05 -05:00
Derek Foreman
52503ba9e6 backend-drm: Add EDID parsing for 'color format'
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-10-18 14:02:16 +01:00
Derek Foreman
2c7fd792b5 frontend: Add support for forcing a color format
Allow dictating which color format we'd like to use. This introduces the
front-end side and the core parts, leaving the EDID parsing and DRM
connector property for later patches.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-10-18 14:02:16 +01:00
Daniel Stone
0664d5bdc1 output: Record paint_node_changes during repaint
When we're going through assign_planes and repaint, give the backend an
opportunity to see what's changed during this repaint.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-17 13:51:05 -05:00
Daniel Stone
7f8c5f984e paint-node: Expose weston_paint_node_status
Expose the dirty status as public API so we can use it as a part of
weston_output.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-17 13:51:04 -05:00
Daniel Stone
abfe874a51 core: Don't rebuild view list on surface-local changes
If a surface changes size or opaque region, or a view changes position,
we don't need to rebuild the entire view list from scratch: we can just
rebuild what's changed and nothing else.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-17 13:49:21 -05:00
Daniel Stone
562a368fbd core: Remove flush_damage_for_plane return
Nothing uses this, and it was also being set incorrectly, as it would
return true when there was no damage to actually be flushed.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-17 13:49:21 -05:00
Robert Mader
64c938f5d6 backend-drm: Use paint_node->draw_solid in more cases
In order to streamline our checks and to make it easier to ensure
that we replace paint nodes with solid placeholders correctly.

Fix the failure reason in one case while on it.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-10-17 15:56:19 +02:00
Robert Mader
4cb7347407 backend-drm: Use visible_view in more cases
Instead of clipped_view. The former is the part of the later that is
not occluded.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-10-17 15:19:47 +02:00
Robert Mader
900ab0d39f backend-drm: Rename surface_overlap to visible_view
To clarify its meaning, especially relative to clipped_view.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-10-17 15:07:46 +02:00
Robert Mader
56aeb48f6d backend-drm: Use paint_node->is_fully_opaque in more places
To streamline our checks and to avoid recomputations.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-10-17 15:07:46 +02:00
Robert Mader
e9fc189189 paint-node: Consider view-alpha for is_fully_opaque
In order to be more in line with weston_view_is_opaque() - which we
use in most cases to set the value - and ensure the expectations of
existing places in the code are honored, see usages in both
draw_paint_node() implementations.

An exception here are holes - these always need to get painted as fully
opaque in the renderer path.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-10-17 15:06:11 +02:00
Pekka Paalanen
c2b60e6651 ci: stop checking allow-collaboration
I heard rumoours this is mostly unnecessary to check nowdays since it is
the default.

The real reason is that it crashes sometimes:

$ ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/gitlab/exceptions.py", line 344, in wrapped_f
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/gitlab/mixins.py", line 125, in get
    server_data = self.gitlab.http_get(path, **kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/gitlab/client.py", line 813, in http_get
    result = self.http_request(
             ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/gitlab/client.py", line 779, in http_request
    raise gitlab.exceptions.GitlabHttpError(
gitlab.exceptions.GitlabHttpError: 403: 403 Forbidden
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/bin/ci-fairy", line 8, in <module>
    sys.exit(ci_fairy())
             ^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/ci_fairy.py", line 1795, in check_merge_request
    mr = p.mergerequests.get(merge_request_iid)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/gitlab/v4/objects/merge_requests.py", line 523, in get
    return cast(ProjectMergeRequest, super().get(id=id, lazy=lazy, **kwargs))
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/gitlab/exceptions.py", line 346, in wrapped_f
    raise error(e.error_message, e.response_code, e.response_body) from e
gitlab.exceptions.GitlabGetError: 403: 403 Forbidden

Observed in https://gitlab.freedesktop.org/elliot_chen/weston/-/jobs/86174879

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-10-17 09:43:12 +00:00
Derek Foreman
5ee711d374 compositor: Add some comments to paint node members
Just a bit of documentation.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-10-16 11:12:13 -05:00
Derek Foreman
9700ec3bc4 gl-renderer: Fix clear optimization
This should be checking for a valid transform so it doesn't use corners
of an axis aligned bounding box for free-form transformed views.

It should still check surf_xform for color management, but it should only
do that when surf_xform_valid is true.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-10-16 11:12:13 -05:00
Derek Foreman
992ab893f9 compositor: Validate that paint node holes have planes
If the backend says a hole is necessary, it must assign a plane for it.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-10-16 11:12:13 -05:00
Derek Foreman
62e76ee5fb compositor/drm-backend: Move censor check into paint nodes
This test is critical, so only do it once, and throw some asserts around
to make sure we don't mess it up.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-10-16 11:12:13 -05:00
Derek Foreman
25a281a0a8 drm-backend/gl-renderer: move fully transparent check into paint node
Video underlay "holes" are fully transparent but must be rendered
fully opaque. However, they appear to be fully transparent to
the current gl-renderer test which is missing a need_hole check.

Add a paint node attribute for this so it can be more easily
checked in assign_planes and renderers.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-10-16 11:04:31 -05:00
Derek Foreman
99ab4ceaca compositor: Rework paint node update stages to correct recent bugs
Remove maybe_replace_paint_node entirely and place the parts of it
properly between early and late updates.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-10-16 10:25:42 -05:00
Derek Foreman
889a564695 compositor: refactor out placeholder color setting
We'll need this in both the early and late paint node updates soon,
so this saves a couple of lines of code.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-10-16 10:25:42 -05:00
Derek Foreman
cb49b386f2 compositor: Move paint node validation into a function
We're going to assert on a bunch of stuff, so let's put it in a function
to remove clutter.

For now it's trivial, but I'll be adding more tests shortly.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-10-16 10:25:42 -05:00
Derek Foreman
59e2a111fa compositor: Remove is_direct from paint node
It's the same as buffer->direct_display essentially 100% of the time,
except maybe if someone set weston_direct on a single-pixel-buffer, but
that's madness.

Just drop it entirely, and let the only existing reader of the variable
get it from the buffer directly.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-10-16 10:25:42 -05:00
Daniel Stone
4ebb06a94f tests: Add helper to create solid-filled buffer
At the moment this is only replacing two clear calls with one. However,
when client_buffer starts using properly-bracketed CPU access, this will
become much more tedious. Introduce a helper now to make it easier.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-16 11:36:33 +03:00
Daniel Stone
2259ac4e93 tests: Remove impossible condition
We always have the name of a reference image to compare to; comparison
is kind of impossible without one.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-16 11:36:33 +03:00
Daniel Stone
4843199479 tests: Fix screenshot assert
We need to check the each screenshot once, not one twice.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-16 11:36:33 +03:00
Daniel Stone
c00997979c tests: Support decoration capture for screenshots
It's pretty trivial to make verify_screen_content() and
capture_screenshot_from_output() support decorations, so we can reuse
those in output-decorations tests rather than open-coding.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-16 11:36:33 +03:00
Daniel Stone
fe4cb8a546 tests: Remove open-coded verify_screen_content()
We already have a helper which does exactly this!

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-16 11:36:33 +03:00
Daniel Stone
4d98190a98 tests: Remove open-coded fill_image_with_color()
This did exactly that.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-16 11:36:33 +03:00
Daniel Stone
087315e242 tests: Use buffer for width/height in color-effects
We don't need a pixman_image to get the buffer width and height, so
don't use it.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-16 11:36:33 +03:00
Daniel Stone
2c5dd92533 tests: Use pixman_image_t for get_middle_row()
get_middle_row() is a pure CPU accessor which only needs to operate on a
pixman_image_t. Pass this directly instead of struct buffer.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-16 11:36:33 +03:00
Daniel Stone
42a9a54665 tests: Remove struct buffer len
Unused.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-16 11:36:33 +03:00
Daniel Stone
e2b3ab38bd tests: Set optimal refresh rate for tests
A very marginal benefit, but why not. Any tests using screen capture are
now using a refresh rate of 0 (redraw immediately on capture request),
whilst others are using HIGHEST_OUTPUT_REFRESH.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-16 11:36:33 +03:00
Daniel Stone
ef6747a951 tests: Document default refresh-rate value
Document what the magic refresh-rate values are, and which is set by
default.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-16 11:36:33 +03:00
Daniel Stone
47f1c1e694 ci: Retry on spurious failures
When we fail out because we couldn't even start a container or bring the
runner environment up, just retry the job.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-14 19:14:28 +01:00
Daniel Stone
ec6c67780e ci: Quieten seatd output
seatd is working well, so the debug spew serves only to annoy people
trying to read the logs.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-14 19:10:27 +01:00
Robert Mader
79ade4c165 backend-drm: Ignore views with fully transparent solid buffers
Some client use subsurfaces with fully transparent single-pixel buffers
for various reasons, such as making it easier to order trees of
subsurfaces. As they are invisible we can simply ignore them in the
scene graph.

This allows us to use direct-scanout/plane-only in more circumstances,
as ensured in the test.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-10-10 16:39:40 +02:00
Derek Foreman
1465362e9f compositor: Move paint node censor into early update
Previously I didn't think we needed this set up before assign_planes, but
certainly in the near future we'll want access to these bits for plane
assignment. It should be harmless to move them all now.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-10-10 09:15:07 -05:00
Robert Mader
e5cbd8536a tests: Add drm offloading test
Recent improvements to llvmpipe made it possible to test dmabuf import
and offloading on vkms. Use our new client-buffer helper and the
presentation protocol to implement tests for simple offloading
scenarios.

Right now this is limited to the vkms default config, only providing us
with one primary and one cursor plane. In the future we can extend the
test to include more advanced scenarios.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-10-10 12:53:44 +02:00
Robert Mader
8c4e3b7de5 weston-test-desktop-shell: Use output size for the background
The hardcoded size of 2000x2000 may cause unexpected issues.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-10-10 12:47:04 +02:00
Robert Mader
3ae7a7b457 weston-test-desktop-shell: Implement desktop_surface_fullscreen_requested()
Add a minimal implementation to allow client to use xdg_toplevel_set_fullscreen().

Note that desktest_shell does not yet properly handle various changes of the surface
state once mapped. Thus we don't handle such cases here either and just
assert on the expected behavior where appropriate.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-10-10 12:42:49 +02:00
Robert Mader
18076228d3 tests: xdg-client-helper: Add maybe_ack_configure() helper
So users are not forced to use xdg_surface_commit_solid().

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-10-10 11:47:08 +02:00
Robert Mader
a1c0d33700 tests: client-helper: Add various globals by default
To make them more easily available for tests.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-10-10 11:47:08 +02:00
Pekka Paalanen
a60169e239 tests: add parametric_color_profile_parsing_errors
This test goes through all the errors one can do in weston.ini
color-profile section, and ensures they give the proper error logging.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-10-09 16:17:57 +00:00
Pekka Paalanen
a06ef0f8aa tests: add color-output-parsing
This tests the [output] section key 'color-profile', which is meant for
setting up parametric color profiles. It tests the special names, and
fetching values from EDID. There are also tests for all accepted keys in
a [color-profile] section.

These tests are all positive. Error messages are tested in another
patch.

The test client helper changes are needed for loading the EDID file.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-10-09 16:17:57 +00:00
Pekka Paalanen
d00b758cee tests/color-metadata-error: use weston_color_profile_init()
No reason to open-code this.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-10-09 16:17:57 +00:00
Leandro Ribeiro
854457524c frontend: allow creating custom param color profiles from .ini
This allow users to specify a fully custom parametric color profile in
weston.ini for a certain output.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Co-authored-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-10-09 16:17:57 +00:00
Pekka Paalanen
360eef9663 color: add weston_color_profile_param_builder_set_target_primaries_named()
The protocol does not carry target primaries by enumeration, but in
weston.ini I want to be able to use a name rather than raw values.
Adding this API makes that possible.

main.c cannot look up the enumeration itself, because color-properties.h
is private. As it should be.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-10-09 16:17:57 +00:00
Pekka Paalanen
9b68277b77 libweston: export weston_color_profile_param_builder_set_primary_luminance()
All the others were already exported, this was forgotten.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-10-09 16:17:57 +00:00
Pekka Paalanen
c0f79189dd shared: add safe_strtofloat()
This is for parsing multiple numbers from one weston.ini key, which
means I cannot use weston_config_section_get_double(). Also going to use
float type, which has less range than double.

Ironically, the tests fill likely fail on locales that do not use
period as the radix character.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-10-09 16:17:57 +00:00
Daniel Stone
f0be8d94a5 gl-renderer: Use glClear for solid opaque regions
If we have a solid region which is opaque, we don't need to go through
blending: we can simply emit a glClear, which has a pretty big benefit
on tilers in particular.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2025-10-09 14:01:12 +01:00