[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/24] ui: add a DCLOps callback to check dmabuf support
From: |
Gerd Hoffmann |
Subject: |
[PULL 16/24] ui: add a DCLOps callback to check dmabuf support |
Date: |
Fri, 5 Feb 2021 07:56:12 +0100 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210204105232.834642-13-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/ui/console.h | 2 ++
ui/console.c | 13 +++++++++++++
2 files changed, 15 insertions(+)
diff --git a/include/ui/console.h b/include/ui/console.h
index 0595aa9953cf..875885d9c7ce 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -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);
diff --git a/ui/console.c b/ui/console.c
index b5bc3f7699a1..a645418adad5 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -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[] =
--
2.29.2
- [PULL 12/24] ui: annotate DCLOps callback requirements, (continued)
- [PULL 12/24] ui: annotate DCLOps callback requirements, Gerd Hoffmann, 2021/02/05
- [PULL 08/24] vhost-user-gpu: handle display-info in a callback, Gerd Hoffmann, 2021/02/05
- [PULL 15/24] ui: add an optional get_flags callback to GraphicHwOps, Gerd Hoffmann, 2021/02/05
- [PULL 07/24] vhost-user-gpu: use an extandable state enum for commands, Gerd Hoffmann, 2021/02/05
- [PULL 11/24] ui: add gd_gl_area_scanout_disable, Gerd Hoffmann, 2021/02/05
- [PULL 17/24] ui: check hw requirements during DCL registration, Gerd Hoffmann, 2021/02/05
- [PULL 23/24] chardev: check if the chardev is registered for yanking, Gerd Hoffmann, 2021/02/05
- [PULL 10/24] ui: remove gl_ctx_get_current, Gerd Hoffmann, 2021/02/05
- [PULL 24/24] tests: add some virtio-gpu & vhost-user-gpu acceptance test, Gerd Hoffmann, 2021/02/05
- [PULL 18/24] ui: add qemu_egl_has_dmabuf helper, Gerd Hoffmann, 2021/02/05
- [PULL 16/24] ui: add a DCLOps callback to check dmabuf support,
Gerd Hoffmann <=
- [PULL 06/24] vhost-user-gpu: handle vhost-user-gpu features in a callback, Gerd Hoffmann, 2021/02/05
- [PULL 21/24] virtio-gpu: avoid re-entering cmdq processing, Gerd Hoffmann, 2021/02/05
- [PULL 22/24] display/ui: add a callback to indicate GL state is flushed, Gerd Hoffmann, 2021/02/05
- [PULL 05/24] vhost-user-gpu: check backend for EDID support, Gerd Hoffmann, 2021/02/05
- [PULL 19/24] ui: check gtk-egl dmabuf support, Gerd Hoffmann, 2021/02/05
- [PULL 20/24] ui: add egl dmabuf import to gtkglarea, Gerd Hoffmann, 2021/02/05
- Re: [PULL 00/24] Vga ui 20210205 patches, Peter Maydell, 2021/02/05