Commit graph

10502 commits

Author SHA1 Message Date
Derek Foreman
a3f0e97a71 compositor: Support the commit-timing protocol
Introduce support for the commit-timing protocol to allow applications
to attach a presentation time to a content update.

We use the repaint timer to schedule content updates in advance of
the frame time when they should be displayed.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:58:01 -06:00
Derek Foreman
65227cb7d4 compositor: Round repaint times down to possible presentation times
Currently this shouldn't result in any change, since the times we pass in
are real presentation times.

Later when commit-timing lets applications pass in arbitrary times, it
will be more interesting.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:58:01 -06:00
Derek Foreman
ed77aca2d8 compositor: check repaint_msec with a helper
Validate repaint_msec so it's not longer than a refresh interval.

Negative repaint windows will cause problems for frame scheduling in the
future, so remove them.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:58:01 -06:00
Derek Foreman
e286cf6e15 core: rename and internally share output_repaint_timer_arm
When we add timed transactions, we'll want to feed them through the repaint
timer, so share it to allow this in the future.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:58:01 -06:00
Derek Foreman
37256645d6 tests: Listen for the presentation clock id
Add a listener and a roundtrip so test clients using presentation have
access to the presentation clock id.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:58:01 -06:00
Derek Foreman
0a76cb86ca compositor: Upgrade repaint timer precision to nsec
We can now use 1ns as the minimum timer duration instead of 1ms.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:58:01 -06:00
Derek Foreman
37acb0c0fd compositor: Directly use a timerfd instead of a wl_event_source
In the near future commit-timing + VRR combined will want to have better
than the 1ms precision we're allowed now.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:58:01 -06:00
Derek Foreman
2bbe222883 compositor: Improve timing information in scene graph dump
After moving the drm-backend's scene graph dump, it now always occurs when
repaint_status is REPAINT_AWAITING_COMPLETION, which loses useful timing
information we used to have.

Add timing information for the REPAINT_AWAITING_COMPLETION state, and also
add the expected presentation time.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:57:29 -06:00
Derek Foreman
eb61323aa1 compositor: Improve VRR timings
When we need to use VRR, we'll miss a potential frame deadline, fail to
deliver a frame, then stop the repaint loop. When a late frame comes
in, we deliver it immediately at the start of a new repaint loop.

The only time we really need to deliver a frame immediately is at
the start of the loop, otherwise we can use the same repaint window
behaviour as any other time.

This still leaves some room for improvement, as we still don't try
to avoid Vactive.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:21:44 -06:00
Derek Foreman
2dce06179f compositor: Don't return repaint times in the past
If we're late to present, just return the current time instead of a time in
the past.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:21:43 -06:00
Derek Foreman
75f2ec4747 compositor: Pull repaint time calculation out of finish_frame
Make this into a separate functions we can call from other places to get
the same results.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:21:43 -06:00
Derek Foreman
f36a3a91a8 compositor: Rearrange weston_output_finish_frame
Move some code around so we only derive the next repaint from the next
presentation time and the repaint window once at the end of the function.

In many cases we now subtract the repaint_msec value from "now", but that's
ok because any time earlier than "now" will still result in firing the timer
at the same time.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:21:43 -06:00
Derek Foreman
01b7e9d015 compositor: store frame flags from finish frame
These are used to determine if the previous frame was displayed with
tearing, which is useful in determining when the next frame time should
be.

Store these as a step towards breaking the frame time calculations out
of output_finish_frame into a separate function.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:21:43 -06:00
Derek Foreman
f1bcedd089 compositor: Track repaint time and expected presentation time
For the upcoming commit-timing protocol, we're interested in when a
scheduled repaint will be displayed, so let's keep track of both the
repaint time and the anticipated presentation time.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:21:43 -06:00
Derek Foreman
d88efaea66 backend-drm: More aggressively avoid the stale timestamp workaround
At first we always used this workaround, and then we stopped using it when
VRR was in use.

Turns out it also hurts presentation times when starting the repaint loop,
which makes the commit-timing protocol difficult to implement.

