]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/VirtioGpuDxe: add VirtioGpuGetDisplayInfo
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 8 Apr 2022 08:23:30 +0000 (10:23 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 25 Apr 2022 21:01:13 +0000 (21:01 +0000)
Add support for sending a GetDisplayInfo command.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
OvmfPkg/VirtioGpuDxe/Commands.c
OvmfPkg/VirtioGpuDxe/VirtioGpu.h

index b9a3ea9230214da0d6eed54378cff2a4460aa23e..4318d3d771c556d5c2eaeb756690ff531508b775 100644 (file)
@@ -828,3 +828,23 @@ VirtioGpuResourceFlush (
            sizeof Request\r
            );\r
 }\r
+\r
+EFI_STATUS\r
+VirtioGpuGetDisplayInfo (\r
+  IN OUT VGPU_DEV                        *VgpuDev,\r
+  volatile VIRTIO_GPU_RESP_DISPLAY_INFO  *Response\r
+  )\r
+{\r
+  volatile VIRTIO_GPU_CONTROL_HEADER  Request;\r
+\r
+  return VirtioGpuSendCommandWithReply (\r
+           VgpuDev,\r
+           VirtioGpuCmdGetDisplayInfo,\r
+           FALSE,                     // Fence\r
+           &Request,\r
+           sizeof Request,\r
+           VirtioGpuRespOkDisplayInfo,\r
+           &Response->Header,\r
+           sizeof *Response\r
+           );\r
+}\r
index 2155b261d43e7a36074ad8dd81c9078cc9c4a79c..1d781088bb3f90f37a4bf59500320d0505b6dcfe 100644 (file)
@@ -366,6 +366,12 @@ VirtioGpuResourceFlush (
   IN     UINT32    ResourceId\r
   );\r
 \r
+EFI_STATUS\r
+VirtioGpuGetDisplayInfo (\r
+  IN OUT VGPU_DEV                        *VgpuDev,\r
+  volatile VIRTIO_GPU_RESP_DISPLAY_INFO  *Response\r
+  );\r
+\r
 /**\r
   Release guest-side and host-side resources that are related to an initialized\r
   VGPU_GOP.Gop.\r