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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3371>
This commit is contained in:
Sebastian Wick 2023-12-13 15:00:35 +01:00 committed by Marge Bot
parent c0832b99d8
commit ff3b8197fd

View File

@ -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: