From: Gerd Hoffmann Date: Fri, 8 Apr 2022 08:23:30 +0000 (+0200) Subject: OvmfPkg/VirtioGpuDxe: add VirtioGpuGetDisplayInfo X-Git-Tag: edk2-stable202205~64 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=82c07f2cc748b356750329435a161b00ab88bcf7 OvmfPkg/VirtioGpuDxe: add VirtioGpuGetDisplayInfo Add support for sending a GetDisplayInfo command. Signed-off-by: Gerd Hoffmann Reviewed-by: Ard Biesheuvel --- 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.