Completely avoid the workaround on any kernel newer than 4.12, based on a
capability check for DRM_CAP_CRTC_IN_VBLANK_EVENT, and log a warning at
startup.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:21:43 -06:00
Derek Foreman
fc2e365c1d compositor: Update to presentation-timing version 2
This fixes a bug in version 1 where we should've been giving a 0 refresh
for VRR, and introduces version 2 where we're allowed to give a compositor
chosen rate for VRR.

We currently chose the mode's native refresh rate.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 10:21:43 -06:00
Pekka Paalanen
2e66195546 tests/string: fix false-positive uninitialized val
GCC 14.2 with debugoptimized build complained:

In file included from ../../git/weston/tests/weston-test-assert.h:32,
                 from ../../git/weston/tests/string-test.c:36:
In function ‘strtof_conversions’,
    inlined from ‘wrapstrtof_conversions’ at ../../git/weston/tests/string-test.c:92:1:
../../git/weston/shared/weston-assert.h:60:12: error: ‘val’ may be used uninitialized [-Werror=maybe-uninitialized]
   60 |         if (!cond)                                                              \
      |            ^
../../git/weston/tests/weston-test-assert.h:153:34: note: in expansion of macro ‘weston_assert_’
  153 | #define test_assert_f32_eq(a, b) weston_assert_(NULL, a, b, float, "%.10g", ==)
      |                                  ^~~~~~~~~~~~~~
../../git/weston/tests/string-test.c:97:9: note: in expansion of macro ‘test_assert_f32_eq’
   97 |         test_assert_f32_eq(val, 0.0);
      |         ^~~~~~~~~~~~~~~~~~
../../git/weston/tests/string-test.c: In function ‘wrapstrtof_conversions’:
../../git/weston/tests/string-test.c:94:15: note: ‘val’ was declared here
   94 |         float val;
      |               ^~~

The debug build did not complain.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-12-16 15:19:02 +00:00
Pekka Paalanen
6af97ec150 tests/paint-node: fix false-positive uninitialized variable
GCC 14.2 with debugoptimized build complained:

../../git/weston/tests/paint-node-test.c: In function ‘get_paint_node_status’:
../../git/weston/tests/paint-node-test.c:105:16: error: ‘changes’ may be used uninitialized [-Werror=maybe-uninitialized]
  105 |         return changes;
      |                ^~~~~~~
../../git/weston/tests/paint-node-test.c:87:39: note: ‘changes’ was declared here
   87 |         enum weston_paint_node_status changes;
      |                                       ^~~~~~~

The debug build did not complain.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-12-16 15:19:02 +00:00
Pekka Paalanen
66eaeb0c3f tests/fifo: fix false-positive uninitialized width
GCC 14.2 with debugoptimized build complained:

../../git/weston/tests/fifo-test.c: In function ‘get_surface_width’:
../../git/weston/tests/fifo-test.c:493:16: error: ‘width’ may be used uninitialized [-Werror=maybe-uninitialized]
  493 |         return width;
      |                ^~~~~
../../git/weston/tests/fifo-test.c:477:13: note: ‘width’ was declared here
  477 |         int width;
      |             ^~~~~

The debug build did not complain.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-12-16 15:19:02 +00:00
Pekka Paalanen
92c15464aa tests/client-buffer: fix false-positive uninitialized variables
GCC 14.2 with debugoptimized build complained:

../../git/weston/tests/client-buffer-test.c: In function ‘y_u_v_create_buffer’:
../../git/weston/tests/client-buffer-test.c:1045:33: error: ‘u_row’ may be used uninitialized [-Werror=maybe-uninitialized]
 1045 |                                 x8r8g8b8_to_ycbcr8_bt709(argb, y_row + x,
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1046 |                                                          u_row + x / pixel_format_hsub(buf->fmt, 1),
      |                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1047 |                                                          v_row + x / pixel_format_hsub(buf->fmt, 1));
      |                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/weston/tests/client-buffer-test.c:986:18: note: ‘u_row’ was declared here
  986 |         uint8_t *u_row;
      |                  ^~~~~
