]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
ui: add qemu_egl_has_dmabuf helper
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 4 Feb 2021 10:52:26 +0000 (14:52 +0400)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 4 Feb 2021 14:58:54 +0000 (15:58 +0100)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210204105232.834642-15-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
include/ui/egl-helpers.h
ui/egl-helpers.c

index 94a4b3e6f3bd7cb7239476676f072a72b25150c2..5b1f7fafe0bc2527d1a420db15bdffbcb6056a18 100644 (file)
@@ -51,5 +51,6 @@ EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, EGLNativeWindowType win);
 int qemu_egl_init_dpy_x11(EGLNativeDisplayType dpy, DisplayGLMode mode);
 int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy, DisplayGLMode mode);
 EGLContext qemu_egl_init_ctx(void);
+bool qemu_egl_has_dmabuf(void);
 
 #endif /* EGL_HELPERS_H */
index 7c530c2825be5803839e0370b4ad975fe803567d..73fe61f87819881a6d5ba15a83bd60bacf67d2cd 100644 (file)
@@ -441,6 +441,16 @@ int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy, DisplayGLMode mode)
 #endif
 }
 
+bool qemu_egl_has_dmabuf(void)
+{
+    if (qemu_egl_display == EGL_NO_DISPLAY) {
+        return false;
+    }
+
+    return epoxy_has_egl_extension(qemu_egl_display,
+                                   "EGL_EXT_image_dma_buf_import");
+}
+
 EGLContext qemu_egl_init_ctx(void)
 {
     static const EGLint ctx_att_core[] = {