This way we can use the same ID when for perfetto counters to allow
to identify clients much easier.
Also, renamed "surface" with "unlabelled surface" when get_label function
is not set.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Similar to what's just been done to kiosk-shell, use our internal
shell_output instead of directly using weston_output in our internal
structures.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Shells need to find their own internal structures for weston_outputs.
Let's make that process trivial instead of a list walk.
Add a getter and setter for this private data and use it from the kiosk
shell.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We end up doing some extra list walks and mildly awkward contortions to
find the kiosk_shell_output from the weston_output.
Store the kiosk_shell_output instead - it's always trivial to find the
weston_output from that, and it just seems a bit cleaner conceptually for
kiosk shell abstractions to point to other kiosk shell abstractions when
available.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Fixes the following UBSan error:
../../git/weston/libweston/id-number-allocator.c:140:16: runtime error:
left shift of 1 by 31 places cannot be represented in type 'int'
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
realloc() does not initialize the added memory, it needs to be zeroed
explicitly.
Not zeroing this memory had one severe consequence: if the new
lowest_free_bucket was 0xffffffff, weston_idalloc_get_id() would fail an
assertion.
Otherwise non-zero bits in the added memory would just cause id numbers
to be skipped unnecessarily, which does no harm.
Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/1000
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
No functional change here other than asserting that next_num didn't wrap
around. This reorganization helps adding the code
needed to clear the memory added by xrealloc() in the next patch.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Setup a custom assertion handler that increases an assertion counter
instead of aborting on failure. This allows to run all the sub tests
defined for a test and to correctly report which sub test failed.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
NDEBUG doesn't need to be catched anymore now that the test suite
don't use libc's abort() anymore.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
This commit gets rid of libc's abort() usage in the test suite using
test asserts instead.
Asserts run in the server as plugins aren't converted because they are
shared between server and client.
Co-authored-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
It's much more common to have bits defined as enums than having a
position, so let's just directly take a bit as argument to the bit
asserts. For the few cases where only the position is available, it's
easy to get the right bit using a shift.
The is_pow2_64() helper functions have been added in order to validate
the bit passed as argument and prevent programming errors.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
This commit introduces various Weston based asserts for the testing
framework. The goal is to ease test writing and improve readability.
Using custom asserts instead of relying on libc's assert() will also
help providing NDEBUG builds. This is currently not possible because
setting NDEBUG would disable all the asserts in the tests.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
re-aligned the ivi_layout_interface structure in ivi-layout.c.
purely a formatting update, no functional changes were made.
Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
Implement new ivi_layout_interface method and signal to forward
desktop client ping timeout events for unresponsive client handling.
Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
A window freeze can occur in specific use cases like when using a kiosk
shell. It scales surfaces to fit the compositor size and the transformation
to buffer space can, in some cases, round the size one pixel higher than
the texture size, making glTexSubImage2D() refuse the size argument and
generate a GL_INVALID_VALUE without updating the texture.
This commit ensures the GL renderer doesn't exceed the texture size.
Here is how the issue was reproduced:
$ weston --renderer=gl --backend=wayland --width=1920 --height=1080 --shell=kiosk
$ gst-launch-1.0 videotestsrc ! video/x-raw,height=590,width=500 ! waylandsink display=wayland-1
Signed-off-by: Théo Maillart <tmaillart@freebox.fr>
When in VRR mode, repainting without a wait might happen instantly,
so do it.
This is likely not the best long term solution, but is ok for now
while weston's vrr support is experimental.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Query the vrr_capable property for heads, and expose it to frontends.
Currently we only support game mode VRR, but expose VRR capabilities as
an enum in anticipation of supporting QMS VRR in the future.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Formats using SHADER_VARIANT_Y_XUXV can now use SHADER_VARIANT_Y_UV
instead with swizzle variations in order to simplify the fragment
shader.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
The sampler type, which was initially meant for the GL renderer, is
currently used to derive the color model of pixel formats. This commit
gets rid of this legacy field and replaces it with an explicit one
indicating the color model.
Note that it also fixes the issue that formats wouldn't be considered
YUV if ENABLE_EGL isn't defined because the sampler type field in that
particular case would always be 0.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Automatise variant and planes selection for legacy EGL buffers support
by using the global information from the YUV formats table and setup
texture swizzles for legacy EGL buffers and dma-buf.
Signed-off-by: Loïc Molinari <loic.molinari@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>
Support more YUV formats using texture swizzles. Automatise wl_shm
format addition based on the format table using the new texture format
utility gl_texture_is_format_supported().
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Add new formats supported by OpenGL to the pixel formats table: R16,
RG88, GR1616, RG1616, XRGB16161616 and ARGB16161616.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Support more RGB formats using texture swizzles. Automatise wl_shm
format addition based on the format table using the new texture format
utility gl_texture_is_format_supported().
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Simplify fragment shader logic by getting rid of the RGBX variant
which can be implemented using texture swizzles instead.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>