]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/Gop: clear the screen to black in SetMode()
authorRuiyu Ni <ruiyu.ni@intel.com>
Tue, 13 Mar 2018 10:05:16 +0000 (18:05 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Wed, 14 Mar 2018 03:20:29 +0000 (11:20 +0800)
Today's implementation forgot to clear the screen to black in
SetMode(). It causes SCT SetMode() test fails.

The patch adds the clear screen operation in SetMode() to fix
the SCT failure.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
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
 /** @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
 \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
 \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
 \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
   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
   return EFI_SUCCESS;\r
 }\r
 \r