Skip to content

Commit

Permalink
Update QEMU Patchset to v7
Browse files Browse the repository at this point in the history
  • Loading branch information
TrippleXC authored and TrippleXC committed Apr 11, 2024
1 parent 46f8ffc commit d9659e7
Show file tree
Hide file tree
Showing 12 changed files with 383 additions and 1,122 deletions.

This file was deleted.

43 changes: 0 additions & 43 deletions qemu/0001-virtio-gpu-fix-hw-cursor.patch

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,67 +1,82 @@
From: Huang Rui <ray.huang@amd.com>
Subject: [PATCH v6 03/11] virtio-gpu: Support context init feature with
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Subject: [PATCH v7 03/10] virtio-gpu: Support context-init feature with
virglrenderer
Date: Tue, 19 Dec 2023 15:53:12 +0800
Content-Type: text/plain
Date: Thu, 11 Apr 2024 13:19:55 +0300
Content-Type: text/plain; charset="utf-8"

From: Huang Rui <[email protected]>

Patch "virtio-gpu: CONTEXT_INIT feature" has added the context_init
feature flags.
We would like to enable the feature with virglrenderer, so add to create
virgl renderer context with flags using context_id when valid.
feature flags. Expose this feature and support creating virglrenderer
context with flags using context_id if libvirglrenderer is new enough.

Originally-by: Antonio Caggiano <[email protected]>
Signed-off-by: Huang Rui <[email protected]>
Reviewed-by: Antonio Caggiano <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
---
hw/display/virtio-gpu-gl.c | 4 ++++
hw/display/virtio-gpu-virgl.c | 20 ++++++++++++++++++--
meson.build | 1 +
3 files changed, 23 insertions(+), 2 deletions(-)

Changes in v6:
- Handle the case while context_init is disabled.
- Enable context_init by default.

hw/display/virtio-gpu-virgl.c | 13 +++++++++++--
hw/display/virtio-gpu.c | 4 ++++
2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c
index e06be60dfbfc..ba478124e2c2 100644
--- a/hw/display/virtio-gpu-gl.c
+++ b/hw/display/virtio-gpu-gl.c
@@ -127,6 +127,10 @@ static void virtio_gpu_gl_device_realize(DeviceState *qdev, Error **errp)
VIRTIO_GPU_BASE(g)->virtio_config.num_capsets =
virtio_gpu_virgl_get_num_capsets(g);

+#ifdef HAVE_VIRGL_CONTEXT_CREATE_WITH_FLAGS
+ g->parent_obj.conf.flags |= 1 << VIRTIO_GPU_FLAG_CONTEXT_INIT_ENABLED;
+#endif
+
virtio_gpu_device_realize(qdev, errp);
}

diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c
index 8bb7a2c21f..5bbc8071b2 100644
index 9f34d0e6619c..ef598d8d23ee 100644
--- a/hw/display/virtio-gpu-virgl.c
+++ b/hw/display/virtio-gpu-virgl.c
@@ -106,8 +106,17 @@ static void virgl_cmd_context_create(VirtIOGPU *g,
@@ -106,8 +106,24 @@ static void virgl_cmd_context_create(VirtIOGPU *g,
trace_virtio_gpu_cmd_ctx_create(cc.hdr.ctx_id,
cc.debug_name);

- virgl_renderer_context_create(cc.hdr.ctx_id, cc.nlen,
- cc.debug_name);
+ if (cc.context_init) {
+ if (!virtio_gpu_context_init_enabled(g->parent_obj.conf)) {
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: context_init disabled",
+ __func__);
+ cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
+ return;
+ }
+
+#ifdef HAVE_VIRGL_CONTEXT_CREATE_WITH_FLAGS
+ if (cc.context_init && virtio_gpu_context_init_enabled(g->parent_obj.conf)) {
+ virgl_renderer_context_create_with_flags(cc.hdr.ctx_id,
+ cc.context_init,
+ cc.nlen,
+ cc.debug_name);
+ return;
+ }
+#endif
+ }
+
+ virgl_renderer_context_create(cc.hdr.ctx_id, cc.nlen, cc.debug_name);
}

static void virgl_cmd_context_destroy(VirtIOGPU *g,
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index b016d3bac8..8b2f4c6be3 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1619,6 +1619,10 @@ static Property virtio_gpu_properties[] = {
DEFINE_PROP_BIT("blob", VirtIOGPU, parent_obj.conf.flags,
VIRTIO_GPU_FLAG_BLOB_ENABLED, false),
DEFINE_PROP_SIZE("hostmem", VirtIOGPU, parent_obj.conf.hostmem, 0),
+#ifdef HAVE_VIRGL_CONTEXT_CREATE_WITH_FLAGS
+ DEFINE_PROP_BIT("context_init", VirtIOGPU, parent_obj.conf.flags,
+ VIRTIO_GPU_FLAG_CONTEXT_INIT_ENABLED, true),
+#endif
DEFINE_PROP_END_OF_LIST(),
};

diff --git a/meson.build b/meson.build
index f085722c89dc..f58623685477 100644
--- a/meson.build
+++ b/meson.build
@@ -2284,6 +2284,7 @@ config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
config_host_data.set('CONFIG_VNC_SASL', sasl.found())
if virgl.version().version_compare('>=1.0.0')
config_host_data.set('HAVE_VIRGL_D3D_INFO_EXT', 1)
+ config_host_data.set('HAVE_VIRGL_CONTEXT_CREATE_WITH_FLAGS', 1)
endif
config_host_data.set('CONFIG_VIRTFS', have_virtfs)
config_host_data.set('CONFIG_VTE', vte.found())
--
2.25.1



2.44.0
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
From: Huang Rui <[email protected]>
Subject: [PATCH v6 04/11] virtio-gpu: Don't require udmabuf when blobs and
virgl are enabled
Date: Tue, 19 Dec 2023 15:53:13 +0800
Content-Type: text/plain

From: Dmitry Osipenko <[email protected]>
Subject: [PATCH v7 04/10] virtio-gpu: Don't require udmabuf when blobs and
virgl are enabled
Date: Thu, 11 Apr 2024 13:19:56 +0300
Content-Type: text/plain; charset="utf-8"

The udmabuf usage is mandatory when virgl is disabled and blobs feature
enabled in the Qemu machine configuration. If virgl and blobs are enabled,
Expand All @@ -15,20 +13,19 @@ available to Qemu users without a need to have udmabuf available in the
system.

Reviewed-by: Antonio Caggiano <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Signed-off-by: Huang Rui <[email protected]>
Reviewed-by: Antonio Caggiano <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
---

No change in v6.

hw/display/virtio-gpu.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 8b2f4c6be3..4c3ec9d0ea 100644
index ae831b6b3e3e..dac272ecadb1 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1443,6 +1443,7 @@ void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)
@@ -1472,6 +1472,7 @@ void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)

if (virtio_gpu_blob_enabled(g->parent_obj.conf)) {
if (!virtio_gpu_rutabaga_enabled(g->parent_obj.conf) &&
Expand All @@ -37,7 +34,6 @@ index 8b2f4c6be3..4c3ec9d0ea 100644
error_setg(errp, "need rutabaga or udmabuf for blob resources");
return;
--
2.25.1

2.44.0


Loading

0 comments on commit d9659e7

Please sign in to comment.