+/**\r
+ The following functions send requests to the VirtIo GPU device model, await\r
+ the answer from the host, and return a status. They share the following\r
+ interface details:\r
+\r
+ @param[in,out] VgpuDev The VGPU_DEV object that represents the VirtIo GPU\r
+ device. The caller is responsible to have\r
+ successfully invoked VirtioGpuInit() on VgpuDev\r
+ previously, while VirtioGpuUninit() must not have\r
+ been called on VgpuDev.\r
+\r
+ @retval EFI_INVALID_PARAMETER Invalid command-specific parameters were\r
+ detected by this driver.\r
+\r
+ @retval EFI_SUCCESS Operation successful.\r
+\r
+ @retval EFI_DEVICE_ERROR The host rejected the request. The host error\r
+ code has been logged on the EFI_D_ERROR level.\r
+\r
+ @return Codes for unexpected errors in VirtIo\r
+ messaging.\r
+\r
+ For the command-specific parameters, please consult the GPU Device section of\r
+ the VirtIo 1.0 specification (see references in\r
+ "OvmfPkg/Include/IndustryStandard/VirtioGpu.h").\r
+**/\r
+EFI_STATUS\r
+VirtioGpuResourceCreate2d (\r
+ IN OUT VGPU_DEV *VgpuDev,\r
+ IN UINT32 ResourceId,\r
+ IN VIRTIO_GPU_FORMATS Format,\r
+ IN UINT32 Width,\r
+ IN UINT32 Height\r
+ );\r
+\r
+EFI_STATUS\r
+VirtioGpuResourceUnref (\r
+ IN OUT VGPU_DEV *VgpuDev,\r
+ IN UINT32 ResourceId\r
+ );\r
+\r
+EFI_STATUS\r
+VirtioGpuResourceAttachBacking (\r
+ IN OUT VGPU_DEV *VgpuDev,\r
+ IN UINT32 ResourceId,\r
+ IN EFI_PHYSICAL_ADDRESS BackingStoreDeviceAddress,\r
+ IN UINTN NumberOfPages\r
+ );\r
+\r
+EFI_STATUS\r
+VirtioGpuResourceDetachBacking (\r
+ IN OUT VGPU_DEV *VgpuDev,\r
+ IN UINT32 ResourceId\r
+ );\r
+\r
+EFI_STATUS\r
+VirtioGpuSetScanout (\r
+ IN OUT VGPU_DEV *VgpuDev,\r
+ IN UINT32 X,\r
+ IN UINT32 Y,\r
+ IN UINT32 Width,\r
+ IN UINT32 Height,\r
+ IN UINT32 ScanoutId,\r
+ IN UINT32 ResourceId\r
+ );\r
+\r
+EFI_STATUS\r
+VirtioGpuTransferToHost2d (\r
+ IN OUT VGPU_DEV *VgpuDev,\r
+ IN UINT32 X,\r
+ IN UINT32 Y,\r
+ IN UINT32 Width,\r
+ IN UINT32 Height,\r
+ IN UINT64 Offset,\r
+ IN UINT32 ResourceId\r
+ );\r
+\r
+EFI_STATUS\r
+VirtioGpuResourceFlush (\r
+ IN OUT VGPU_DEV *VgpuDev,\r
+ IN UINT32 X,\r
+ IN UINT32 Y,\r
+ IN UINT32 Width,\r
+ IN UINT32 Height,\r
+ IN UINT32 ResourceId\r
+ );\r
+\r
+/**\r
+ Release guest-side and host-side resources that are related to an initialized\r
+ VGPU_GOP.Gop.\r
+\r
+ param[in,out] VgpuGop The VGPU_GOP object to release resources for.\r
+\r
+ On input, the caller is responsible for having called\r
+ VgpuGop->Gop.SetMode() at least once successfully.\r
+ (This is equivalent to the requirement that\r
+ VgpuGop->BackingStore be non-NULL. It is also\r
+ equivalent to the requirement that VgpuGop->ResourceId\r
+ be nonzero.)\r
+\r
+ On output, resources will be released, and\r
+ VgpuGop->BackingStore and VgpuGop->ResourceId will be\r
+ nulled.\r
+\r
+ param[in] DisableHead Whether this head (scanout) currently references the\r
+ resource identified by VgpuGop->ResourceId. Only pass\r
+ FALSE when VgpuGop->Gop.SetMode() calls this function\r
+ while switching between modes, and set it to TRUE\r
+ every other time.\r
+**/\r
+VOID\r
+ReleaseGopResources (\r
+ IN OUT VGPU_GOP *VgpuGop,\r
+ IN BOOLEAN DisableHead\r
+ );\r
+\r
+//\r
+// Template for initializing VGPU_GOP.Gop.\r
+//\r
+extern CONST EFI_GRAPHICS_OUTPUT_PROTOCOL mGopTemplate;\r
+\r