From nobody Sun May 19 01:15:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+87139+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87139+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1646126389; cv=none; d=zohomail.com; s=zohoarc; b=esE7Jn3ZSF+UqAM9msm8ICEVUD8z7eTQfQNHaFGDhOwGsy67GieqKjhTza1JYM8/Hk4cAFpK6bl/PKIEvMX3y8XB5P4pQLcgseR9nhjLHV1wpaGZVp6NNknv+CxAeW9nN4t1VJw1pP+HE5GwtjNnne/AhFmUF2Aswsg+CvnUILA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646126389; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=v92P3xbXrM5l79yLM0JTZsFA0G6Y0f5H7VSaYWc7hLM=; b=hTSjC/94SqeFyxojAPEMfKEE4MwUWzg/TXDNlOxr+b+f/qwi9R5HgnbTSq0UqAoK5uJs4Gmcni9ieCY3BlWI7+FhdVY0ILLqBh+YVZwuOmQwwjEiFDKX1PMMGdZxbC7mSywZoABz0RrZGCgel0v0t9D8Z440KL/2C6WLrVQswGw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87139+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1646126389371654.5664128091406; Tue, 1 Mar 2022 01:19:49 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id yRZ5YY1788612xvQ8bCVOzNM; Tue, 01 Mar 2022 01:19:49 -0800 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.6266.1646126386729812009 for ; Tue, 01 Mar 2022 01:19:48 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10272"; a="253286519" X-IronPort-AV: E=Sophos;i="5.90,145,1643702400"; d="scan'208";a="253286519" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 01:19:48 -0800 X-IronPort-AV: E=Sophos;i="5.90,145,1643702400"; d="scan'208";a="708986771" X-Received: from guominji-mobl1.ccr.corp.intel.com ([10.238.15.53]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 01:19:46 -0800 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Jian J Wang , Liming Gao , Zhichao Gao , Ray Ni Subject: [edk2-devel] [PATCH v2 1/2] MdeModulePkg/GraphicsConsoleDxe: Check status to make sure no error Date: Tue, 1 Mar 2022 17:18:49 +0800 Message-Id: <20220301091850.828-2-guomin.jiang@intel.com> In-Reply-To: <20220301091850.828-1-guomin.jiang@intel.com> References: <20220301091850.828-1-guomin.jiang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,guomin.jiang@intel.com X-Gm-Message-State: D6jL2ufwGMvS6HvyUPvcSRayx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1646126389; bh=6FOAMn4qt3oe04h7MWI3/gBSRGDyM2WTvBF8ws2ouLg=; h=Cc:Date:From:Reply-To:Subject:To; b=STPu4dcYWjxAaoY6DNZN4mwluqoFPLNTXdAJ6W+V1h9Sczl2Of9mnyUd6Olil1JxLau dfhabivR2tpquXOZBDeCo8bnrNRizxylpUcHs6GuntyrKHvjheLpcRzf4Mp8ADQc4i+In Wjyp7TDSs5qmgaLYeqgy7yUOr5hX5GiQxyU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1646126391477100001 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2668 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 Cc: Liming Gao Cc: Zhichao Gao Cc: Ray Ni Signed-off-by: Guomin Jiang Reviewed-by: Ray Ni --- .../Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsCons= ole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c index 8f0cba9fcde9..07436cbd15bf 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 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -518,7 +518,7 @@ GraphicsConsoleControllerDriverStart ( } } =20 - if (ModeNumber !=3D Private->GraphicsOutput->Mode->Mode) { + if (EFI_ERROR (Status) || (ModeNumber !=3D Private->GraphicsOutput->Mo= de->Mode)) { // // Current graphics mode is not set or is not set to the mode which = we have found, // set the new graphic mode. --=20 2.35.1.windows.2 -=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 (#87139): https://edk2.groups.io/g/devel/message/87139 Mute This Topic: https://groups.io/mt/89472123/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 Sun May 19 01:15:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+87140+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87140+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1646126391; cv=none; d=zohomail.com; s=zohoarc; b=M/4RTlaCN36pP7uDmUwQ5tVZR0SAgqEqgGKlwCYayORcwPPKBAOyceIhl0nP3bcDOjEABQJj/AB6Pst3pgM+kLUJGFvljRapG6vTkt6R4RAoOnsCzkV0zRFd/B8b8rISxym+qEignH7N9JlaSS5UorN9kFynqe/bwjmHKyO/e1o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646126391; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=BykFZKsa3cdh8hHa6LeoyFwRfeiC20KwabP30Eg6hZo=; b=m9CecY5lV5SVqAk+KdAP/4GBaJ7etJsdhjb+NxnkYJ8eHCq5xsd4xXvpO0OBRnIsTMSjp2iku1Ry7EAywU+RhI1EcbwLO538/570vcHtCiasQbyfJpTaE+AEbuVEYfIDbKQucXxsKFr5GizCgrAeIzfngzp41bAdYIZhRfCrmXo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87140+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1646126391282325.347464995343; Tue, 1 Mar 2022 01:19:51 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id lg7fYY1788612xkF2OBlTpyO; Tue, 01 Mar 2022 01:19:50 -0800 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.6266.1646126386729812009 for ; Tue, 01 Mar 2022 01:19:50 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10272"; a="253286536" X-IronPort-AV: E=Sophos;i="5.90,145,1643702400"; d="scan'208";a="253286536" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 01:19:49 -0800 X-IronPort-AV: E=Sophos;i="5.90,145,1643702400"; d="scan'208";a="708986784" X-Received: from guominji-mobl1.ccr.corp.intel.com ([10.238.15.53]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 01:19:48 -0800 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Andrew Fish , Ray Ni Subject: [edk2-devel] [PATCH v2 2/2] EmulatorPkg/EmuGopDxe: Set ModeInfo after Open successfully Date: Tue, 1 Mar 2022 17:18:50 +0800 Message-Id: <20220301091850.828-3-guomin.jiang@intel.com> In-Reply-To: <20220301091850.828-1-guomin.jiang@intel.com> References: <20220301091850.828-1-guomin.jiang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,guomin.jiang@intel.com X-Gm-Message-State: kNObxTfLjpiAj7peBy4wFAIGx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1646126390; bh=BlTc3HrHN1c8+gi1IqYl7px6sv0pA5P1JG815S7y1SI=; h=Cc:Date:From:Reply-To:Subject:To; b=fsZfT8wxuRCC+urTLFYjimCXdej2G10lmzgTAdm2hh/gJQj4GOCj4DS+Wvc9RJ98yI2 WwBRWBTVRHswhlvmRBs7t/2/q93GunynPsR+vvlOwkRvEwfclHufc2nJ7Yv37K+QqBBCw qMFXj8gYXp6czhbYgEvQEi1ZHNgM6RgrJAE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1646126393394100006 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2668 WindowOpen will fail in some case. for example, without XServer. Shouldn't set ModeInfo in this case to avoid the caller use it incorrectly Cc: Andrew Fish Cc: Ray Ni Signed-off-by: Guomin Jiang Reviewed-by: Ray Ni --- EmulatorPkg/EmuGopDxe/GopScreen.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c b/EmulatorPkg/EmuGopDxe/GopS= creen.c index 41f748bc6402..9249eca1dd03 100644 --- a/EmulatorPkg/EmuGopDxe/GopScreen.c +++ b/EmulatorPkg/EmuGopDxe/GopScreen.c @@ -1,6 +1,6 @@ /*++ @file =20 -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -108,10 +108,6 @@ EmuGopSetMode ( } =20 ModeData =3D &Private->M= odeData[ModeNumber]; - This->Mode->Mode =3D ModeNumber; - Private->GraphicsOutput.Mode->Info->HorizontalResolution =3D ModeData->H= orizontalResolution; - Private->GraphicsOutput.Mode->Info->VerticalResolution =3D ModeData->V= erticalResolution; - Private->GraphicsOutput.Mode->Info->PixelsPerScanLine =3D ModeData->H= orizontalResolution; =20 if (Private->HardwareNeedsStarting) { Status =3D EmuGopStartWindow ( @@ -128,6 +124,11 @@ EmuGopSetMode ( Private->HardwareNeedsStarting =3D FALSE; } =20 + This->Mode->Mode =3D ModeNumber; + Private->GraphicsOutput.Mode->Info->HorizontalResolution =3D ModeData->H= orizontalResolution; + Private->GraphicsOutput.Mode->Info->VerticalResolution =3D ModeData->V= erticalResolution; + Private->GraphicsOutput.Mode->Info->PixelsPerScanLine =3D ModeData->H= orizontalResolution; + Status =3D Private->EmuGraphicsWindow->Size ( Private->EmuGraphicsWindow, ModeData->HorizontalResolution, --=20 2.35.1.windows.2 -=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 (#87140): https://edk2.groups.io/g/devel/message/87140 Mute This Topic: https://groups.io/mt/89472124/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-