#ifndef _VIRTIO_GPU_DXE_H_\r
#define _VIRTIO_GPU_DXE_H_\r
\r
+#include <IndustryStandard/VirtioGpu.h>\r
#include <Library/DebugLib.h>\r
#include <Library/UefiLib.h>\r
#include <Protocol/VirtioDevice.h>\r
//\r
EFI_EVENT ExitBoot;\r
\r
+ //\r
+ // Common running counter for all VirtIo GPU requests that ask for fencing.\r
+ //\r
+ UINT64 FenceId;\r
+\r
//\r
// The Child field references the GOP wrapper structure. If this pointer is\r
// NULL, then the hybrid driver has bound (i.e., started) the\r
IN VOID *Context\r
);\r
\r
+/**\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 VOID *FirstBackingPage,\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
#endif // _VIRTIO_GPU_DXE_H_\r