../../git/weston/tests/client-buffer-test.c:1045:33: error: ‘v_row’ may be used uninitialized [-Werror=maybe-uninitialized]
 1045 |                                 x8r8g8b8_to_ycbcr8_bt709(argb, y_row + x,
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1046 |                                                          u_row + x / pixel_format_hsub(buf->fmt, 1),
      |                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1047 |                                                          v_row + x / pixel_format_hsub(buf->fmt, 1));
      |                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/weston/tests/client-buffer-test.c:987:18: note: ‘v_row’ was declared here
  987 |         uint8_t *v_row;
      |                  ^~~~~

The debug build did not complain.

Even though only u_row and v_row were reported, I don't understand why
there is no warning about u_base and v_base, as they are initialized
with a similar switch. So initialize them too, just in case.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-12-16 15:19:02 +00:00
Pekka Paalanen
c23d028300 libweston: fix false-positive uninitialized variables sx, sy
GCC 14.2 with debugoptimized build complained:

../../git/weston/libweston/input.c: In function ‘weston_pointer_set_focus’:
../../git/weston/libweston/input.c:1988:29: error: ‘sx’ may be used uninitialized [-Werror=maybe-uninitialized]
 1988 |                 pointer->sx = sx;
      |                 ~~~~~~~~~~~~^~~~
../../git/weston/libweston/input.c:1913:20: note: ‘sx’ was declared here
 1913 |         wl_fixed_t sx, sy;
      |                    ^~
../../git/weston/libweston/input.c:1989:29: error: ‘sy’ may be used uninitialized [-Werror=maybe-uninitialized]
 1989 |                 pointer->sy = sy;
      |                 ~~~~~~~~~~~~^~~~
../../git/weston/libweston/input.c:1913:24: note: ‘sy’ was declared here
 1913 |         wl_fixed_t sx, sy;
      |                        ^~

Initialize with an arbitrary value to avoid the warning. This value
should never make it outside of this function.

The debug build did not complain.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-12-16 15:19:02 +00:00
Pekka Paalanen
6955752b95 doc: fix Meson warning about install_subdir
../../git/weston/doc/sphinx/meson.build:97: WARNING:
Project targets '>= 0.63.0' but uses feature deprecated since '0.60.0':
install_subdir with empty directory. It worked by accident and is buggy.
Use install_emptydir instead.

I get the above warning on a clean build, because the directory in
question is empty at configure time. It gets populated at compile time.

Having to exclude one file from the build complicated fixing this.
custom_target() does not support install-excludes, and it looks like
Sphinx does not allow locating the buildfile elsewhere. One option would
be to use a meson.add_install_script() to delete the unwanted file after
it has been installed, but this seemed more complicated than the
solution I chose.

The intermediate build directory name needs to change from 'doc' to
'weston', so that I don't need to strip_directory which custom_target
does not support. The 'output' array in custom_target() also does not
allow outputs to be speficied in sub-directories.

The sh script is tidied up a little bit with set -e, otherwise it would
have become unreadable.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-12-16 15:19:02 +00:00
Marius Vlad
c0a6b7c1c9 gitlab-ci: Switch to using Bookworm (LTS) for doing code coverage
The initial step from gcov/lcov gives a few parsing errors like
'mismatched end line' or 'mismatched exception tag for'.

Been trying with llvm-cov, downgrading to gcc-13 and using different
gcov versions including one from oldoldstable -- I'm repeatably getting
these errors.

I turned instead of the idea to use our previous stable version, now the
oldstable/LTS as that was capable of doing code coverage.  So possibly
either gcc-13 is the first version that causes these issues but we're
having gcc-14 in Trixie so it doesn't really matter. For now use this
work-around until we have something better.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-12-16 11:46:39 +00:00
Marius Vlad
1e55fd2449 gitlab-ci: Bump CI to Trixie and LTS to bookworm
This includes a few changes, but given that we still want to bisect
things when they break I'm pulling some of the changes into a bigger change.

Here's a list of most noticeable that I had to address in order to make
this switch:

