From ff3b8197fd1b41d163d85f69aa9930b5d57ffb44 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Wed, 13 Dec 2023 15:00:35 +0100 Subject: [PATCH] tests/wayland-test-clients: Use ARGB dma-buf format for YUYV buffers They are the same for our purposes of allocating a linear buffer and writing to the CPU mapping, but the ARGB format is widely supported and the YUYV format is not. Part-of: --- .../wayland-test-clients/wayland-test-client-utils.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tests/wayland-test-clients/wayland-test-client-utils.c b/src/tests/wayland-test-clients/wayland-test-client-utils.c index 7c36fa5cb..a579dce10 100644 --- a/src/tests/wayland-test-clients/wayland-test-client-utils.c +++ b/src/tests/wayland-test-clients/wayland-test-client-utils.c @@ -1115,6 +1115,12 @@ alloc_dmabuf_ycbcr (WaylandBuffer *buffer, switch (priv->format) { + case DRM_FORMAT_YUYV: + dmabuf->n_planes = 1; + formats[0] = DRM_FORMAT_ARGB8888; + hsub[0] = 2; + vsub[0] = 1; + break; case DRM_FORMAT_NV12: dmabuf->n_planes = 2; formats[0] = DRM_FORMAT_R8; @@ -1249,8 +1255,8 @@ wayland_buffer_dmabuf_allocate (WaylandBuffer *buffer, { case DRM_FORMAT_ARGB8888: case DRM_FORMAT_XRGB8888: - case DRM_FORMAT_YUYV: return alloc_dmabuf_simple (buffer, n_modifiers, modifiers, bo_flags); + case DRM_FORMAT_YUYV: case DRM_FORMAT_NV12: case DRM_FORMAT_P010: case DRM_FORMAT_YUV420: