Skip to contentSkip to conversation

virtio-gpu: Add VIRTIO_GPU_CAPSET_DRM capset definition

PATCH In review Dorinda Bassey 3 participants 4 messages Nov 18

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-gpu: Add VIRTIO_GPU_CAPSET_DRM capset definition

The specification currently defines capsets 1-5, but the Linux kernel has supported VIRTIO_GPU_CAPSET_DRM (ID 6) since commit 7214da0ed ("drm/virtio: Add DRM capset definition", July 2024).

VIRTIO_GPU_CAPSET_DRM enables DRM native context support for direct rendering without GL/Vulkan translation layers, allowing applications to use native DRM APIs for lower latency GPU access and compute workloads.

Add VIRTIO_GPU_CAPSET_DRM definition with ID 6 to align the specification with the kernel UAPI and device implementations.

---
 device-types/gpu/description.tex | 3 +++
 1 file changed, 3 insertions(+)
device-types/gpu/description.tex +3 -0
index ac3b427..2d7ffa6 100644
@@ -542,6 +542,8 @@ \subsubsection{Device Operation: controlq}\label{sec:Device Types / GPU Device /
 	Mesa's (mostly) autogenerated Vulkan protocol.
   \item \href{https://chromium.googlesource.com/chromiumos/platform/crosvm/+/refs/heads/main/rutabaga_gfx/src/cross_domain/cross_domain_protocol.rs}{VIRTIO_GPU_CAPSET_CROSS_DOMAIN} --
 	protocol for display virtualization via Wayland proxying.
+  \item \href{https://www.kernel.org/doc/html/latest/gpu/drm-uapi.html}{VIRTIO_GPU_CAPSET_DRM} --
+	DRM native context support for direct rendering without GL/Vulkan translation.
   \end{itemize*}
 
 \begin{lstlisting}
@@ -556,6 +558,7 @@ \subsubsection{Device Operation: controlq}\label{sec:Device Types / GPU Device /
 #define VIRTIO_GPU_CAPSET_GFXSTREAM 3
 #define VIRTIO_GPU_CAPSET_VENUS 4
 #define VIRTIO_GPU_CAPSET_CROSS_DOMAIN 5
+#define VIRTIO_GPU_CAPSET_DRM 6
 struct virtio_gpu_resp_capset_info {
         struct virtio_gpu_ctrl_hdr hdr;
         le32 capset_id;
Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Dorinda,

Thanks for the patch! It's great to see this happening. We have been using this for a while now but it felt sort of weird to not have it in the spec.

Quoted 9 lines · Dorinda Bassey

The specification currently defines capsets 1-5, but the Linux kernel has supported VIRTIO_GPU_CAPSET_DRM (ID 6) since commit 7214da0ed ("drm/virtio: Add DRM capset definition", July 2024).

VIRTIO_GPU_CAPSET_DRM enables DRM native context support for direct rendering without GL/Vulkan translation layers, allowing applications to use native DRM APIs for lower latency GPU access and compute workloads.

Quoted 4 lines

Add VIRTIO_GPU_CAPSET_DRM definition with ID 6 to align the specification with the kernel UAPI and device implementations.

Best regards,
Michael

Quoted 25 lines
---
 device-types/gpu/description.tex | 3 +++
 1 file changed, 3 insertions(+)
device-types/gpu/description.tex +3 -0
index ac3b427..2d7ffa6 100644
@@ -542,6 +542,8 @@ \subsubsection{Device Operation: controlq}\label{sec:Device Types / GPU Device /
 	Mesa's (mostly) autogenerated Vulkan protocol.
   \item \href{https://chromium.googlesource.com/chromiumos/platform/crosvm/+/refs/heads/main/rutabaga_gfx/src/cross_domain/cross_domain_protocol.rs}{VIRTIO_GPU_CAPSET_CROSS_DOMAIN} --
 	protocol for display virtualization via Wayland proxying.
+  \item \href{https://www.kernel.org/doc/html/latest/gpu/drm-uapi.html}{VIRTIO_GPU_CAPSET_DRM} --
+	DRM native context support for direct rendering without GL/Vulkan translation.
   \end{itemize*}
 
 \begin{lstlisting}
@@ -556,6 +558,7 @@ \subsubsection{Device Operation: controlq}\label{sec:Device Types / GPU Device /
 #define VIRTIO_GPU_CAPSET_GFXSTREAM 3
 #define VIRTIO_GPU_CAPSET_VENUS 4
 #define VIRTIO_GPU_CAPSET_CROSS_DOMAIN 5
+#define VIRTIO_GPU_CAPSET_DRM 6
 struct virtio_gpu_resp_capset_info {
         struct virtio_gpu_ctrl_hdr hdr;
         le32 capset_id;
#2 lore raw
Quoted 42 lines · Michael Riesch

Hi Dorinda,

Thanks for the patch! It's great to see this happening. We have been using this for a while now but it felt sort of weird to not have it in the spec.

Quoted 9 lines · Dorinda Bassey

The specification currently defines capsets 1-5, but the Linux kernel has supported VIRTIO_GPU_CAPSET_DRM (ID 6) since commit 7214da0ed ("drm/virtio: Add DRM capset definition", July 2024).

VIRTIO_GPU_CAPSET_DRM enables DRM native context support for direct rendering without GL/Vulkan translation layers, allowing applications to use native DRM APIs for lower latency GPU access and compute workloads.

Quoted 4 lines

Add VIRTIO_GPU_CAPSET_DRM definition with ID 6 to align the specification with the kernel UAPI and device implementations.

Best regards,
Michael

Quoted 16 lines
---
  device-types/gpu/description.tex | 3 +++
  1 file changed, 3 insertions(+)
device-types/gpu/description.tex +2 -0
index ac3b427..2d7ffa6 100644
@@ -542,6 +542,8 @@ \subsubsection{Device Operation: controlq}\label{sec:Device Types / GPU Device /
  	Mesa's (mostly) autogenerated Vulkan protocol.
    \item \href{https://chromium.googlesource.com/chromiumos/platform/crosvm/+/refs/heads/main/rutabaga_gfx/src/cross_domain/cross_domain_protocol.rs}{VIRTIO_GPU_CAPSET_CROSS_DOMAIN} --
  	protocol for display virtualization via Wayland proxying.
+  \item \href{https://www.kernel.org/doc/html/latest/gpu/drm-uapi.html}{VIRTIO_GPU_CAPSET_DRM} --
+	DRM native context support for direct rendering without GL/Vulkan translation.
    \end{itemize*}
 
Quoted 10 lines

device-types/gpu/description.tex \subsubsection{Device Operation: controlq}\label{sec:Device Types / GPU Device / · line 564

Quoted 9 lines
device-types/gpu/description.tex +1 -0
  \begin{lstlisting}
@@ -556,6 +558,7 @@ \subsubsection{Device Operation: controlq}\label{sec:Device Types / GPU Device /
  #define VIRTIO_GPU_CAPSET_GFXSTREAM 3
  #define VIRTIO_GPU_CAPSET_VENUS 4
  #define VIRTIO_GPU_CAPSET_CROSS_DOMAIN 5
+#define VIRTIO_GPU_CAPSET_DRM 6
  struct virtio_gpu_resp_capset_info {
          struct virtio_gpu_ctrl_hdr hdr;
          le32 capset_id;

There is [1] that I thought was merged long time ago. Apparently it's not?

[1] https://github.com/oasis-tcs/virtio-spec/issues/182

Signature · 2 lines
Best regards,
Dmitry
#3 lore raw

Hi Dmitry,

Quoted 2 lines

There is [1] that I thought was merged long time ago. Apparently it's not?
[1] https://github.com/oasis-tcs/virtio-spec/issues/182

Thanks for pointing this out. I wasn't aware that there was already an issue open for this.
I guess we can drop this patch in favour of the one you posted.

BR,
Dorinda.

Quoted 63 lines · Dmitry Osipenko
Quoted 42 lines · Michael Riesch

Hi Dorinda,

Thanks for the patch! It's great to see this happening. We have been using this for a while now but it felt sort of weird to not have it in the spec.

Quoted 9 lines · Dorinda Bassey

The specification currently defines capsets 1-5, but the Linux kernel has supported VIRTIO_GPU_CAPSET_DRM (ID 6) since commit 7214da0ed ("drm/virtio: Add DRM capset definition", July 2024).

VIRTIO_GPU_CAPSET_DRM enables DRM native context support for direct rendering without GL/Vulkan translation layers, allowing applications to use native DRM APIs for lower latency GPU access and compute workloads.

Quoted 4 lines

Add VIRTIO_GPU_CAPSET_DRM definition with ID 6 to align the specification with the kernel UAPI and device implementations.

Best regards,
Michael

Quoted 16 lines
---
  device-types/gpu/description.tex | 3 +++
  1 file changed, 3 insertions(+)
device-types/gpu/description.tex +2 -0
index ac3b427..2d7ffa6 100644
@@ -542,6 +542,8 @@ \subsubsection{Device Operation: controlq}\label{sec:Device Types / GPU Device /
     Mesa's (mostly) autogenerated Vulkan protocol.
    \item \href{https://chromium.googlesource.com/chromiumos/platform/crosvm/+/refs/heads/main/rutabaga_gfx/src/cross_domain/cross_domain_protocol.rs}{VIRTIO_GPU_CAPSET_CROSS_DOMAIN} --
     protocol for display virtualization via Wayland proxying.
+  \item \href{https://www.kernel.org/doc/html/latest/gpu/drm-uapi.html}{VIRTIO_GPU_CAPSET_DRM} --
+    DRM native context support for direct rendering without GL/Vulkan translation.
    \end{itemize*}
 
Quoted 10 lines

device-types/gpu/description.tex \subsubsection{Device Operation: controlq}\label{sec:Device Types / GPU Device / · line 564

Quoted 9 lines
device-types/gpu/description.tex +1 -0
  \begin{lstlisting}
@@ -556,6 +558,7 @@ \subsubsection{Device Operation: controlq}\label{sec:Device Types / GPU Device /
  #define VIRTIO_GPU_CAPSET_GFXSTREAM 3
  #define VIRTIO_GPU_CAPSET_VENUS 4
  #define VIRTIO_GPU_CAPSET_CROSS_DOMAIN 5
+#define VIRTIO_GPU_CAPSET_DRM 6
  struct virtio_gpu_resp_capset_info {
          struct virtio_gpu_ctrl_hdr hdr;
          le32 capset_id;

There is [1] that I thought was merged long time ago. Apparently it's not?

[1] https://github.com/oasis-tcs/virtio-spec/issues/182

--
Best regards,
Dmitry