- added a PACKAGES_SPECIFIC env variable to able to pass different
  packages to each version. Some packages basically changed their names
  and need to pass a different name
- added USE_DEBIAN_BACKPORTS and use it when adding -backport apt
  sources for each Debian version
- llvm-19 now requires some additional packages for trixie
- add imghdr for sphinx for trixie
- had to keep use_tls=0 and modified the notes to point now to Trixie
  instead of Bookworm

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-12-16 11:46:39 +00:00
Derek Foreman
0680683539 input: Don't refocus clients when pointer moves against boundary
If we don't clamp the input before updating the pointer surface coords,
we'll trigger the "surface jumped beneath us" logic later when the clamp
really happens. That leads to spurious pointer leave/enter events.

Add clamping to weston_pointer_send_motion() to fix this.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 09:22:05 +00:00
Derek Foreman
613558e69e input: refactor weston_pointer_move_to
Pull the clamping out and expose an internal pre-clamped function, which
will be used elsewhere in a later commit.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 09:22:05 +00:00
Derek Foreman
d830ce962a input: move some pointer functions
These will be used earlier in the file soon, move them now.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-16 09:22:05 +00:00
vorlunez
025f5a7c45 input: fix setting hint_is_pending
when the hint_is_pending is true, it should assign the hint_pending to the hint and set the hint_is_pending to false, but the hint_is_pending set to true again after setting to false.

remove the redundant line to fix this.

Signed-off-by:  Vorlune Zhang <Vorlune.Zhang@gmail.com>
2025-12-16 15:16:15 +08:00
Marius Vlad
582ae5385b xwayland: Fix some memory leaks on compositor shutdown path
While exiting, on the shutdown compositor path, for instance if we don't have
permission access to create a lock file we will end up reporting some memory
leaks/use-after-free.

This patch addresses of all them:

- api->listen returns NULL and we do not property free wet_xwayland
  struct
- we don't remove the signal handler causing a use-after-free (signal
  handler gets called by the main object has been freed)
- we don't remove/destroy the debug scope causing a mem-leak
- on the same path check for valid event source to avoid deref invalid
  pointers.

Add a simple wrapper which we can call in other call sites.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-12-15 11:35:04 +02:00
Daniel Stone
119ce40714 drm-backend: Reuse prior state where possible
If we're in a steady state, doing nothing but flipping buffers, we can
try to avoid going through our full routine of brute-forcing an
acceptable plane state, by instead just reusing the old state and
changing only the FB it refers to.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-12 14:09:50 -06:00
Derek Foreman
e2cda4570e drm/state-propose: Store the type of proposed state
Keeping track of what mode we prepared the state in will be useful
for printing debug information later, when we have a way to reuse
old state.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-12 14:09:50 -06:00
Derek Foreman
eda7e524fd drm/state-propose: Add an invalid state
We're going to add a way to reuse state, but we don't currently have a way
to represent invalid state - such as before we've ever commit any state
at all.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-12 14:09:50 -06:00
Derek Foreman
aefdbb0278 drm: Move enum drm_output_propose_state_mode into internal header
This is in preparation for storing the mode with the state later.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-12 14:09:50 -06:00
Derek Foreman
57ad320d86 drm: Refactor some debug statements
These have the same form, and we're about to add a few more with the same
form again, so make a helper function.

This sweeps up the one weird one that printed [view] while failing [state].

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-12 14:09:50 -06:00
Derek Foreman
87776413ba drm: Add whether planes are enabled or not to the drm output state
This will be handy later when trying to determine when it's ok to reuse
output state, as changing this would invalidate previous state.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-12 14:09:50 -06:00
Marius Vlad
2bb8cdba83 backend-drm: Initialize bo_fd
On some aarch64 platforms with GCC13 we're seeing:

../../../weston-14-new/libweston/backend-drm/fb.c:152:15: warning: 'bo_fd' may be used uninitialized [-Wmaybe-uninitialized]
  152 |         ret = drmPrimeFDToHandle(fb->fd, bo_fd, &handle);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../weston-14-new/libweston/backend-drm/fb.c: In function 'drm_fb_addfb':
