From nobody Sat Apr 27 14:23:10 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+41298+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+41298+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1558665658; cv=none; d=zoho.com; s=zohoarc; b=SZ10jTvlzJQS2VOlviEl55D6tNHugdq6+Lt+VBZbUKmFOQPD/5hHiqAtAXCIHq5J+il6iHloAPNj4C63aHAPZtPa5HKkVjkVMt1DqzESlcUdi2dXr6XtDoDFOS0cjkJc4YJFYqYOhScrEOV+86hAPNw6BZH+GGZf3HO3+T3IU7w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558665658; 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=yLOpBKsh8tdVyoJ5fgUFu8K7gI6GO8TxbBqg5FFCIcU=; b=S/BT2SFXn5fAm47dNvXglqUrxE/mcQyXtmfStUYBPqSDTtyIcI914dnNf0uc6krC+/eomVFbtIF4gIb6x4BDkshI9ft2BDBxHuvzgVl6B79Vpjdyc0idseaJfcN7XIjycg8+Gt1TpEUSwhT0Pg0elg3W8plEQoe5yJwuPOYqhD4= 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+41298+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 1558665658100685.6415624620589; Thu, 23 May 2019 19:40:58 -0700 (PDT) Return-Path: X-Received: from mga06.intel.com (mga06.intel.com []) by groups.io with SMTP; Thu, 23 May 2019 19:40:51 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 May 2019 19:40:51 -0700 X-ExtLoop1: 1 X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 23 May 2019 19:40:49 -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 Subject: [edk2-devel] [PATCH V4 1/2] MdeModulePkg/ConSplitterDxe: Optimize the ConSplitterTextOutSetMode Date: Fri, 24 May 2019 10:40:08 +0800 Message-Id: <20190524024009.31600-2-zhichao.gao@intel.com> In-Reply-To: <20190524024009.31600-1-zhichao.gao@intel.com> References: <20190524024009.31600-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=1558665652; bh=qU+8ZccrCPkotkgNGk3wYuJatmRbnSrTnafKTenyKSg=; h=Cc:Date:From:Reply-To:Subject:To; b=OWoPsGR+NB4SKoJqgpydEU8nSJr+xwDjEvzpgAm4DmopDHfMKTgJ//vW3v7LApEtOuk l+KedEYIZPn5WpHQ0YTosDZRZYkDkVQTnnwNpGwWADYKARcl7PQzp4D6O606BPIvV292D OxYJ+STd4cTblW/RMSkjhs+nYjE0khdP/Ng= 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 Signed-off-by: Zhichao Gao Reviewed-by: Hao A Wu --- .../Console/ConSplitterDxe/ConSplitter.c | 33 ++++++++++++------- .../Console/ConSplitterDxe/ConSplitter.h | 4 ++- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/= MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c index 6fc0e4796f..5de022b02a 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,18 @@ 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->M= ode->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 (#41298): https://edk2.groups.io/g/devel/message/41298 Mute This Topic: https://groups.io/mt/31738400/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 Sat Apr 27 14:23:10 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+41299+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+41299+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1558665658; cv=none; d=zoho.com; s=zohoarc; b=LqXq6m6H5NZq0o28l7j+iMUmi1h9BADod5BbQHLspxSGBMINRd3pdiY32anPGukBr7TwwJXsMhjSQYBkQWmHnAjy1Lo6OdYIC26+fTqqFUoYYfYkUoYsXFdl5hqPi3ThrXeQc3rfeIDKjEHpVQoWpr6E4kfTh4I9A/t7wwfYlvI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558665658; 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=BUBHlXrdChCcHxjlPiKEK5/BcmXFXIu3YcD67IjnTJc=; b=kpZ26NC5u+buFCGkGX1/rG2j8fRErhhWSD2kh7V5904l7LLgGARbLLBUOWZ9jWeNBDM1YrQRXvvEziZ21xrN7fm3gK4E2sho3kWbyFJg/+USYFp4YWxpsoD0lXqr7cnFH/4T98PyjsTebjVl/52SSt2TISa6lhbmaF6k11edww8= 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+41299+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 1558665658096721.3391604809132; Thu, 23 May 2019 19:40:58 -0700 (PDT) Return-Path: X-Received: from mga06.intel.com (mga06.intel.com []) by groups.io with SMTP; Thu, 23 May 2019 19:40:54 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 May 2019 19:40:54 -0700 X-ExtLoop1: 1 X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 23 May 2019 19:40:51 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jian J Wang , Hao Wu , Ray Ni , Star Zeng , Liming Gao , Sean Brogan , Michael Turner , Bret Barkelew , Laszlo Ersek Subject: [edk2-devel] [PATCH V4 2/2] MdeModulePkg/GraphicsConsoleDxe: Initialize the output mode Date: Fri, 24 May 2019 10:40:09 +0800 Message-Id: <20190524024009.31600-3-zhichao.gao@intel.com> In-Reply-To: <20190524024009.31600-1-zhichao.gao@intel.com> References: <20190524024009.31600-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=1558665654; bh=ntKS0jaPkTTs4pjwh5bkpHdCypiHGaeCdiEJDpJDyEc=; h=Cc:Date:From:Reply-To:Subject:To; b=nR87/s7iRdprJyodUUWc5VNDZm6QQz4uQLrTQv/1G7R0tnUPdakfGC7HOhX51xU6TFY vsCCV0kO7X29oS1lF2YP3wpfcyGwaE3I8a69pRBzQrNVtz4JmmTmxqkx/SDFNHD7zFBW8 l2cqtMnpv6SIT9+b/bS7cUhG+yhWd+azgB0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1412 Original logic: Connect the graphics device -> connect it as graphics consoles and initialize its parameters(Mode =3D -1, invalid) -> connect it as console spliter and add the device to the list(use SetMode to set mode to the user defined mode or the best mode the devices supported if the mode is invalid. *clear the screen at this phase*) Changed logic: Connect the graphics device -> connect it as graphics consoles and initialize its parameters(initialize the mode to the user defined mode or the best mode. *directly set the mode value without using SetMode, that would not clear the screen) -> connect it as console spliter and add the device to the list(use SetMode to set mode to the user defined mode or the best mode the devices supported if the mode is invalid. *now the mode is already set, so it would not clear the screen*). Also remove the section of SetMode for debug version. Impact: as the text mode may not be an invalid value, the SetMode may have no chance to be called during reconnect the graphics device. That means the screen may not be cleaned after finishing reconnect operation. There is one common condition: shell command "recoonect -r". 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 Acked-by: Laszlo Ersek Reviewed-by: Hao A Wu --- .../GraphicsConsoleDxe/GraphicsConsole.c | 42 ++++++++++++++----- .../GraphicsConsoleDxe/GraphicsConsoleDxe.inf | 2 + 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsCons= ole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c index 26ea19f300..c042451a9b 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 **/ @@ -384,6 +384,12 @@ GraphicsConsoleControllerDriverStart ( EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode; UINTN SizeOfInfo; EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info; + INT32 PreferMode; + INT32 Index; + UINTN Column; + UINTN Row; + UINTN DefaultColumn; + UINTN DefaultRow; =20 ModeNumber =3D 0; =20 @@ -567,16 +573,32 @@ 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; + // + // Initialize the Mode of graphics console devices + // + PreferMode =3D -1; + DefaultColumn =3D PcdGet32 (PcdConOutColumn); + DefaultRow =3D PcdGet32 (PcdConOutRow); + Column =3D 0; + Row =3D 0; + for (Index =3D 0; Index < (INT32)MaxMode; Index++) { + if (DefaultColumn !=3D 0 && DefaultRow !=3D 0) { + if ((Private->ModeData[Index].Columns =3D=3D DefaultColumn) && + (Private->ModeData[Index].Rows =3D=3D DefaultRow)) { + PreferMode =3D Index; + break; + } + } else { + if ((Private->ModeData[Index].Columns > Column) && + (Private->ModeData[Index].Rows > Row)) { + Column =3D Private->ModeData[Index].Columns; + Row =3D Private->ModeData[Index].Rows; + PreferMode =3D Index; + } } - DEBUG_CODE_END (); + } + Private->SimpleTextOutput.Mode->Mode =3D (INT32)PreferMode; + DEBUG ((DEBUG_INFO, "Graphics Console Started, Mode: %d\n", PreferMode)); =20 // // Install protocol interfaces for the Graphics Console device. diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsCons= oleDxe.inf b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsCons= oleDxe.inf index f7caa65aa9..bcfd306eee 100644 --- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.= inf +++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.= inf @@ -65,6 +65,8 @@ [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution ## SOMETIMES= _CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution ## SOMETIMES= _CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow ## SOMETIMES= _CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn ## SOMETIMES= _CONSUMES =20 [UserExtensions.TianoCore."ExtraFiles"] GraphicsConsoleDxeExtra.uni --=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 (#41299): https://edk2.groups.io/g/devel/message/41299 Mute This Topic: https://groups.io/mt/31738401/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-