Merge branch 'matthiasc/for-main' into 'main'
dmabuf: Add a display getter See merge request GNOME/gtk!6488
This commit is contained in:
@@ -87,18 +87,29 @@ gdk_dmabuf_direct_downloader_supports (const GdkDmabufDownloader *downloader,
|
||||
|
||||
info = get_drm_format_info (dmabuf->fourcc);
|
||||
|
||||
if (!info || dmabuf->modifier != DRM_FORMAT_MOD_LINEAR)
|
||||
if (!info)
|
||||
{
|
||||
g_set_error (error, GDK_DMABUF_ERROR, GDK_DMABUF_ERROR_UNSUPPORTED_FORMAT,
|
||||
"Unsupported dmabuf format %.4s:%#lx",
|
||||
(char *) &dmabuf->fourcc, dmabuf->modifier);
|
||||
g_set_error (error,
|
||||
GDK_DMABUF_ERROR, GDK_DMABUF_ERROR_UNSUPPORTED_FORMAT,
|
||||
"Unsupported dmabuf format %.4s",
|
||||
(char *) &dmabuf->fourcc);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (dmabuf->modifier != DRM_FORMAT_MOD_LINEAR)
|
||||
{
|
||||
g_set_error (error,
|
||||
GDK_DMABUF_ERROR, GDK_DMABUF_ERROR_UNSUPPORTED_FORMAT,
|
||||
"Unsupported dmabuf modifier %#lx (only linear buffers are supported)",
|
||||
dmabuf->modifier);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (dmabuf->n_planes > 1)
|
||||
{
|
||||
g_set_error (error, GDK_DMABUF_ERROR, GDK_DMABUF_ERROR_CREATION_FAILED,
|
||||
"Cannot create multiplanar textures for dmabuf format %.4s:%#lx",
|
||||
(char *) &dmabuf->fourcc, dmabuf->modifier);
|
||||
g_set_error_literal (error,
|
||||
GDK_DMABUF_ERROR, GDK_DMABUF_ERROR_CREATION_FAILED,
|
||||
"Multiplanar dmabufs are not supported");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ gdk_dmabuf_texture_class_init (GdkDmabufTextureClass *klass)
|
||||
gobject_class->dispose = gdk_dmabuf_texture_dispose;
|
||||
}
|
||||
|
||||
GdkDisplay *
|
||||
gdk_dmabuf_texture_get_display (GdkDmabufTexture *self)
|
||||
{
|
||||
return self->display;
|
||||
}
|
||||
|
||||
const GdkDmabuf *
|
||||
gdk_dmabuf_texture_get_dmabuf (GdkDmabufTexture *self)
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ GdkTexture * gdk_dmabuf_texture_new_from_builder (GdkDmabufTextureBui
|
||||
gpointer data,
|
||||
GError **error);
|
||||
|
||||
GdkDisplay * gdk_dmabuf_texture_get_display (GdkDmabufTexture *self);
|
||||
const GdkDmabuf * gdk_dmabuf_texture_get_dmabuf (GdkDmabufTexture *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
Reference in New Issue
Block a user