../../../weston-14-new/libweston/backend-drm/fb.c:117:13: note: 'bo_fd' was declared here
  117 |         int bo_fd;

Just initialize it to avoid trigger the warning.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2025-12-12 11:39:55 +02:00
Robert Mader
42aeea2220 gitlab-ci: Bump kernel to 6.18
The first stable release with everything required to let our tests pass.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-12-10 13:18:14 +01:00
Alyssa Ross
54217f5d88 frontend: don't require XDG_RUNTIME_DIR
Recent versions of libwayland support absolute paths in display names,
and in that case do not require XDG_RUNTIME_DIR to be set.  It's
therefore overly strict for Weston to exit due to XDG_RUNTIME_DIR being
unset when it would work perfectly fine without it.  The messages
displayed for incorrectly set XDG_RUNTIME_DIR are useful though, so keep
them around, but only display them if wl_display_add_socket() fails
i.e. the lack of XDG_RUNTIME_DIR has actually caused a problem.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2025-12-09 11:46:01 +02:00
Alyssa Ross
85315c4841
backend-headless: fix undeclared FALSE identifier
It looks like FALSE is only used in a few files in Weston, whereas false is much
more commonly used.  Presumably FALSE comes from some library not included in
the headless backend (at least in my case).

	FAILED: [code=1] libweston/backend-headless/headless-backend.so.p/headless.c.o
	gcc -Ilibweston/backend-headless/headless-backend.so.p -Ilibweston/backend-headless -I../../home/qyliss/src/weston/libweston/backend-headless -I. -I../../home/qyliss/src/weston -Iinclude -I../../home/qyliss/src/weston/include -Ilibweston -I../../home/qyliss/src/weston/libweston -Iprotocol -I/nix/store/mvhj7fm6bkmz6ismdp8vcmwn34w94b8n-libglvnd-1.7.0-dev/include -I/nix/store/v7jn3cy1wjaf9pm60ix9y6dfma0bj4a3-wayland-1.24.0-dev/include -I/nix/store/xi04j07bl6bbckky5n8a1k06spxxfg9i-pixman-0.46.4/include/pixman-1 -I/nix/store/xvzhnfwxvl480qpjxm83wwhd287b3lgm-libxkbcommon-1.11.0-dev/include -I/nix/store/22qgb8p593613861117ay4gzmf9b7rns-libdrm-2.4.125-dev/include -I/nix/store/22qgb8p593613861117ay4gzmf9b7rns-libdrm-2.4.125-dev/include/libdrm -I/nix/store/zl58kqaf677skihj840rf05svsmrhmmc-cairo-1.18.4-dev/include/cairo -I/nix/store/6sscd9xxffhjrci2xbw9yv8inc2rc0ry-freetype-2.13.3-dev/include/freetype2 -I/nix/store/6sscd9xxffhjrci2xbw9yv8inc2rc0ry-freetype-2.13.3-dev/include -I/nix/store/z88mxig65mxgyn1yxsz92m4w1rn51aci-libpng-apng-1.6.50-dev/include/libpng16 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu11 -O0 -g -Wmissing-prototypes -Wno-unused-parameter -Wno-shift-negative-value -Wno-missing-field-initializers -Wno-pedantic -Wundef -fvisibility=hidden -Wmissing-prototypes -Wno-unused-parameter -Wno-shift-negative-value -Wno-missing-field-initializers -Wno-pedantic -Wundef -fvisibility=hidden -fPIC -MD -MQ libweston/backend-headless/headless-backend.so.p/headless.c.o -MF libweston/backend-headless/headless-backend.so.p/headless.c.o.d -o libweston/backend-headless/headless-backend.so.p/headless.c.o -c ../../home/qyliss/src/weston/libweston/backend-headless/headless.c
	../../home/qyliss/src/weston/libweston/backend-headless/headless.c: In function ‘config_init_to_defaults’:
	../../home/qyliss/src/weston/libweston/backend-headless/headless.c:788:29: error: ‘FALSE’ undeclared (first use in this function)
	  788 |         config->fake_seat = FALSE;
	      |                             ^~~~~
	../../home/qyliss/src/weston/libweston/backend-headless/headless.c:788:29: note: each undeclared identifier is reported only once for each function it appears in

