diff options
author | Marc-André Lureau | 2021-02-04 11:52:27 +0100 |
---|---|---|
committer | Gerd Hoffmann | 2021-02-04 15:58:54 +0100 |
commit | 52a37e20dbb880ba909e7d0a89e57f77387d25a0 (patch) | |
tree | 785186223cb6b92e94b8359d1ee306e2e1a54a51 | |
parent | ui: add qemu_egl_has_dmabuf helper (diff) | |
download | qemu-52a37e20dbb880ba909e7d0a89e57f77387d25a0.tar.gz qemu-52a37e20dbb880ba909e7d0a89e57f77387d25a0.tar.xz qemu-52a37e20dbb880ba909e7d0a89e57f77387d25a0.zip |
ui: check gtk-egl dmabuf support
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210204105232.834642-16-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | include/ui/gtk.h | 1 | ||||
-rw-r--r-- | ui/gtk.c | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/ui/gtk.h b/include/ui/gtk.h index 7569d090fa..aaef884b95 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -48,6 +48,7 @@ typedef struct VirtualGfxConsole { int cursor_y; bool y0_top; bool scanout_mode; + bool has_dmabuf; #endif } VirtualGfxConsole; @@ -623,6 +623,13 @@ static const DisplayChangeListenerOps dcl_ops = { #if defined(CONFIG_OPENGL) +static bool gd_has_dmabuf(DisplayChangeListener *dcl) +{ + VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl); + + return vc->gfx.has_dmabuf; +} + /** DisplayState Callbacks (opengl version) **/ static const DisplayChangeListenerOps dcl_gl_area_ops = { @@ -661,6 +668,7 @@ static const DisplayChangeListenerOps dcl_egl_ops = { .dpy_gl_cursor_position = gd_egl_cursor_position, .dpy_gl_release_dmabuf = gd_egl_release_dmabuf, .dpy_gl_update = gd_egl_scanout_flush, + .dpy_has_dmabuf = gd_has_dmabuf, }; #endif /* CONFIG_OPENGL */ @@ -2004,6 +2012,7 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc, gtk_widget_set_double_buffered(vc->gfx.drawing_area, FALSE); #pragma GCC diagnostic pop vc->gfx.dcl.ops = &dcl_egl_ops; + vc->gfx.has_dmabuf = qemu_egl_has_dmabuf(); } } else #endif |