When we receive dmabuf feedback, we hit the VK_SUBOPTIMAL path and
recreate the swapchain, returning early without submitting work.
However, we've already reset the fence before we do this, so we'll
block forever waiting for work that never comes to signal it.
Instead, we should reset the fence right before we know we're submitting
work.
Fixes: 75c37afa ("clients/simple-vulkan: New Vulkan client example")
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
If we don't receive a surface_leave before an output_destroy, the window
output lists can hold a stale reference to the destroyed output.
Call surface_leave for the output on all windows to make sure it's not on
any lists.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
In the last commit we've added support for dma-buf screenshots in our
GL-renderer. So let's enable the screenshot client to use it.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Add a way for weston-color to disable color-management, so we have a
simple single-pixel-buffer test.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Since glibc version 2.43, bsearch may return const void * instead of
void * when the input array is const:
"For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return
pointers into their input arrays now have definitions as macros that
return a pointer to a const-qualified type when the input argument is a
pointer to a const-qualified type."
So change variable that receives the return value from bsearch to const,
as the input array has the const qualifier. This fixes a "discards const
qualifier from pointer" error.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
commit-timing uses presentation feedback to drive its repaint loop, no
need to keep the frame callback.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Add a simple client that queues up a few future frames and logs how
accurately the requested presentation times were hit.
This used simple-shm as a skeleton, and those copyrights have been retained.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
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>
Similarly to simple-egl, teach simple-shm to also do that if pressing
F11. Allows testing stuff much easier -- without installing key-bindings
in the shell.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
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>
If any output uses a YUV format, instead of trying to composite into a
png, write the raw data into .yuv files for each output.
These files don't contain any metadata yet, thus one may want to convert
them into y4m files with e.g. a command like the this:
ffmpeg -s 1024x768 -r 1 -pix_fmt yuv420p -i ~/wayland-screenshot-output-0-2025-08-01_15-58-24.yuv -c:v copy screenshot.y4m
Note that this may only work for certain pixel formats, such as
DRM_FORMAT_YUV4[20|22|44], and not for e.g. DRM_FORMAT_P010.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Instead of relying on the compositor to allocate dmabufs for the
writeback connector and copying the results to the client-provided
shm-buffer, support allocating dmabufs in the client. The compositor
will pass them through to the writeback connector, effectively doing
the equivalent to "passthrough"/"plane-offloading"/"zero-copy".
Based on a patch by Chien Phung Van <chien.phungvan@vn.bosch.com>
Signed-off-by: Robert Mader <robert.mader@collabora.com>
So the buffer has the WESTON_BUFFER_SOLID type, which will make
additional optimizations easier going forward.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Add support for using writeback connectors as source. Those potentially
support more than one format, thus allow selecting those as well.
While on it, add a verbose flag for useful debug output.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
The writeback output capture source may allow clients to select from
multiple possible formats. Update the protocol and its users
accordingly, and add formats_done event, making the implementation
easier and following common protocol practice.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Historically, weston-screenshooter attempts a capture on all
wl_outputs, and if any output fails to capture it exits immediately.
These days it's possible to set up the pipewire backend to mirror
a drm backend output. This leads to surprising behaviour if one
tries to screenshot while no pipewire client is in use. Since the
pipewire backend has no buffer to render into at this point, the
screenshot fails. The drm screenshot is then dropped on the floor
because one of the wl_outputs failed to capture.
Avoid this for now by just continuing in the case of such
"graceful failures". Though maybe in the future we should allow
picking a wl_output by name, or have a command line switch to
decide whether to stop after a failure or not.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
In some cases it is possible that a frame becomes available by its
fence but the last used swapchain image has still not been returned to
the swapchain. If the render_done semaphore is part of the frame struct
it will be reused and cause a validation error.
To prevent this from happening, move the render_done semaphore to the
image struct so that each of those semaphores is only used when the
associated image is safely acquired from the swapchain.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
kiosk-shell/xdg-shell is the (more) modern approach, so let's inform
users that fullscreen-shell is going way.
This also adds an explicit dependency of shell-fullscreen for
screenshare. With this change, both screenshare and fullscreen-share
are disabled by default.
Fixes: #848
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Example to serve as a reference of a basic Wayland client using
Vulkan with dmabuf. This does not use a traditional Vulkan swapchain
but implements it using imported gbm buffers. Also features use of
linux-explicit-synchronization-unstable-v1 with Vulkan.
Based on weston-simple-dmabuf-egl.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Example to serve as a reference of a basic Wayland client using
Vulkan, contained in a single source file and with a minimal set
of dependencies.
Features incremental present (similar to swap_buffers_with_damage
from EGL) which is not commonly used by other Vulkan demos and is
useful to test the compositor.
Based on weston-simple-egl.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
This converts weston_matrix and weston_vector to use linalg-types
internally. All direct accesses to members had to be converted
everywhere, mostly in the simplest form possible which leaves some
trivially reducable code around.
The intention is that we can now gradually migrate away from
weston_matrix in the future.
Look like one trailing space got accidentally annihilated in
compositor.c.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The 24 bpp RGB and BGR SHM formats are meant to be stored little
endian, not big endian.
Fixes a regression in commit 815ccaff.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Prior to executing a new command restore the parent process to the
default SIG_DLF handler as we normally use SIG_IGN it to avoid
crashing on pasted input.
As we seem to be hitting a Broken Pipe message when running
certain scripts, it seem we need to restore back the
default handler.
This is similar to what other folks have been doing in
https://github.com/labwc/labwc/issues/1209.
Fixes: #994
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This is a temporary solution to easily test wl_shm support for
different RGB formats. I think it would be better to have a dedicated
client to test all the supported RGB and YUV formats for the wl_shm,
dma-buf import and legacy EGL protocols.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
This is problematic as we don't have namespacing for these and some of
the macros can interfere with other defines.
This reverts commit 8634c7e349.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Commit 264c205add ignored the fact that a
background color of 0 should fall back to the background image, and
broke that case.
Fixes 264c205add
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Non-opaque backgrounds don't make sense, and cause rendering
problems.
Silently set backgrounds fully opaque, and remove any mention of
alpha from the man page.
Kiosk-shell already implicitly forces opaque backgrounds.
Old weston.ini with FF for alpha will always continue to work.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Previously, commands could only be specified by their path,
so it was not possible to pass arguments.
Use the 'command' config first,
and if it is NULL, fall back to the existing 'path' config.
Signed-off-by: Gyeyoung Baek <gyeyoung976@gmail.com>
Co-authored-by: Michael Olbrich <m.olbrich@pengutronix.de>
As weston_windowed_output_get_api needs ARRAY_LENGTH() move helpers to a
libweston/ so other users can re-use that instead of re-defining these
all over. Easier for other front-ends to make use of them.
With this change windowed-output-api.h also includes the helpers header.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Add a client that creates a surface with one color using single pixel buffer.
Set to that surface an image_description created with the parametric creator of
the color management protocol.
This client can get as params:
1. Width and height
2. Color channels R, G, B, A
3. The name of primaries
4. The name of a transfer function
5. The min, max, ref luminance levels
Signed-off-by: Joan Torres <joan.torres@suse.com>
Rendering the shadow currently renders some dark color near the border inside
the inner content.
Altough the content is on top of it, if the content has some transparency,
that dark color appears and this might be unwanted.
Add an option to not render the shadow to avoid that problem.
Signed-off-by: Joan Torres <joan.torres@suse.com>