From 82c07f2cc748b356750329435a161b00ab88bcf7 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 8 Apr 2022 10:23:30 +0200 Subject: [PATCH] OvmfPkg/VirtioGpuDxe: add VirtioGpuGetDisplayInfo Add support for sending a GetDisplayInfo command. Signed-off-by: Gerd Hoffmann Reviewed-by: Ard Biesheuvel --- OvmfPkg/VirtioGpuDxe/Commands.c | 20 ++++++++++++++++++++ OvmfPkg/VirtioGpuDxe/VirtioGpu.h | 6 ++++++ 2 files changed, 26 insertions(+) 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.