]> Git Repo - qemu.git/commitdiff
ui: add a DCLOps callback to check dmabuf support
authorMarc-André Lureau <[email protected]>
Thu, 4 Feb 2021 10:52:24 +0000 (14:52 +0400)
committerGerd Hoffmann <[email protected]>
Thu, 4 Feb 2021 14:58:54 +0000 (15:58 +0100)
Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20210204105232[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
include/ui/console.h
ui/console.c

index 0595aa9953cfa5bbbbd3a69485fab9585f9bc178..875885d9c7cec130b1c1c62c05ba53c8f73a8cfb 100644 (file)
@@ -224,6 +224,8 @@ typedef struct DisplayChangeListenerOps {
                                    uint32_t backing_height,
                                    uint32_t x, uint32_t y,
                                    uint32_t w, uint32_t h);
+    /* optional (default to true if has dpy_gl_scanout_dmabuf) */
+    bool (*dpy_has_dmabuf)(DisplayChangeListener *dcl);
     /* optional */
     void (*dpy_gl_scanout_dmabuf)(DisplayChangeListener *dcl,
                                   QemuDmaBuf *dmabuf);
index b5bc3f7699a117eea74358ed49237a362d5da5ca..a645418adad5a731cf662b7e2623817f5df62615 100644 (file)
@@ -1463,6 +1463,19 @@ bool console_has_gl(QemuConsole *con)
     return con->gl != NULL;
 }
 
+static bool displaychangelistener_has_dmabuf(DisplayChangeListener *dcl)
+{
+    if (dcl->ops->dpy_has_dmabuf) {
+        return dcl->ops->dpy_has_dmabuf(dcl);
+    }
+
+    if (dcl->ops->dpy_gl_scanout_dmabuf) {
+        return true;
+    }
+
+    return false;
+}
+
 void register_displaychangelistener(DisplayChangeListener *dcl)
 {
     static const char nodev[] =
This page took 0.031678 seconds and 4 git commands to generate.