From nobody Tue Apr 30 07:04:21 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+39981+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+39981+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1557022697; cv=none; d=zoho.com; s=zohoarc; b=Q2bXbAsifJ+aqIDhTSauDx/tWZKYmh+JJlzZMH6N+7hKXKmyLK6Hk6A9sTYPcuK3SjvoL6Iu8smRrSQYJidYPkYq+BfbH6Xza5d80qlkdnh4kRcfAqkq1YqvqfNP5OW14sCGUjdNkNxuA6f7OHxGynbX4KUB1h9dt4BreuUT2aQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557022697; 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=JGfWFMjAwrsWOyOd0o9lKuw6Vn6Ttzr14E5qOdg/drQ=; b=ntUnDG7vqA3gpTZ6VEC+NOR6+cEKYcfVx3K29o3+oIe8h0GvLuWtHyRMKVE4Io2tDDPl3e2yNPCIuLde+kTPbIbs7Yu0CYnDGYXLHSs6sYUclHQJNh7LZlEtCFcZNB+mNaI4nwQQDKaGwgJyxM/W0wt0fsOWD6xjbuFkNDtHdis= 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+39981+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 1557022697822167.27054031578427; Sat, 4 May 2019 19:18:17 -0700 (PDT) Return-Path: X-Received: from mga02.intel.com (mga02.intel.com []) by groups.io with SMTP; Sat, 04 May 2019 19:18:17 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 May 2019 19:18:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,431,1549958400"; d="scan'208";a="343690275" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga006.fm.intel.com with ESMTP; 04 May 2019 19:18:14 -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 V3 1/2] MdeModulePkg/ConSplitterDxe: Optimize the ConSplitterTextOutSetMode Date: Sun, 5 May 2019 10:17:36 +0800 Message-Id: <20190505021738.17060-2-zhichao.gao@intel.com> In-Reply-To: <20190505021738.17060-1-zhichao.gao@intel.com> References: <20190505021738.17060-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=1557022697; bh=RwsKu8UQo4/OmK2wCuv0CKUKEJBP/epsv6jDeg7vn40=; h=Cc:Date:From:Reply-To:Subject:To; b=b+cKcccsXNDJA5tkm/Hb7tCi+UzyN8k+5IqL2kUosP51AS8REaphvTiiVVq7aOjQNjF KSepJXKm7BK4rADCMkzxJTjuSOBUpm6EF6TDU77sX0iTcVhB9VXEFFG4MFe7X2wcWGVS8 dP++uJypyyTRmM9Gk5yFKE05rNZ5O9NVF1c= 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 --- .../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 (#39981): https://edk2.groups.io/g/devel/message/39981 Mute This Topic: https://groups.io/mt/31505826/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 Apr 30 07:04:21 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+39982+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+39982+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1557022699; cv=none; d=zoho.com; s=zohoarc; b=XAkDwytnJae+U3NN5kiKHBvMNtVVa7JPJWWbns3Z+d9B6cgZ5Ch3teWwq/DI1tt7sDSkPNBHVUqA4QvOXn0xAnQK5IJjcuPdeucU6uj+2eWhuetT5puswQCLp4ARasPsLjhz4cLxcY1ByhClTXxDMV4jAg/ai3yyRMhVFSBLM/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557022699; 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=Nv2o1L/pzQ8xzx/9ZIKV2H+IZfoBjc0bCNyZBT8UXDI=; b=fI+lj/Fdr1Q7Mv4KjY4z0yfcHGaCd4/soFn57X2u2yFsDWCd9LS1xObwjPhpMvaGViwicfc8udVbQTORSrycVQEDBrDFCDNEv4394LKkRIQP0e5pqxKrXFDohyhDYjrGWDYy+bnRJOtbHVGHXRMkQBJvTkqrx+H2LwBQHUZgVwg= 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+39982+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 155702269974689.26266507104197; Sat, 4 May 2019 19:18:19 -0700 (PDT) Return-Path: X-Received: from mga02.intel.com (mga02.intel.com []) by groups.io with SMTP; Sat, 04 May 2019 19:18:18 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 May 2019 19:18:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,431,1549958400"; d="scan'208";a="343690280" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga006.fm.intel.com with ESMTP; 04 May 2019 19:18:16 -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 V3 2/2] MdeModulePkg/GraphicsConsoleDxe: Initialize the output mode Date: Sun, 5 May 2019 10:17:37 +0800 Message-Id: <20190505021738.17060-3-zhichao.gao@intel.com> In-Reply-To: <20190505021738.17060-1-zhichao.gao@intel.com> References: <20190505021738.17060-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=1557022699; bh=7xw7X4AK2GqsC1RF3a7uNOjO86QVdsiPmwa1pc9ECUw=; h=Cc:Date:From:Reply-To:Subject:To; b=mpkEYFzpI8qVKYSbt8hnVG/EcuJKvKBtbOMJz7AYnXsmO0bMuwaP1G/XhFXGYCW3PgN hJr501ySlcLLS8bzHm66lRm+ZZkg9bArwtwvGiskTQF/OFfYRE5CEQjRRxG8dwiR8XZM7 O3YCH+K2WrN9Vx7zrplQucis1ziN00MvINo= 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. But there would be no clear screen operation while reconnect the graphics device. Instead, clear the screen when stop the graphics console 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 --- .../GraphicsConsoleDxe/GraphicsConsole.c | 44 ++++++++++++++----- .../GraphicsConsoleDxe/GraphicsConsoleDxe.inf | 2 + 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsCons= ole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c index 26ea19f300..42386de3f5 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; + UINTN PreferMode; + UINTN 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 0; + DefaultColumn =3D PcdGet32 (PcdConOutColumn); + DefaultRow =3D PcdGet32 (PcdConOutRow); + Column =3D 0; + Row =3D 0; + for (Index =3D 0; Index < MaxMode; Index++) { + if (DefaultColumn !=3D 0 && DefaultRow !=3D 0) { + if ((Private->ModeData[Index].Columns =3D=3D Column) && + (Private->ModeData[Index].Rows =3D=3D Row)) { + 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: %x\n\r", PreferMode= )); =20 // // Install protocol interfaces for the Graphics Console device. @@ -669,6 +691,8 @@ GraphicsConsoleControllerDriverStop ( return EFI_NOT_STARTED; } =20 + SimpleTextOutput->ClearScreen (SimpleTextOutput); + Private =3D GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (SimpleTextOutput); =20 Status =3D gBS->UninstallProtocolInterface ( 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 (#39982): https://edk2.groups.io/g/devel/message/39982 Mute This Topic: https://groups.io/mt/31505827/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-