aboutsummaryrefslogtreecommitdiff
path: root/ui/gtk-egl.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-03-06 10:09:50 +0100
committerGerd Hoffmann <kraxel@redhat.com>2018-03-12 09:00:34 +0100
commit70763fea4fbbe2984fd2a8f6ce9c77114af80792 (patch)
tree7d3ba040a4e90faaa126fdd625dedcc5870e41b3 /ui/gtk-egl.c
parent4c70280592f5357c66f95173ec907920f48c99fa (diff)
ui/gtk-egl: add scanout_dmabuf support
Add support for dmabuf scanouts to gtk-egl. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20180306090951.22932-6-kraxel@redhat.com
Diffstat (limited to 'ui/gtk-egl.c')
-rw-r--r--ui/gtk-egl.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index eb86c26a1d..2c83c22d04 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -194,6 +194,29 @@ void gd_egl_scanout_texture(DisplayChangeListener *dcl,
backing_id, false);
}
+void gd_egl_scanout_dmabuf(DisplayChangeListener *dcl,
+ QemuDmaBuf *dmabuf)
+{
+#ifdef CONFIG_OPENGL_DMABUF
+ egl_dmabuf_import_texture(dmabuf);
+ if (!dmabuf->texture) {
+ return;
+ }
+
+ gd_egl_scanout_texture(dcl, dmabuf->texture,
+ false, dmabuf->width, dmabuf->height,
+ 0, 0, dmabuf->width, dmabuf->height);
+#endif
+}
+
+void gd_egl_release_dmabuf(DisplayChangeListener *dcl,
+ QemuDmaBuf *dmabuf)
+{
+#ifdef CONFIG_OPENGL_DMABUF
+ egl_dmabuf_release_texture(dmabuf);
+#endif
+}
+
void gd_egl_scanout_flush(DisplayChangeListener *dcl,
uint32_t x, uint32_t y, uint32_t w, uint32_t h)
{