dmabuf: Move format rejection from sanitize into build()
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user