public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Zhichao" <zhichao.gao@intel.com>
To: devel@edk2.groups.io
Cc: Aaron Antone <aanton@microsoft.com>,
	Jian J Wang <jian.j.wang@intel.com>, Hao Wu <hao.a.wu@intel.com>,
	Ray Ni <ray.ni@intel.com>, Star Zeng <star.zeng@intel.com>,
	Liming Gao <liming.gao@intel.com>,
	Sean Brogan <sean.brogan@microsoft.com>,
	Michael Turner <Michael.Turner@microsoft.com>,
	Bret Barkelew <Bret.Barkelew@microsoft.com>
Subject: [PATCH 2/2] MdeModulePkg/GraphicsConsoleDxe: Do not clean the screen
Date: Fri, 12 Apr 2019 11:14:36 +0800	[thread overview]
Message-ID: <20190412031436.19088-3-zhichao.gao@intel.com> (raw)
In-Reply-To: <20190412031436.19088-1-zhichao.gao@intel.com>

From: Aaron Antone <aanton@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1412

For now, most platform support to display during PEIM. It means the logo
can show at PEI phase. But the screen would be cleared at BDS connect
console phase. That may make the screen flush and turn into black screen.
So do not clear the screen while set the text mode for graphics console
device.
Also replace the debug code in GraphicsConsoleControllerDriverStart. The
origin one would set a basic mode and then print the text info to graphic
console device. Then the conspliter would set a best mode for graphics
console device. If the best mode is different with the basic one, the
screen would be cleared. So use the debug output instead.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 .../GraphicsConsoleDxe/GraphicsConsole.c      | 45 +++++++++----------
 1 file changed, 22 insertions(+), 23 deletions(-)

diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
index 26ea19f300..0a35b59d64 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
@@ -1,7 +1,7 @@
 /** @file
   This is the main routine for initializing the Graphics Console support routines.
 
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -567,16 +567,7 @@ GraphicsConsoleControllerDriverStart (
   //
   Private->SimpleTextOutputMode.MaxMode = (INT32) MaxMode;
 
-  DEBUG_CODE_BEGIN ();
-    Status = GraphicsConsoleConOutSetMode (&Private->SimpleTextOutput, 0);
-    if (EFI_ERROR (Status)) {
-      goto Error;
-    }
-    Status = GraphicsConsoleConOutOutputString (&Private->SimpleTextOutput, (CHAR16 *)L"Graphics Console Started\n\r");
-    if (EFI_ERROR (Status)) {
-      goto Error;
-    }
-  DEBUG_CODE_END ();
+  DEBUG ((DEBUG_INFO, "Graphics Console Started!\n\r"));
 
   //
   // Install protocol interfaces for the Graphics Console device.
@@ -1366,18 +1357,26 @@ GraphicsConsoleConOutSetMode (
       //
       // The current graphics mode is correct, so simply clear the entire display
       //
-      Status = GraphicsOutput->Blt (
-                          GraphicsOutput,
-                          &mGraphicsEfiColors[0],
-                          EfiBltVideoFill,
-                          0,
-                          0,
-                          0,
-                          0,
-                          ModeData->GopWidth,
-                          ModeData->GopHeight,
-                          0
-                          );
+      //
+      // For the first time set the mode, do not clear the display.
+      // Some platform would show logo at PEIM and this would clear
+      // the whole screen. So for first time set mode, do not clear
+      // the screen.
+      //
+      if (This->Mode->Mode != -1) {
+        Status = GraphicsOutput->Blt (
+                            GraphicsOutput,
+                            &mGraphicsEfiColors[0],
+                            EfiBltVideoFill,
+                            0,
+                            0,
+                            0,
+                            0,
+                            ModeData->GopWidth,
+                            ModeData->GopHeight,
+                            0
+                            );
+      }
     }
   } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
     //
-- 
2.21.0.windows.1


  parent reply	other threads:[~2019-04-12  3:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12  3:14 [PATCH 0/2] MdeModulePkg: Make the screen seamless Gao, Zhichao
2019-04-12  3:14 ` [PATCH 1/2] MdeModulePkg/ConSplitterDxe: Optimize the ConSplitterTextOutSetMode Gao, Zhichao
2019-04-12  3:14 ` Gao, Zhichao [this message]
2019-04-12  8:06 ` [edk2-devel] [PATCH 0/2] MdeModulePkg: Make the screen seamless Laszlo Ersek
2019-04-13  7:52   ` Gao, Zhichao
2019-04-15 15:56     ` Laszlo Ersek
2019-04-16  1:46       ` Gao, Zhichao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190412031436.19088-3-zhichao.gao@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox