#include <IndustryStandard/VirtioGpu.h>\r
#include <Library/DebugLib.h>\r
#include <Library/UefiLib.h>\r
+#include <Protocol/GraphicsOutput.h>\r
#include <Protocol/VirtioDevice.h>\r
\r
//\r
// The Gop field is installed on the child handle as Graphics Output Protocol\r
// interface.\r
//\r
- // For now it is just a placeholder.\r
+ EFI_GRAPHICS_OUTPUT_PROTOCOL Gop;\r
+\r
+ //\r
+ // Referenced by Gop.Mode, GopMode provides a summary about the supported\r
+ // graphics modes, and the current mode.\r
+ //\r
+ EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE GopMode;\r
+\r
+ //\r
+ // Referenced by GopMode.Info, GopModeInfo provides detailed information\r
+ // about the current mode.\r
+ //\r
+ EFI_GRAPHICS_OUTPUT_MODE_INFORMATION GopModeInfo;\r
+\r
+ //\r
+ // Identifier of the 2D host resource that is in use by this head (scanout)\r
+ // of the VirtIo GPU device. Zero until the first successful -- internal --\r
+ // Gop.SetMode() call, never zero afterwards.\r
+ //\r
+ UINT32 ResourceId;\r
+\r
//\r
- UINT8 Gop;\r
+ // A number of whole pages providing the backing store for the 2D host\r
+ // resource identified by ResourceId above. NULL until the first successful\r
+ // -- internal -- Gop.SetMode() call, never NULL afterwards.\r
+ //\r
+ UINT32 *BackingStore;\r
+ UINTN NumberOfPages;\r
};\r
\r
//\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
#endif // _VIRTIO_GPU_DXE_H_\r