]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/QemuVideoDxe/Gop.c
OvmfPkg/Gop: clear the screen to black in SetMode()
[mirror_edk2.git] / OvmfPkg / QemuVideoDxe / Gop.c
index 512fd27acbda08a4ed7ee9ddacd0b3a1a6875b83..b479d24a87634a31c4d563dd542fa3ef637c7c8a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Graphics Output Protocol functions for the QEMU video controller.\r
 \r
-  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -196,9 +196,10 @@ Routine Description:
 \r
 --*/\r
 {\r
-  QEMU_VIDEO_PRIVATE_DATA    *Private;\r
-  QEMU_VIDEO_MODE_DATA       *ModeData;\r
-  RETURN_STATUS              Status;\r
+  QEMU_VIDEO_PRIVATE_DATA       *Private;\r
+  QEMU_VIDEO_MODE_DATA          *ModeData;\r
+  RETURN_STATUS                 Status;\r
+  EFI_GRAPHICS_OUTPUT_BLT_PIXEL Black;\r
 \r
   Private = QEMU_VIDEO_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS (This);\r
 \r
@@ -271,6 +272,21 @@ Routine Description:
   }\r
   ASSERT (Status == RETURN_SUCCESS);\r
 \r
+  //\r
+  // Per UEFI Spec, need to clear the visible portions of the output display to black.\r
+  //\r
+  ZeroMem (&Black, sizeof (Black));\r
+  Status = FrameBufferBlt (\r
+             Private->FrameBufferBltConfigure,\r
+             &Black,\r
+             EfiBltVideoFill,\r
+             0, 0,\r
+             0, 0,\r
+             This->Mode->Info->HorizontalResolution, This->Mode->Info->VerticalResolution,\r
+             0\r
+             );\r
+  ASSERT_RETURN_ERROR (Status);\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r