[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[QEMU PATCH v4 11/13] virtio-gpu: Support Venus capset
- To: Gerd Hoffmann <kraxel@xxxxxxxxxx>, "Michael S . Tsirkin" <mst@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Antonio Caggiano <antonio.caggiano@xxxxxxxxxxxxx>, "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: Thu, 31 Aug 2023 17:32:50 +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=7jKl0Cln6cyhAJBoLYKE6z9NzKJbaZOSW+kOo6d5qjw=; b=oB++OdzYAxAOLWwAQckIGiNZ9GA6SQM1L1YkwShr0FtJQn3kr0EtrnOR2/CFjdyhcnemxUMbrdZI2cwkj5iLX7Pu9GqIBhUatJhPz8ZXMOrhpJcR8whBqhUeB6BLp02LJjv8PjCdNS9r/M5xolYJ5yu4ge5XV2SyAfzgxJaUXdgmGq8qB4mzFRRwer3QFyqBqfE+78mDTirFLssYRgukuBSkcKQZ5KFlfcog+RdS67hSK5wiQCNwV2HoRyD+R4s5ZfVprb3WvXCsQ3d41mEIT4dx4D2wO5R13cqONO1V0UWxlC/e7m1cDTKjgvBnb4oQ0VT2nzp/dCukOt2GUCO9Sw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UGjl2NGlswrqBZCj7671tYCOZpD2NuDesuEVau5Sp5XsAc0NcP9HYISnfeztfSmU+z3r65mEdPA540hly1Qlp3UP2MoXH7+mlOOPfX/ssbh1JgCkbMQ5rlDQaJz+SpD3VsBlAlkbtT1C7omLTy+SMa/HK1Ja8p1OqNJlbAbDK1ha1HJZYQg0dCJYAUpxdNw/47JB00CPWiVNrRGJd4c0oL9vm68yFLwaPwU1SrART6LGKH39CGWYZKIJCLvWkTTC5Ph1IkQ/gcP7WIGPYJX5+I69LdT72kicrJYRiiVXOQlEjVBJmdEtsU2riRot3/nII+4SO3ftSFcrSfIW3qDHtA==
- Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Gurchetan Singh <gurchetansingh@xxxxxxxxxxxx>, <ernunes@xxxxxxxxxx>, Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>, Akihiko Odaki <akihiko.odaki@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>, Huang Rui <ray.huang@xxxxxxx>
- Delivery-date: Thu, 31 Aug 2023 09:40:49 +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>
---
hw/display/virtio-gpu-virgl.c | 21 +++++++++++++++++----
include/standard-headers/linux/virtio_gpu.h | 2 ++
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c
index 1a996a08fc..83cd8c8fd0 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;
}
diff --git a/include/standard-headers/linux/virtio_gpu.h
b/include/standard-headers/linux/virtio_gpu.h
index 2da48d3d4c..2db643ed8f 100644
--- a/include/standard-headers/linux/virtio_gpu.h
+++ b/include/standard-headers/linux/virtio_gpu.h
@@ -309,6 +309,8 @@ struct virtio_gpu_cmd_submit {
#define VIRTIO_GPU_CAPSET_VIRGL 1
#define VIRTIO_GPU_CAPSET_VIRGL2 2
+/* 3 is reserved for gfxstream */
+#define VIRTIO_GPU_CAPSET_VENUS 4
/* VIRTIO_GPU_CMD_GET_CAPSET_INFO */
struct virtio_gpu_get_capset_info {
--
2.34.1
|