[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 14/20] virtio-gpu: Add initial definitions for explict flush f
From: |
Vivek Kasireddy |
Subject: |
[PATCH v3 14/20] virtio-gpu: Add initial definitions for explict flush feature |
Date: |
Tue, 11 May 2021 01:08:12 -0700 |
Add the property bit, conf flag and other relevant declarations
associated with this feature.
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
hw/display/virtio-gpu-base.c | 3 +++
hw/display/virtio-gpu.c | 9 +++++++++
include/hw/virtio/virtio-gpu.h | 3 +++
include/standard-headers/linux/virtio_gpu.h | 2 ++
4 files changed, 17 insertions(+)
diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c
index dd294276cb..c9af4c6117 100644
--- a/hw/display/virtio-gpu-base.c
+++ b/hw/display/virtio-gpu-base.c
@@ -211,6 +211,9 @@ virtio_gpu_base_get_features(VirtIODevice *vdev, uint64_t
features,
if (virtio_gpu_blob_enabled(g->conf)) {
features |= (1 << VIRTIO_GPU_F_RESOURCE_BLOB);
}
+ if (virtio_gpu_expflush_enabled(g->conf)) {
+ features |= (1 << VIRTIO_GPU_F_EXPLICIT_FLUSH);
+ }
return features;
}
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index cc2a0af21a..694d8f550c 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1298,6 +1298,13 @@ void virtio_gpu_device_realize(DeviceState *qdev, Error
**errp)
}
}
+ if (virtio_gpu_expflush_enabled(g->parent_obj.conf)) {
+ if (!virtio_gpu_blob_enabled(g->parent_obj.conf)) {
+ error_setg(errp, "cannot enable expflush without blob resources");
+ return;
+ }
+ }
+
if (!virtio_gpu_base_device_realize(qdev,
virtio_gpu_handle_ctrl_cb,
virtio_gpu_handle_cursor_cb,
@@ -1393,6 +1400,8 @@ static Property virtio_gpu_properties[] = {
256 * MiB),
DEFINE_PROP_BIT("blob", VirtIOGPU, parent_obj.conf.flags,
VIRTIO_GPU_FLAG_BLOB_ENABLED, false),
+ DEFINE_PROP_BIT("expflush", VirtIOGPU, parent_obj.conf.flags,
+ VIRTIO_GPU_FLAG_EXPFLUSH_ENABLED, false),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index 31b2bcc57b..4a827454f5 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -90,6 +90,7 @@ enum virtio_gpu_base_conf_flags {
VIRTIO_GPU_FLAG_EDID_ENABLED,
VIRTIO_GPU_FLAG_DMABUF_ENABLED,
VIRTIO_GPU_FLAG_BLOB_ENABLED,
+ VIRTIO_GPU_FLAG_EXPFLUSH_ENABLED,
};
#define virtio_gpu_virgl_enabled(_cfg) \
@@ -102,6 +103,8 @@ enum virtio_gpu_base_conf_flags {
(_cfg.flags & (1 << VIRTIO_GPU_FLAG_DMABUF_ENABLED))
#define virtio_gpu_blob_enabled(_cfg) \
(_cfg.flags & (1 << VIRTIO_GPU_FLAG_BLOB_ENABLED))
+#define virtio_gpu_expflush_enabled(_cfg) \
+ (_cfg.flags & (1 << VIRTIO_GPU_FLAG_EXPFLUSH_ENABLED))
struct virtio_gpu_base_conf {
uint32_t max_outputs;
diff --git a/include/standard-headers/linux/virtio_gpu.h
b/include/standard-headers/linux/virtio_gpu.h
index 1357e4774e..d015741f0b 100644
--- a/include/standard-headers/linux/virtio_gpu.h
+++ b/include/standard-headers/linux/virtio_gpu.h
@@ -60,6 +60,8 @@
*/
#define VIRTIO_GPU_F_RESOURCE_BLOB 3
+#define VIRTIO_GPU_F_EXPLICIT_FLUSH 4
+
enum virtio_gpu_ctrl_type {
VIRTIO_GPU_UNDEFINED = 0,
--
2.30.2
- Re: [PATCH v3 03/20] virtio-gpu: Add udmabuf helpers, (continued)
- [PATCH v3 01/20] ui: Get the fd associated with udmabuf driver, Vivek Kasireddy, 2021/05/11
- [PATCH v3 05/20] virtio-gpu: Refactor virtio_gpu_set_scanout, Vivek Kasireddy, 2021/05/11
- [PATCH v3 08/20] virtio-gpu: Add virtio_gpu_resource_create_blob, Vivek Kasireddy, 2021/05/11
- [PATCH v3 10/20] virtio-gpu: Add helpers to create and destroy dmabuf objects, Vivek Kasireddy, 2021/05/11
- [PATCH v3 12/20] virtio-gpu: Add virtio_gpu_set_scanout_blob, Vivek Kasireddy, 2021/05/11
- [PATCH v3 13/20] virtio-gpu: Update cursor data using blob, Vivek Kasireddy, 2021/05/11
- [PATCH v3 11/20] virtio-gpu: Factor out update scanout, Vivek Kasireddy, 2021/05/11
- [PATCH v3 09/20] ui/pixman: Add qemu_pixman_to_drm_format(), Vivek Kasireddy, 2021/05/11
- [PATCH v3 14/20] virtio-gpu: Add initial definitions for explict flush feature,
Vivek Kasireddy <=
- [PATCH v3 15/20] virtio-gpu: Add dmabuf helpers for synchronization, Vivek Kasireddy, 2021/05/11
- [PATCH v3 16/20] virtio-gpu: Add virtio_gpu_wait_flush API, Vivek Kasireddy, 2021/05/11
- [PATCH v3 18/20] ui/gtk-egl: Wait for the draw signal for dmabuf blobs, Vivek Kasireddy, 2021/05/11
- [PATCH v3 17/20] ui: Add egl helpers for synchronization, Vivek Kasireddy, 2021/05/11
- [PATCH v3 19/20] ui/gtk: Create a common release_dmabuf helper, Vivek Kasireddy, 2021/05/11
- [PATCH v3 20/20] virtio-gpu: Add gl_flushed callback, Vivek Kasireddy, 2021/05/11