Browse Source

OvmfPkg/VirtioGpuDxe: add VirtioGpuGetDisplayInfo

Add support for sending a GetDisplayInfo command.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Gerd Hoffmann 2 years ago
parent
commit
82c07f2cc7
2 changed files with 26 additions and 0 deletions
  1. 20 0
      OvmfPkg/VirtioGpuDxe/Commands.c
  2. 6 0
      OvmfPkg/VirtioGpuDxe/VirtioGpu.h

+ 20 - 0
OvmfPkg/VirtioGpuDxe/Commands.c

@@ -828,3 +828,23 @@ VirtioGpuResourceFlush (
            sizeof Request
            );
 }
+
+EFI_STATUS
+VirtioGpuGetDisplayInfo (
+  IN OUT VGPU_DEV                        *VgpuDev,
+  volatile VIRTIO_GPU_RESP_DISPLAY_INFO  *Response
+  )
+{
+  volatile VIRTIO_GPU_CONTROL_HEADER  Request;
+
+  return VirtioGpuSendCommandWithReply (
+           VgpuDev,
+           VirtioGpuCmdGetDisplayInfo,
+           FALSE,                     // Fence
+           &Request,
+           sizeof Request,
+           VirtioGpuRespOkDisplayInfo,
+           &Response->Header,
+           sizeof *Response
+           );
+}

+ 6 - 0
OvmfPkg/VirtioGpuDxe/VirtioGpu.h

@@ -366,6 +366,12 @@ VirtioGpuResourceFlush (
   IN     UINT32    ResourceId
   );
 
+EFI_STATUS
+VirtioGpuGetDisplayInfo (
+  IN OUT VGPU_DEV                        *VgpuDev,
+  volatile VIRTIO_GPU_RESP_DISPLAY_INFO  *Response
+  );
+
 /**
   Release guest-side and host-side resources that are related to an initialized
   VGPU_GOP.Gop.