dmabuf: Move format rejection from sanitize into build()

This commit is contained in:
Benjamin Otte
2024-11-11 20:29:36 +01:00
parent 9ab9405b71
commit a98088d9f9
2 changed files with 7 additions and 23 deletions

View File

@@ -928,11 +928,9 @@ gdk_dmabuf_export_sync_file (int dmabuf_fd,
*
* Things we do here:
*
* 1. Disallow any dmabuf format that we do not know.
* 1. Ignore non-linear modifiers.
*
* 2. Ignore non-linear modifiers.
*
* 3. Try and fix various inconsistencies between V4L and Mesa
* 2. Try and fix various inconsistencies between V4L and Mesa
* for linear modifiers, like the e.g. single-plane NV12.
*
* *** WARNING ***
@@ -951,8 +949,6 @@ gdk_dmabuf_sanitize (GdkDmabuf *dest,
const GdkDmabuf *src,
GError **error)
{
const GdkDrmFormatInfo *info;
if (src->n_planes > GDK_DMABUF_MAX_PLANES)
{
g_set_error (error,
@@ -962,17 +958,6 @@ gdk_dmabuf_sanitize (GdkDmabuf *dest,
return FALSE;
}
info = get_drm_format_info (src->fourcc);
if (info == NULL)
{
g_set_error (error,
GDK_DMABUF_ERROR, GDK_DMABUF_ERROR_UNSUPPORTED_FORMAT,
"Unsupported dmabuf format %.4s",
(char *) &src->fourcc);
return FALSE;
}
*dest = *src;
if (src->modifier)

View File

@@ -238,12 +238,11 @@ gdk_dmabuf_texture_new_from_builder (GdkDmabufTextureBuilder *builder,
}
else
{
GDK_DISPLAY_DEBUG (display, DMABUF,
"Falling back to generic RGBA for dmabuf format %.4s",
(char *) &dmabuf.fourcc);
format = premultiplied ? GDK_MEMORY_R8G8B8A8_PREMULTIPLIED
: GDK_MEMORY_R8G8B8A8;
is_yuv = FALSE;
g_set_error (error,
GDK_DMABUF_ERROR, GDK_DMABUF_ERROR_UNSUPPORTED_FORMAT,
"Unsupported dmabuf format %.4s",
(char *) &dmabuf.fourcc);
return NULL;
}
gdk_display_init_dmabuf (display);