From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: hao.a.wu@intel.com) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by groups.io with SMTP; Sun, 26 May 2019 18:38:09 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 May 2019 18:38:08 -0700 X-ExtLoop1: 1 Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 26 May 2019 18:38:08 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 26 May 2019 18:38:07 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 26 May 2019 18:38:07 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.33]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.136]) with mapi id 14.03.0415.000; Mon, 27 May 2019 09:38:06 +0800 From: "Wu, Hao A" To: "Gao, Zhichao" , "devel@edk2.groups.io" CC: Aaron Antone , "Wang, Jian J" , "Ni, Ray" , "Zeng, Star" , "Gao, Liming" , Sean Brogan , Michael Turner , Bret Barkelew Subject: Re: [PATCH V4 1/2] MdeModulePkg/ConSplitterDxe: Optimize the ConSplitterTextOutSetMode Thread-Topic: [PATCH V4 1/2] MdeModulePkg/ConSplitterDxe: Optimize the ConSplitterTextOutSetMode Thread-Index: AQHVEdofHNj66X1l1EK7EsGRf8Lh76Z+NMow Date: Mon, 27 May 2019 01:38:05 +0000 Message-ID: References: <20190524024009.31600-1-zhichao.gao@intel.com> <20190524024009.31600-2-zhichao.gao@intel.com> In-Reply-To: <20190524024009.31600-2-zhichao.gao@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: hao.a.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Gao, Zhichao > Sent: Friday, May 24, 2019 10:40 AM > To: devel@edk2.groups.io > Cc: Aaron Antone; Wang, Jian J; Wu, Hao A; Ni, Ray; Zeng, Star; Gao, Limi= ng; > Sean Brogan; Michael Turner; Bret Barkelew > Subject: [PATCH V4 1/2] MdeModulePkg/ConSplitterDxe: Optimize the > ConSplitterTextOutSetMode >=20 > From: Aaron Antone >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1412 >=20 > 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. >=20 > 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(-) >=20 > 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 > console > 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 ConSplitterGrow= Buffer(). > @@ -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- > >CurrentNumberOfConsoles; Index++) { > - Status =3D Private->TextOutList[Index].TextOut->SetMode ( > - Private->TextOutList= [Index].TextOut, > - TextOutModeMap[Index= ] > - ); > - if (EFI_ERROR (Status)) { > - ReturnStatus =3D Status; > + // > + // While adding a console out device do not set same mode again for = the > same device. > + // > + if ((Private->AddingConOutDevice !=3D TRUE) || Just a minor comment. BOOLEAN type does not need to be explicitly compared with 'TRUE' or 'FALSE'= : if ((!Private->AddingConOutDevice) || With the above handled, Reviewed-by: Hao A Wu Best Regards, Hao Wu > + (TextOutModeMap[Index] !=3D Private->TextOutList[Index].TextOut- > >Mode->Mode)) { > + Status =3D Private->TextOutList[Index].TextOut->SetMode ( > + Private->TextOutLi= st[Index].TextOut, > + TextOutModeMap[Ind= ex] > + ); > + 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) \ > -- > 2.21.0.windows.1