From nobody Tue May 7 16:48:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+39399+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39399+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1556003097; cv=none; d=zoho.com; s=zohoarc; b=Z9uk7s8JKNYq7iipW3ii9srmEUGykYS3yo+6bAwBi6fsaQ3rC9Sr0MesHJNA0tVhgdJfybuaqBjXcGiwbXVtrC7l7iMSoam6Sa28kKzTt0Ku+YUN3oEu/DkeENDoa9UsSvLUxZAcSugIkogNdaHv0MNI3JUHmBO9Golab3CVIok= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556003097; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=n219bWIbfqWXDkB5vzBUpA7pb4/ps0i7srKBG1+rbTo=; b=J0/edMabHogS5OjHWoJCLnHxf6QzcnIjHseljqerqPg9NwQjPP31mXwgaZB1Yn81plRFwdq2S3U1WBJR7hazGFGiLhCvMLWm2bp242Y4WNU9QzX1dpj+Ukk9ayr1WbjoyuJnyKoKeQPpD58CkcW47dE3kWWQTNAiwX4iZ7R/Ra0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39399+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1556003097178937.9346897674639; Tue, 23 Apr 2019 00:04:57 -0700 (PDT) Return-Path: X-Received: from mga14.intel.com (mga14.intel.com []) by groups.io with SMTP; Tue, 23 Apr 2019 00:04:56 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2019 00:04:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,384,1549958400"; d="scan'208";a="145043922" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga007.fm.intel.com with ESMTP; 23 Apr 2019 00:04:54 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Aaron Antone , Jian J Wang , Hao Wu , Ray Ni , Star Zeng , Liming Gao , Sean Brogan , Michael Turner , Bret Barkelew , Laszlo Ersek Subject: [edk2-devel] [PATCH V2 1/2] MdeModulePkg/ConSplitterDxe: Optimize the ConSplitterTextOutSetMode Date: Tue, 23 Apr 2019 15:04:49 +0800 Message-Id: <20190423070450.1892-2-zhichao.gao@intel.com> In-Reply-To: <20190423070450.1892-1-zhichao.gao@intel.com> References: <20190423070450.1892-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1556003096; bh=p9skdUQBBja/CRUz+EqW7MilmB8f9UkCDcImifNIzMw=; h=Cc:Date:From:Reply-To:Subject:To; b=v4AYVdio9nWoyBPrjkIGKu+dKJEt4NVBexhc/T0Amd4ZiQylDg8Milk4DMPCRUPITGq BwN0mUHkmFMIT2T7Hp3Zxb9bbNb+sHGv7WZrH7wy/+wpCXFS4qO26+u19TMAsTZiH8UTd 3uZhjhZVagiwSbgixcRZP+s+GC3EmWhJcd4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Aaron Antone REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1412 For Console Out device, it would always set all present devices' text out mode again through ConSplitterTextOutSetMode while adding devices. That may cause the screen cleared for serval times. So add a BOOLEAN to judge if it is adding device then we will not set the same text mode again for same console out device. Cc: Jian J Wang Cc: Hao Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming Gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Cc: Laszlo Ersek Signed-off-by: Zhichao Gao --- .../Console/ConSplitterDxe/ConSplitter.c | 34 +++++++++++++------ .../Console/ConSplitterDxe/ConSplitter.h | 4 ++- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/= MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c index 6fc0e4796f..fc9b9e08e5 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c @@ -16,7 +16,7 @@ never removed. Such design ensures sytem function well during none conso= le device situation. =20 -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -180,7 +180,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_OUT_SPLITTER_PRIVATE= _DATA mConOut =3D { 0, (TEXT_OUT_SPLITTER_QUERY_DATA *) NULL, 0, - (INT32 *) NULL + (INT32 *) NULL, + FALSE }; =20 // @@ -235,7 +236,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_OUT_SPLITTER_PRIVATE= _DATA mStdErr =3D { 0, (TEXT_OUT_SPLITTER_QUERY_DATA *) NULL, 0, - (INT32 *) NULL + (INT32 *) NULL, + FALSE }; =20 // @@ -3132,8 +3134,9 @@ ConSplitterTextOutAddDevice ( EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info; EFI_STATUS DeviceStatus; =20 - Status =3D EFI_SUCCESS; - CurrentNumOfConsoles =3D Private->CurrentNumberOfConsoles; + Status =3D EFI_SUCCESS; + CurrentNumOfConsoles =3D Private->CurrentNumberOfConsoles; + Private->AddingConOutDevice =3D TRUE; =20 // // If the Text Out List is full, enlarge it by calling ConSplitterGrowBu= ffer(). @@ -3290,6 +3293,8 @@ ConSplitterTextOutAddDevice ( // ConsplitterSetConsoleOutMode (Private); =20 + Private->AddingConOutDevice =3D FALSE; + return Status; } =20 @@ -4849,12 +4854,19 @@ ConSplitterTextOutSetMode ( // TextOutModeMap =3D Private->TextOutModeMap + Private->TextOutListCount *= ModeNumber; for (Index =3D 0, ReturnStatus =3D EFI_SUCCESS; Index < Private->Current= NumberOfConsoles; Index++) { - Status =3D Private->TextOutList[Index].TextOut->SetMode ( - Private->TextOutList[I= ndex].TextOut, - TextOutModeMap[Index] - ); - if (EFI_ERROR (Status)) { - ReturnStatus =3D Status; + // + // While adding a console out device do not set same mode again for th= e same device. + // + if (Private->AddingConOutDevice !=3D TRUE || + TextOutModeMap[Index] !=3D Private->TextOutList[Index].TextOut->Mode= ->Mode) { + + Status =3D Private->TextOutList[Index].TextOut->SetMode ( + Private->TextOutList= [Index].TextOut, + TextOutModeMap[Index] + ); + if (EFI_ERROR (Status)) { + ReturnStatus =3D Status; + } } } =20 diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h b/= MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h index e9b68e58c6..419635c3f5 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h @@ -1,7 +1,7 @@ /** @file Private data structures for the Console Splitter driver =20 -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -218,6 +218,8 @@ typedef struct { UINTN TextOutQueryDataCount; INT32 *TextOutModeMap; =20 + BOOLEAN AddingConOutDevice; + } TEXT_OUT_SPLITTER_PRIVATE_DATA; =20 #define TEXT_OUT_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \ --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#39399): https://edk2.groups.io/g/devel/message/39399 Mute This Topic: https://groups.io/mt/31306534/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 7 16:48:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+39400+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39400+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1556003099; cv=none; d=zoho.com; s=zohoarc; b=hlNos4kASx0OfONXWUSGhacLV16y1uIyJTzmHwRQ+d80voWFHfSe9U84JAlAS/htdWtttZ6BiuFs+WQ+/5N79O7JeGXlti6Pmf9YHYxmCv0QR1Zxyjkppi8ZdWDOCuE2wBQ+/sO01Bk0odI59SkQPyHbQBmWJga420KEn7PfbcU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556003099; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=Yaj8oLuiSuZcf4bzI9TdFS48Ilcnn1rInoiMFCAvpac=; b=LFUijO2E4CpNWvcVae4A4jY1Y4CVo1RTlmPDeEs3zqezNZyzmj6oREQggswLkF7h4017raF+X3/cnq765wuOWjBO3T5SGFlTgqk1IMKpjjHCVZvN352Tp5DFdDJ/q3E75Yk58xpRq3OB3solGccq6oTFLzvMmpZGh7Ei6zqnCyI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39400+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1556003099401883.8797415013099; Tue, 23 Apr 2019 00:04:59 -0700 (PDT) Return-Path: X-Received: from mga14.intel.com (mga14.intel.com []) by groups.io with SMTP; Tue, 23 Apr 2019 00:04:58 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2019 00:04:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,384,1549958400"; d="scan'208";a="145043941" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga007.fm.intel.com with ESMTP; 23 Apr 2019 00:04:56 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Aaron Antone , Jian J Wang , Hao Wu , Ray Ni , Star Zeng , Liming Gao , Sean Brogan , Michael Turner , Bret Barkelew , Laszlo Ersek Subject: [edk2-devel] [PATCH V2 2/2] MdeModulePkg/GraphicsConsoleDxe: Do not clean the screen Date: Tue, 23 Apr 2019 15:04:50 +0800 Message-Id: <20190423070450.1892-3-zhichao.gao@intel.com> In-Reply-To: <20190423070450.1892-1-zhichao.gao@intel.com> References: <20190423070450.1892-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1556003098; bh=dTVa0lC9GADC4TSu6lr+mEOuK6tEdIP7pnklk4DZLQc=; h=Cc:Date:From:Reply-To:Subject:To; b=qI2B2RrVwZzOueN1bvIiib1fHYKq6djZiUM6hvjcNtNEcdgaS4TqomovXY04qGDywD8 +H+IUZnwtO3zZk2nO2xQ02SaewKmp4BBwYk4giaBUePn+5DR4Rxxw4QGSgdnV4ns7vWsd FzXRRs1/S865zikgNCIOegpKKUp5NzwFCdM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Aaron Antone REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1412 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 for the first time boot. As the shell reconnect command would make the same reslut with the first boot, use the gEfiEventReadyToBootGuid to distinguish them. 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. This patch only affect the behavior of SetMode at the first boot during the graphics console devices first connect operations. That means at DXE phase before ReadyToBoot, the Graphics Simple Text Out SetMode would not clear the screen during the first connecttion of the graphics devices. Cc: Jian J Wang Cc: Hao Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming Gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Cc: Laszlo Ersek Signed-off-by: Zhichao Gao --- .../GraphicsConsoleDxe/GraphicsConsole.c | 82 +++++++++++++------ .../GraphicsConsoleDxe/GraphicsConsoleDxe.inf | 3 + 2 files changed, 62 insertions(+), 23 deletions(-) diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsCons= ole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c index 26ea19f300..39a999838c 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 r= outines. =20 -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -96,6 +96,12 @@ EFI_DRIVER_BINDING_PROTOCOL gGraphicsConsoleDriverBindin= g =3D { NULL }; =20 +// +// Event and variable to indicate the boot phase. +// +EFI_EVENT mGraphicsConsoleReadyToBootEvent; +BOOLEAN mGraphicsConsoleReadyToBoot =3D FALSE; + /** Test to see if Graphics Console could be supported on the Controller. =20 @@ -567,16 +573,7 @@ GraphicsConsoleControllerDriverStart ( // Private->SimpleTextOutputMode.MaxMode =3D (INT32) MaxMode; =20 - DEBUG_CODE_BEGIN (); - Status =3D GraphicsConsoleConOutSetMode (&Private->SimpleTextOutput, 0= ); - if (EFI_ERROR (Status)) { - goto Error; - } - Status =3D GraphicsConsoleConOutOutputString (&Private->SimpleTextOutp= ut, (CHAR16 *)L"Graphics Console Started\n\r"); - if (EFI_ERROR (Status)) { - goto Error; - } - DEBUG_CODE_END (); + DEBUG ((DEBUG_INFO, "Graphics Console Started!\n\r")); =20 // // Install protocol interfaces for the Graphics Console device. @@ -1366,18 +1363,26 @@ GraphicsConsoleConOutSetMode ( // // The current graphics mode is correct, so simply clear the entire = display // - Status =3D GraphicsOutput->Blt ( - GraphicsOutput, - &mGraphicsEfiColors[0], - EfiBltVideoFill, - 0, - 0, - 0, - 0, - ModeData->GopWidth, - ModeData->GopHeight, - 0 - ); + // + // For the first time boot system, do not clear the display. + // Some platforms would show logo at PEIM and this would clear + // the whole screen. So for first boot set mode, do not clear + // the screen. + // + if (This->Mode->Mode !=3D -1 || mGraphicsConsoleReadyToBoot) { + Status =3D GraphicsOutput->Blt ( + GraphicsOutput, + &mGraphicsEfiColors[0], + EfiBltVideoFill, + 0, + 0, + 0, + 0, + ModeData->GopWidth, + ModeData->GopHeight, + 0 + ); + } } } else if (FeaturePcdGet (PcdUgaConsumeSupport)) { // @@ -2065,6 +2070,24 @@ RegisterFontPackage ( FreePool (Package); } =20 +/** + Indicate the Boot phase is at ReadyToBoot. + + @param[in] Event The Event that is being processed. + @param[in] Context The Event Context. + +**/ +VOID +GraphicsConsoleReadyToBootEvent ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + mGraphicsConsoleReadyToBoot =3D TRUE; + + gBS->CloseEvent (mGraphicsConsoleReadyToBootEvent); +} + /** The user Entry Point for module GraphicsConsole. The user code starts wi= th this function. =20 @@ -2095,6 +2118,19 @@ InitializeGraphicsConsole ( &mHiiRegistration ); =20 + // + // Create a event function of ReadyToBoot to avoid clearing screen befor= e boot + // + Status =3D gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_NOTIFY, + GraphicsConsoleReadyToBootEvent, + NULL, + &gEfiEventReadyToBootGuid, + &mGraphicsConsoleReadyToBootEvent + ); + ASSERT_EFI_ERROR (Status); + // // Install driver model protocol(s). // diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsCons= oleDxe.inf b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsCons= oleDxe.inf index f7caa65aa9..59751893f6 100644 --- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.= inf +++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.= inf @@ -49,6 +49,9 @@ HiiLib PcdLib =20 +[Guids] + gEfiEventReadyToBootGuid ## CONSUMES + [Protocols] gEfiDevicePathProtocolGuid ## TO_START gEfiSimpleTextOutProtocolGuid ## BY_START --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#39400): https://edk2.groups.io/g/devel/message/39400 Mute This Topic: https://groups.io/mt/31306535/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-