Commit graph

19 commits

Author SHA1 Message Date
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
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
Erico Nunes
811edc0a8c tests/client-buffer: Update Vulkan format mustpass list for CI
Now that new formats are supported by the Vulkan renderer, update
this list to match our driver in CI for a more reasonable coverage.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-09-08 12:02:11 +01:00
Robert Mader
af834d1419 tests/client-buffer: Use shared client-buffer utils
Use the shared helper in order to avoid duplication. This will also
ensure that any format added to the test will also be usable by other
tests and clients.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-09-05 11:47:18 +02:00
Robert Mader
092fe3f7ec tests/client-buffer: Sync dmabufs with DMA_BUF_IOCTL_SYNC
As required by the spec when accessing dmabufs from the CPU, see
https://docs.kernel.org/driver-api/dma-buf.html

While effectively a no-op on amd64, this fixes test failures on various
aarch64 devices, including:
 - rk3588 (Panfrost, Rock5)
 - rk3399 (Panfrost, PineBook Pro)
 - Broadcom BCM2712 (V3D, RPi5)
 - Qualcomm SDM845 (freedreno, OnePlus6)

Fixes: 303d88448 (tests: client-buffer: Add dmabuf support)
Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-08-25 12:10:10 +02:00
Erico Nunes
ec52e0cdda tests: Add support for Vulkan renderer
Add support for Vulkan renderer in most places where there was
support for GL renderer.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-23 20:36:05 +01:00
Pekka Paalanen
f71db77341 tests/client-buffer: reduce the scope of #if
Containining the pre-compiler conditionals inside tiny functions makes
the code easier to read.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-05-15 16:24:53 +03:00
Pekka Paalanen
381bc2761f tests/client-buffer: annotate unintended test cases
These cases were never meant to exist, but because the harness assumes
all tests must run on all fixtures, we have to return something.

This is a temporary measure to improve readability. Eventually this test
program should be split:

- shm RGB + YUV
- dmabuf RGB without force-yuv-fallback
- dmabuf YUV with and without force-yuv-fallback

or

- shm RGB + YUV
- dmabuf RGB + YUV without force-yuv-fallback
- dmabuf YUV with force-yuv-fallback

or

- shm + dmabuf; RGB + YUV without force-yuv-fallback
- dmabuf YUV with force-yuv-fallback

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-05-15 16:24:53 +03:00
Pekka Paalanen
33d82b6b79 tests/client-buffer: handle no-list in format_must_pass()
Make the callers simpler and easier to read.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-05-15 15:49:23 +03:00
Robert Mader
fe5a846512 tests: client-buffer: Use gl_force_import_yuv_fallback quirk
Ensure we test our internal YUV->RGB shader and multiplane paths.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-05-15 15:08:18 +03:00
Robert Mader
65e3a7324a tests: client-buffer: Return RESULT_SKIP where appropriate
Split up the test to run it for SHM and DRM individually so we
get fine-grained results.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-05-15 15:08:18 +03:00
Robert Mader
68aed0775e tests: client-buffer: Remove llvmpipe workarounds
The issue were fixed in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34775

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-05-15 15:08:18 +03:00
Erico Nunes
14d95cd6ce tests: client-buffer: Support must pass list per renderer
This test has only supported the GL renderer, with a must pass list of
formats which matches what the GL renderer advertises and supports.
This commit prepares the test to support other renderers by moving the
must pass list to the test setup declaration, so that it can be defined
per renderer. This is in preparation to add more renderers here as a
followup.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-13 17:08:52 +03:00
Erico Nunes
6f6576dec2 tests: client-buffer: Add arguments to fixture setup
Prepare to add more multiple renderer options.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2025-05-13 17:08:52 +03:00
Pekka Paalanen
e57eb5b15d tests: return status from each test definition
Add a status return value to every test definition. There are no
behavioral changes, previously the RESULT_OK was simply assumed.

The benefit of this is that in the future individual tests can also
return RESULT_SKIP, so that we can keep statistics of skipped tests.

ivi-layout-internal-test.c has the only case where a test function may
return early. That one is set to return RESULT_HARD_ERROR to match the
compositor exit code already there.

Also documentation is updated.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2025-04-30 15:07:35 +03:00
Robert Mader
303d88448a tests: client-buffer: Add dmabuf support
Using the udmabuf allocator which is usually available these days,
both on CI runners and dev mashines. The buffers have the the same
content are tested against the same reference images as in the shm
case.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-04-30 11:39:25 +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
Renamed from tests/shm-buffer-test.c (Browse further)