public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Guomin Jiang" <guomin.jiang@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Wang, Jian J" <jian.j.wang@intel.com>,
	"Gao, Liming" <gaoliming@byosoft.com.cn>,
	"Gao, Zhichao" <zhichao.gao@intel.com>,
	"Ni, Ray" <ray.ni@intel.com>
Subject: Re: [edk2-devel] [PATCH 1/2] MdeModulePkg/GraphicsConsoleDxe: Check status to make sure no error
Date: Thu, 24 Feb 2022 00:56:29 +0000	[thread overview]
Message-ID: <BN0PR11MB56962E8FA0DA539902D7282F9D3D9@BN0PR11MB5696.namprd11.prod.outlook.com> (raw)
In-Reply-To: <16D5FEAC9A733E6B.24964@groups.io>

Hi Liming, Jian, Zhichao, Ray,

Can you help review it?

Thanks
Guomin

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Guomin
> Jiang
> Sent: Tuesday, February 22, 2022 11:41 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Gao, Zhichao <zhichao.gao@intel.com>; Ni,
> Ray <ray.ni@intel.com>
> Subject: [edk2-devel] [PATCH 1/2] MdeModulePkg/GraphicsConsoleDxe:
> Check status to make sure no error
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2668
> 
> SetMode will fail in some case. for example, without XServer.
> Should handle these case when SetMode fail.
> 
> If we don't handle it, it will Segmentation fault.
> 
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> ---
>  .../Console/GraphicsConsoleDxe/GraphicsConsole.c  | 15 ++-------------
>  1 file changed, 2 insertions(+), 13 deletions(-)
> 
> diff --git
> a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole
> .c
> b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsol
> e.c
> index 1bdd1b8a6732..07436cbd15bf 100644
> ---
> a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole
> .c
> +++
> b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsol
> e.c
> @@ -1,7 +1,7 @@
>  /** @file
>    This is the main routine for initializing the Graphics Console support routines.
> 
> -Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -518,7 +518,7 @@ GraphicsConsoleControllerDriverStart (
>        }
>      }
> 
> -    if (ModeNumber != Private->GraphicsOutput->Mode->Mode) {
> +    if (EFI_ERROR (Status) || (ModeNumber != Private->GraphicsOutput-
> >Mode->Mode)) {
>        //
>        // Current graphics mode is not set or is not set to the mode which we
> have found,
>        // set the new graphic mode.
> @@ -531,17 +531,6 @@ GraphicsConsoleControllerDriverStart (
>          goto Error;
>        }
>      }
> -
> -    //
> -    // Double confirm SetMode can success
> -    //
> -    Status = Private->GraphicsOutput->SetMode (Private->GraphicsOutput,
> ModeNumber);
> -    if (EFI_ERROR (Status)) {
> -      //
> -      // The mode set operation failed
> -      //
> -      goto Error;
> -    }
>    } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
>      //
>      // At first try to set user-defined resolution
> --
> 2.35.1.windows.2
> 
> 
> 
> 
> 


      parent reply	other threads:[~2022-02-24  0:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22  3:40 [PATCH 0/2] Avoid Emulator Segmentation fault Guomin Jiang
2022-02-22  3:40 ` [PATCH 1/2] MdeModulePkg/GraphicsConsoleDxe: Check status to make sure no error Guomin Jiang
2022-02-22  3:40 ` [PATCH 2/2] EmulatorPkg/EmuGopDxe: Set ModeInfo after Open successfully Guomin Jiang
2022-03-01  7:16   ` Ni, Ray
     [not found] ` <16D5FEACC0A8B3B7.28921@groups.io>
2022-02-24  0:55   ` [edk2-devel] " Guomin Jiang
     [not found] ` <16D5FEAC9A733E6B.24964@groups.io>
2022-02-24  0:56   ` Guomin Jiang [this message]

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=BN0PR11MB56962E8FA0DA539902D7282F9D3D9@BN0PR11MB5696.namprd11.prod.outlook.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