[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[QEMU PATCH v5 11/13] virtio-gpu: Support Venus capset
- To: Gerd Hoffmann <kraxel@xxxxxxxxxx>, "Michael S . Tsirkin" <mst@xxxxxxxxxx>, Akihiko Odaki <akihiko.odaki@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Antonio Caggiano" <quic_acaggian@xxxxxxxxxxx>, "Dr . David Alan Gilbert" <dgilbert@xxxxxxxxxx>, Robert Beckett <bob.beckett@xxxxxxxxxxxxx>, "Dmitry Osipenko" <dmitry.osipenko@xxxxxxxxxxxxx>, Alex Bennée <alex.bennee@xxxxxxxxxx>, <qemu-devel@xxxxxxxxxx>
- From: Huang Rui <ray.huang@xxxxxxx>
- Date: Fri, 15 Sep 2023 19:11:28 +0800
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mSkyHF6vxVVhxr6BksCITEGigkoq1JtKA4LzqMq3d1Q=; b=mEo4B7VbkO5F6mJ27RxZ75yHyXlbUATmQujL+GV03gsN3YS5SfNcIXBO00i+Uzs9JCTP2/lg+5DbOJz9PUYhZqEpRql+XW1AhcNQ8gRpUATQutqDN9Q19aZ41ndwyd57eB/Khm3+9ujnColeR7yIYsOXeDDle7OZ9Lz/Ukz6IimKTc4olGuN8A/JYgftbEfBzHQ8I4NFogmpYhSeYXK4U1b+UAFWDk4PqMRkK/z9+pr3SzwRsG1CBAXlViAKllo2kqeYm81PyRddueJ0csjAekvja/sFgyYaS0QBS6UFCwXcEXwJcuZQg4LxXj7DvZNy855SFy6PQbityeUxiQc2YQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pigl4i3gyS+HEMvXRXxFqo1H8pQQJ6XH2ugszUc1Vi2mzt2KBhADo4DrAO1oUL8YroDZjSXy0gXPHFVj8Dz8kDAZGRjsiOVrBwVC2KmgeBK1dh8TOJDe/PW/M9s0EalwhnS1lrYoNSGToOWU81CXJG4qRbdlgomtsBsxLDNZ9CY9SONXyBxtiafB+KJSpdEg5b+fZE1nCYOATXY1ZZ1N8OtIPHUUlsogmW2mIyEVYRDoAerl+rikOQNkF4MVlNMUQA78TfTlQyh84r7f7pCbIlKq+G2r7Qcaq/yn8I/PUpAwUhgn/Th9Rjp90S6BXaa+H3mOfeGdtiOH8W/jhcuuMQ==
- Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Gurchetan Singh <gurchetansingh@xxxxxxxxxxxx>, Albert Esteve <aesteve@xxxxxxxxxx>, <ernunes@xxxxxxxxxx>, Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>, Alyssa Ross <hi@xxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Alex Deucher <alexander.deucher@xxxxxxx>, Christian König <christian.koenig@xxxxxxx>, Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>, Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@xxxxxxx>, "Honglei Huang" <honglei1.huang@xxxxxxx>, Julia Zhang <julia.zhang@xxxxxxx>, "Chen Jiqian" <Jiqian.Chen@xxxxxxx>, Antonio Caggiano <antonio.caggiano@xxxxxxxxxxxxx>, Huang Rui <ray.huang@xxxxxxx>
- Delivery-date: Fri, 15 Sep 2023 11:18:23 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
From: Antonio Caggiano <antonio.caggiano@xxxxxxxxxxxxx>
Add support for the Venus capset, which enables Vulkan support through
the Venus Vulkan driver for virtio-gpu.
Signed-off-by: Antonio Caggiano <antonio.caggiano@xxxxxxxxxxxxx>
Signed-off-by: Huang Rui <ray.huang@xxxxxxx>
---
V4 -> V5:
- Send kernel patch to define VIRTIO_GPU_CAPSET_VENUS and will use
another patch to sync up linux headers. (Akihiko)
- https://lore.kernel.org/lkml/20230915105918.3763061-1-ray.huang@xxxxxxx/
hw/display/virtio-gpu-virgl.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c
index 8a017dbeb4..7f95490e90 100644
--- a/hw/display/virtio-gpu-virgl.c
+++ b/hw/display/virtio-gpu-virgl.c
@@ -437,6 +437,11 @@ static void virgl_cmd_get_capset_info(VirtIOGPU *g,
virgl_renderer_get_cap_set(resp.capset_id,
&resp.capset_max_version,
&resp.capset_max_size);
+ } else if (info.capset_index == 2) {
+ resp.capset_id = VIRTIO_GPU_CAPSET_VENUS;
+ virgl_renderer_get_cap_set(resp.capset_id,
+ &resp.capset_max_version,
+ &resp.capset_max_size);
} else {
resp.capset_max_version = 0;
resp.capset_max_size = 0;
@@ -901,10 +906,18 @@ int virtio_gpu_virgl_init(VirtIOGPU *g)
int virtio_gpu_virgl_get_num_capsets(VirtIOGPU *g)
{
- uint32_t capset2_max_ver, capset2_max_size;
+ uint32_t capset2_max_ver, capset2_max_size, num_capsets;
+ num_capsets = 1;
+
virgl_renderer_get_cap_set(VIRTIO_GPU_CAPSET_VIRGL2,
- &capset2_max_ver,
- &capset2_max_size);
+ &capset2_max_ver,
+ &capset2_max_size);
+ num_capsets += capset2_max_ver ? 1 : 0;
+
+ virgl_renderer_get_cap_set(VIRTIO_GPU_CAPSET_VENUS,
+ &capset2_max_ver,
+ &capset2_max_size);
+ num_capsets += capset2_max_size ? 1 : 0;
- return capset2_max_ver ? 2 : 1;
+ return num_capsets;
}
--
2.34.1
|