All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antonio Caggiano <antonio.caggiano@collabora.com>
To: qemu-devel@nongnu.org
Cc: Antonio Caggiano <antonio.caggiano@collabora.com>
Subject: [PATCH 5/7] virtio-gpu: Support Venus capset
Date: Tue, 27 Jul 2021 19:05:08 +0200	[thread overview]
Message-ID: <20210727170510.2116383-6-antonio.caggiano@collabora.com> (raw)
In-Reply-To: <20210727170510.2116383-1-antonio.caggiano@collabora.com>

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
---
 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 38e5ca6c72..beb4b7d106 100644
--- a/hw/display/virtio-gpu-virgl.c
+++ b/hw/display/virtio-gpu-virgl.c
@@ -372,6 +372,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;
@@ -634,10 +639,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 85898d41a7..28e863cd08 100644
--- a/include/standard-headers/linux/virtio_gpu.h
+++ b/include/standard-headers/linux/virtio_gpu.h
@@ -307,6 +307,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.30.2



  parent reply	other threads:[~2021-07-27 17:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 17:05 [PATCH 0/7] virtio-gpu: Support Venus Vulkan driver Antonio Caggiano
2021-07-27 17:05 ` [PATCH 1/7] virtio-gpu: CONTEXT_INIT feature Antonio Caggiano
2021-07-27 17:05 ` [PATCH 2/7] virtio-gpu: hostmem [wip] Antonio Caggiano
2021-07-27 17:05 ` [PATCH 3/7] virtio: Add shared memory capability Antonio Caggiano
2021-07-28 13:21   ` Dr. David Alan Gilbert
2021-07-27 17:05 ` [PATCH 4/7] virtio-gpu: Resource UUID Antonio Caggiano
2021-07-27 17:05 ` Antonio Caggiano [this message]
2021-07-27 17:05 ` [PATCH 6/7] virtio-gpu: Initialize Venus Antonio Caggiano
2021-07-28 16:30   ` Paolo Bonzini
2021-07-27 17:05 ` [PATCH 7/7] virtio-gpu: Handle resource blob commands Antonio Caggiano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210727170510.2116383-6-antonio.caggiano@collabora.com \
    --to=antonio.caggiano@collabora.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.