[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/24] vhost-user-gpu: add a configuration flag for dmabuf usage
From: |
Gerd Hoffmann |
Subject: |
[PULL 14/24] vhost-user-gpu: add a configuration flag for dmabuf usage |
Date: |
Fri, 5 Feb 2021 07:56:10 +0100 |
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>
Message-Id: <20210204105232.834642-11-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@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 1aed7275c824..4f3dbf79f9bc 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 dd587436ff34..b7bde9feb614 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.2
- [PULL 00/24] Vga ui 20210205 patches, Gerd Hoffmann, 2021/02/05
- [PULL 04/24] spice: delay starting until display are initialized, Gerd Hoffmann, 2021/02/05
- [PULL 02/24] qxl: set qxl.ssd.dcl.con on secondary devices, Gerd Hoffmann, 2021/02/05
- [PULL 09/24] ui: remove extra #ifdef CONFIG_OPENGL, Gerd Hoffmann, 2021/02/05
- [PULL 13/24] ui: remove console_has_gl_dmabuf(), Gerd Hoffmann, 2021/02/05
- [PULL 03/24] qxl: also notify the rendering is done when skipping it, Gerd Hoffmann, 2021/02/05
- [PULL 14/24] vhost-user-gpu: add a configuration flag for dmabuf usage,
Gerd Hoffmann <=
- [PULL 01/24] hw/display/qxl: Fix bad printf format specifiers, Gerd Hoffmann, 2021/02/05
- [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