[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 04/13] virtio-gpu: CONTEXT_INIT feature
From: |
Gurchetan Singh |
Subject: |
[RFC PATCH 04/13] virtio-gpu: CONTEXT_INIT feature |
Date: |
Thu, 20 Apr 2023 18:12:14 -0700 |
From: Antonio Caggiano <antonio.caggiano@collabora.com>
The feature can be enabled when a backend wants it.
Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
---
hw/display/virtio-gpu-base.c | 3 +++
include/hw/virtio/virtio-gpu.h | 3 +++
2 files changed, 6 insertions(+)
diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c
index a29f191aa8..6c5f1f327f 100644
--- a/hw/display/virtio-gpu-base.c
+++ b/hw/display/virtio-gpu-base.c
@@ -215,6 +215,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_context_init_enabled(g->conf)) {
+ features |= (1 << VIRTIO_GPU_F_CONTEXT_INIT);
+ }
return features;
}
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index 326988e4d5..adee17968d 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -93,6 +93,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_CONTEXT_INIT_ENABLED,
};
#define virtio_gpu_virgl_enabled(_cfg) \
@@ -107,6 +108,8 @@ enum virtio_gpu_base_conf_flags {
(_cfg.flags & (1 << VIRTIO_GPU_FLAG_BLOB_ENABLED))
#define virtio_gpu_hostmem_enabled(_cfg) \
(_cfg.hostmem > 0)
+#define virtio_gpu_context_init_enabled(_cfg) \
+ (_cfg.flags & (1 << VIRTIO_GPU_FLAG_CONTEXT_INIT_ENABLED))
struct virtio_gpu_base_conf {
uint32_t max_outputs;
--
2.40.0.634.g4ca3ef3211-goog
- [RFC PATCH 00/13] gfxstream + rutabaga_gfx: a surprising delight or startling epiphany?, Gurchetan Singh, 2023/04/20
- [RFC PATCH 04/13] virtio-gpu: CONTEXT_INIT feature,
Gurchetan Singh <=
- [RFC PATCH 05/13] gfxstream + rutabaga prep: virtio_gpu_gl -> virtio_gpu_virgl, Gurchetan Singh, 2023/04/20
- [RFC PATCH 06/13] gfxstream + rutabaga prep: make GL device more library agnostic, Gurchetan Singh, 2023/04/20
- [RFC PATCH 09/13] gfxstream + rutabaga: add required meson changes, Gurchetan Singh, 2023/04/20
- [RFC PATCH 03/13] virtio-gpu blob prep: improve decoding and add memory region, Gurchetan Singh, 2023/04/20
- [RFC PATCH 02/13] virtio-gpu: hostmem, Gurchetan Singh, 2023/04/20
- [RFC PATCH 01/13] virtio: Add shared memory capability, Gurchetan Singh, 2023/04/20
- [RFC PATCH 10/13] gfxstream + rutabaga: add initial support for gfxstream, Gurchetan Singh, 2023/04/20
- [RFC PATCH 11/13] gfxstream + rutabaga: enable rutabaga, Gurchetan Singh, 2023/04/20