]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/VirtioGpuDxe/VirtioGpu.h
IntelSiliconPkg/IntelVTdDxe: Update function comments
[mirror_edk2.git] / OvmfPkg / VirtioGpuDxe / VirtioGpu.h
index f8839922487ca07d44572abae27ba30271afc821..078b7d44d83e994bf93ee121d8ef81fd42a82f78 100644 (file)
@@ -20,6 +20,7 @@
 #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
@@ -114,9 +115,34 @@ struct VGPU_GOP_STRUCT {
   // 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
@@ -264,4 +290,38 @@ VirtioGpuResourceFlush (
   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