[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 12/20] ui: add a DCLOps callback to check dmabuf support
From: |
marcandre . lureau |
Subject: |
[PATCH 12/20] ui: add a DCLOps callback to check dmabuf support |
Date: |
Tue, 2 Feb 2021 18:26:17 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@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 0595aa9953..875885d9c7 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 b5bc3f7699..a645418ada 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.0
- [PATCH 05/20] ui: remove extra #ifdef CONFIG_OPENGL, (continued)
- [PATCH 05/20] ui: remove extra #ifdef CONFIG_OPENGL, marcandre . lureau, 2021/02/02
- [PATCH 06/20] ui: remove gl_ctx_get_current, marcandre . lureau, 2021/02/02
- [PATCH 07/20] ui: add gd_gl_area_scanout_disable, marcandre . lureau, 2021/02/02
- [PATCH 08/20] ui: annotate DCLOps callback requirements, marcandre . lureau, 2021/02/02
- [PATCH 09/20] ui: remove console_has_gl_dmabuf(), marcandre . lureau, 2021/02/02
- [PATCH 10/20] vhost-user-gpu: add a configuration flag for dmabuf usage, marcandre . lureau, 2021/02/02
- [PATCH 11/20] ui: add an optional get_flags callback to GraphicHwOps, marcandre . lureau, 2021/02/02
- [PATCH 12/20] ui: add a DCLOps callback to check dmabuf support,
marcandre . lureau <=
- [PATCH 13/20] ui: check hw requirements during DCL registration, marcandre . lureau, 2021/02/02
- [PATCH 14/20] ui: add qemu_egl_has_dmabuf helper, marcandre . lureau, 2021/02/02
- [PATCH 15/20] ui: check gtk-egl dmabuf support, marcandre . lureau, 2021/02/02
- [PATCH 16/20] ui: add egl dmabuf import to gtkglarea, marcandre . lureau, 2021/02/02
- [PATCH 17/20] virtio-gpu: avoid re-entering cmdq processing, marcandre . lureau, 2021/02/02
- [PATCH 18/20] display/ui: add a callback to indicate GL state is flushed, marcandre . lureau, 2021/02/02
- [PATCH 19/20] chardev: check if the chardev is registered for yanking, marcandre . lureau, 2021/02/02
- [PATCH 20/20] RFC: tests: add some virtio-gpu & vhost-user-gpu acceptance test, marcandre . lureau, 2021/02/02