summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2022-04-08 10:23:30 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-04-25 21:01:13 +0000
commit82c07f2cc748b356750329435a161b00ab88bcf7 (patch)
treefdca4885170513e742479d6f5b5a1aedf5aa211c
parent182122914ccb0f3ac268de3d0e863cdc77420f08 (diff)
downloadedk2-82c07f2cc748b356750329435a161b00ab88bcf7.tar.gz
edk2-82c07f2cc748b356750329435a161b00ab88bcf7.tar.bz2
edk2-82c07f2cc748b356750329435a161b00ab88bcf7.zip
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>
-rw-r--r--OvmfPkg/VirtioGpuDxe/Commands.c20
-rw-r--r--OvmfPkg/VirtioGpuDxe/VirtioGpu.h6
2 files changed, 26 insertions, 0 deletions
diff --git a/OvmfPkg/VirtioGpuDxe/Commands.c b/OvmfPkg/VirtioGpuDxe/Commands.c
index b9a3ea9230..4318d3d771 100644
--- a/OvmfPkg/VirtioGpuDxe/Commands.c
+++ b/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
+ );
+}
diff --git a/OvmfPkg/VirtioGpuDxe/VirtioGpu.h b/OvmfPkg/VirtioGpuDxe/VirtioGpu.h
index 2155b261d4..1d781088bb 100644
--- a/OvmfPkg/VirtioGpuDxe/VirtioGpu.h
+++ b/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.