native/cogl-utils: Add MetaMultiTextureFormat section

So they can be derived from the DRM format as well.

While updating the users, ensure we don't announce support for
DRM formats in zwp_linux_dmabuf_v1 if the MetaMultiTextureFormat is
INVALID. This will be used for YUV subformats in following commits.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2191>
This commit is contained in:
Robert Mader
2023-06-11 00:45:31 +02:00
committed by Marge Bot
parent 3dd9f15eba
commit b15e14e027
6 changed files with 49 additions and 36 deletions

View File

@ -279,7 +279,9 @@ meta_drm_buffer_gbm_blit_to_framebuffer (CoglScanout *scanout,
}
drm_format = gbm_bo_get_format (buffer_gbm->bo);
result = meta_cogl_pixel_format_from_drm_format (drm_format, &cogl_format);
result = meta_cogl_pixel_format_from_drm_format (drm_format,
&cogl_format,
NULL);
g_assert (result);
width = gbm_bo_get_width (buffer_gbm->bo);

View File

@ -746,7 +746,7 @@ copy_shared_framebuffer_primary_gpu (CoglOnscreen *onscre
g_assert (cogl_framebuffer_get_width (framebuffer) == width);
g_assert (cogl_framebuffer_get_height (framebuffer) == height);
ret = meta_cogl_pixel_format_from_drm_format (drm_format, &cogl_format);
ret = meta_cogl_pixel_format_from_drm_format (drm_format, &cogl_format, NULL);
g_assert (ret);
dmabuf_fd = meta_drm_buffer_dumb_ensure_dmabuf_fd (buffer_dumb, &error);
@ -848,7 +848,7 @@ copy_shared_framebuffer_cpu (CoglOnscreen *onscreen,
g_assert (cogl_framebuffer_get_width (framebuffer) == width);
g_assert (cogl_framebuffer_get_height (framebuffer) == height);
ret = meta_cogl_pixel_format_from_drm_format (drm_format, &cogl_format);
ret = meta_cogl_pixel_format_from_drm_format (drm_format, &cogl_format, NULL);
g_assert (ret);
dumb_bitmap = cogl_bitmap_new_for_data (cogl_context,
@ -2111,6 +2111,7 @@ pick_secondary_gpu_framebuffer_format_for_cpu (CoglOnscreen *onscreen)
for (k = 0; k < G_N_ELEMENTS (preferred_formats); k++)
{
g_assert (meta_cogl_pixel_format_from_drm_format (preferred_formats[k],
NULL,
NULL));
for (i = 0; i < formats->len; i++)
@ -2131,7 +2132,7 @@ pick_secondary_gpu_framebuffer_format_for_cpu (CoglOnscreen *onscreen)
{
drm_format = g_array_index (formats, uint32_t, i);
if (meta_cogl_pixel_format_from_drm_format (drm_format, NULL))
if (meta_cogl_pixel_format_from_drm_format (drm_format, NULL, NULL))
return drm_format;
}

View File

@ -615,7 +615,7 @@ meta_renderer_native_create_dma_buf_framebuffer (MetaRendererNative *renderer_n
CoglOffscreen *cogl_fbo;
int ret;
ret = meta_cogl_pixel_format_from_drm_format (drm_format, &cogl_format);
ret = meta_cogl_pixel_format_from_drm_format (drm_format, &cogl_format, NULL);
g_assert (ret);
strides[0] = stride;