[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 10/20] vhost-user-gpu: add a configuration flag for dmabuf usa
From: |
marcandre . lureau |
Subject: |
[PATCH v2 10/20] vhost-user-gpu: add a configuration flag for dmabuf usage |
Date: |
Thu, 4 Feb 2021 14:52:22 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Let's inform VirtioGPUBase that vhost-user-gpu require DMABUF messages.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
include/hw/virtio/virtio-gpu.h | 3 +++
hw/display/vhost-user-gpu.c | 2 ++
2 files changed, 5 insertions(+)
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index 1aed7275c8..4f3dbf79f9 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -71,6 +71,7 @@ enum virtio_gpu_base_conf_flags {
VIRTIO_GPU_FLAG_VIRGL_ENABLED = 1,
VIRTIO_GPU_FLAG_STATS_ENABLED,
VIRTIO_GPU_FLAG_EDID_ENABLED,
+ VIRTIO_GPU_FLAG_DMABUF_ENABLED,
};
#define virtio_gpu_virgl_enabled(_cfg) \
@@ -79,6 +80,8 @@ enum virtio_gpu_base_conf_flags {
(_cfg.flags & (1 << VIRTIO_GPU_FLAG_STATS_ENABLED))
#define virtio_gpu_edid_enabled(_cfg) \
(_cfg.flags & (1 << VIRTIO_GPU_FLAG_EDID_ENABLED))
+#define virtio_gpu_dmabuf_enabled(_cfg) \
+ (_cfg.flags & (1 << VIRTIO_GPU_FLAG_DMABUF_ENABLED))
struct virtio_gpu_base_conf {
uint32_t max_outputs;
diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c
index dd587436ff..b7bde9feb6 100644
--- a/hw/display/vhost-user-gpu.c
+++ b/hw/display/vhost-user-gpu.c
@@ -547,6 +547,8 @@ vhost_user_gpu_device_realize(DeviceState *qdev, Error
**errp)
return;
}
+ /* existing backend may send DMABUF, so let's add that requirement */
+ g->parent_obj.conf.flags |= 1 << VIRTIO_GPU_FLAG_DMABUF_ENABLED;
if (virtio_has_feature(g->vhost->dev.features, VIRTIO_GPU_F_VIRGL)) {
g->parent_obj.conf.flags |= 1 << VIRTIO_GPU_FLAG_VIRGL_ENABLED;
}
--
2.29.0
- [PATCH v2 02/20] vhost-user-gpu: handle vhost-user-gpu features in a callback, (continued)
- [PATCH v2 02/20] vhost-user-gpu: handle vhost-user-gpu features in a callback, marcandre . lureau, 2021/02/04
- [PATCH v2 03/20] vhost-user-gpu: use an extandable state enum for commands, marcandre . lureau, 2021/02/04
- [PATCH v2 04/20] vhost-user-gpu: handle display-info in a callback, marcandre . lureau, 2021/02/04
- [PATCH v2 05/20] ui: remove extra #ifdef CONFIG_OPENGL, marcandre . lureau, 2021/02/04
- [PATCH v2 06/20] ui: remove gl_ctx_get_current, marcandre . lureau, 2021/02/04
- [PATCH v2 07/20] ui: add gd_gl_area_scanout_disable, marcandre . lureau, 2021/02/04
- [PATCH v2 08/20] ui: annotate DCLOps callback requirements, marcandre . lureau, 2021/02/04
- [PATCH v2 09/20] ui: remove console_has_gl_dmabuf(), marcandre . lureau, 2021/02/04
- [PATCH v2 10/20] vhost-user-gpu: add a configuration flag for dmabuf usage,
marcandre . lureau <=
- [PATCH v2 11/20] ui: add an optional get_flags callback to GraphicHwOps, marcandre . lureau, 2021/02/04
- [PATCH v2 12/20] ui: add a DCLOps callback to check dmabuf support, marcandre . lureau, 2021/02/04
- [PATCH v2 13/20] ui: check hw requirements during DCL registration, marcandre . lureau, 2021/02/04
- [PATCH v2 14/20] ui: add qemu_egl_has_dmabuf helper, marcandre . lureau, 2021/02/04
- [PATCH v2 15/20] ui: check gtk-egl dmabuf support, marcandre . lureau, 2021/02/04
- [PATCH v2 16/20] ui: add egl dmabuf import to gtkglarea, marcandre . lureau, 2021/02/04
- [PATCH v2 17/20] virtio-gpu: avoid re-entering cmdq processing, marcandre . lureau, 2021/02/04
- [PATCH v2 18/20] display/ui: add a callback to indicate GL state is flushed, marcandre . lureau, 2021/02/04
- [PATCH v2 19/20] chardev: check if the chardev is registered for yanking, marcandre . lureau, 2021/02/04