Fixes: 0126a5b4 ("backend-headless: Add an option to enable a fake seat")
Signed-off-by: Alyssa Ross <hi@alyssa.is>
2025-12-09 09:41:52 +01:00
Alyssa Ross
e4a51996d8
libweston: fix error message for missing PAM
The helpful error message with the hint to set -Dbackend-vnc=false was
unreachable, because libpam would either be found, or the default, less
helpful error message for a missing library would be shown.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2025-12-08 14:56:49 +01:00
Olivier Fourdan
0126a5b4fc backend-headless: Add an option to enable a fake seat
When running headless, weston will not expose a wl_seat.

This was removed with commit a1046adc ("compositor-headless: do not
create a seat").

However, some applications, namely GTK3 based, will log a warning when
there is no wl_seat:

 | gdk_seat_get_keyboard assertion GDK_IS_SEAT(seat) failed

While this is arguably a bug in GTK3 which should not complain with a
legit setup, that breaks the CI of those projects when using Weston,
while most of the other Wayland compositors will create a fake seat when
running headless, making weston the odd ball there.

This changes adds a new option "--fake-seat" that will instruct weston
to create a seat when running headless. The default remains not to
create a seat though, so backward compatibility is preserved.

This partially reverts commit a1046adc66.

See-also: https://gitlab.freedesktop.org/ofourdan/xwayland-run/-/issues/12
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2025-12-08 11:44:27 +01:00
Derek Foreman
cb97abd4f7 compositor: Add the fifo-v1 protocol
Add support for the fifo protocol, which allows an application to submit
a content update that can only be applied after the previous content
update has been active for a display refresh.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-04 14:03:13 -06:00
Derek Foreman
23204eca75 tests: Bind the fifo protocol
Add the fifo protocol to the helper framework.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-04 14:03:13 -06:00
Derek Foreman
f50296d4e9 compositor: Add a deferred content update framework
Now that we have surface-state application streamlined, it's fairly easy to
add a framework for deferring content updates.

This will be used soon for fifo and commit timing. For now, the
weston_surface_state_ready() call that makes any of this do something
will always return true.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-04 14:03:10 -06:00
Derek Foreman
73e0bb2829 compositor: Try to remove some unnecessary repaints
If a surface isn't visible, there's no point in performing a repaint when
its state changes. However, we don't know if a surface is visible until
we perform the scene graph updates at repaint.

Use our new visibility tracking API to check whether we need to perform
a repaint, or if we can just skip it.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-04 13:55:23 -06:00
Derek Foreman
61134fa151 compositor: Track view and surface visibility per output
Keep track of whether a view has any unoccluded pixels on an output,
use this information to add a weston_surface_visibility_mask() function
that we'll use later.

Since the visibility information is calculated at repaint, and invalidated
by some (but not all) state updates, we'll keep track of when the previous
repaint's status is still valid by watching surface status bits.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-04 13:55:20 -06:00
Derek Foreman
6a280a8fad compositor: Push subsurface order application into apply_state
Seems like it makes sense to have it there, and this cleans up a bunch of
paths where we return status bits so a caller can do this.

We can also drop the explicit setting of view_list_needs_rebuild, as it's
going to happen automatically when applying subsurface order.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-04 12:38:17 -06:00
Derek Foreman
7bfedba650 compositor: move weston_surface_schedule_repaint into surface-state.c
Only user is there, so move it across.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-04 12:38:17 -06:00
Derek Foreman
08f9d791b5 tests: Refactor get_presentation
In the future more than one test group will want to use presentation
feedback, so let's pull the basics into weston-test-client-helper

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-04 12:38:17 -06:00
Derek Foreman
5eb5c4991d tests: Refactor get_subcompositor
We open code this in several tests. Move a single implementation to
weston-test-client-helper instead.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2025-12-04 12:38:17 -06:00