From nobody Fri May 17 10:44:09 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+86843+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+86843+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1645501257; cv=none; d=zohomail.com; s=zohoarc; b=AEIgmzQppCoYijmK1YaduLS53x3Ry4yNv8lEC8g/xS9c31Iku+MASpS8ZTGLXSr4qyAE0TLRlFOF4vRAnydk5CCGiDY9pNS2/wNZSAnEiF9wBdySdmSNIyQIfpwNechHp/TU7rYRmFWrOLNUFv/Oxl1+5VNZLaPDe/3p0fmS/1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645501257; 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=yRaJVVkYM+PF3V4oUo5qgGFVTghsNQ4SZMnONsYO3Ms=; b=E3pj2wb4He45NyLJZ6ulaUBsyb+K/dpccA2cg9rV82RKrvokZgFsfD22Alx+4I97KHzsR+6sG5um5FXHn5f/F7eZ6cUGFjwyR4LmzqD6NPzi1qO3ETjEOxxJqm9HxXXzfLGskaZ/fL2J/TPMF6qVB9cFHw45MPzgkKAzFoqzmeU= 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+86843+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 1645501257288989.2454461967895; Mon, 21 Feb 2022 19:40:57 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id UsZDYY1788612xxiEfohzXLz; Mon, 21 Feb 2022 19:40:56 -0800 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web08.8618.1645501255304662045 for ; Mon, 21 Feb 2022 19:40:55 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10265"; a="312350669" X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="312350669" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 19:40:54 -0800 X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="547554712" X-Received: from guominji-mobl1.ccr.corp.intel.com ([10.238.15.53]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 19:40:51 -0800 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Jian J Wang , Liming Gao , Zhichao Gao , Ray Ni Subject: [edk2-devel] [PATCH 1/2] MdeModulePkg/GraphicsConsoleDxe: Check status to make sure no error Date: Tue, 22 Feb 2022 11:40:37 +0800 Message-Id: <20220222034038.966-2-guomin.jiang@intel.com> In-Reply-To: <20220222034038.966-1-guomin.jiang@intel.com> References: <20220222034038.966-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: QQBeEE9KjjwgAt6bkFpt9qR6x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1645501256; bh=PDbWaCIB3PVeu8Q2hGdGzWObFD65JPmqb6cb/XTv4z0=; h=Cc:Date:From:Reply-To:Subject:To; b=L5339INIq9s6r+JR3Ixm4rKJ/0bCx8F2lYyinadKyotpkHTGB7UxKEKIv4GsZdzQ5lo Nmv9qcNlFRXJP1Z1D+cAzuqM5UiI+asCnBA1LZUX1pR9xTbv4wpWDiddM2FGaVVTi1OIU CVN1o8MyvhW6MueheF+1tlqZ5UoLgZHtgMc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1645501258068100004 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 --- .../Console/GraphicsConsoleDxe/GraphicsConsole.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsCons= ole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c index 1bdd1b8a6732..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. @@ -531,17 +531,6 @@ GraphicsConsoleControllerDriverStart ( goto Error; } } - - // - // Double confirm SetMode can success - // - Status =3D 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 --=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 (#86843): https://edk2.groups.io/g/devel/message/86843 Mute This Topic: https://groups.io/mt/89310227/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 Fri May 17 10:44:09 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+86844+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+86844+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1645501257; cv=none; d=zohomail.com; s=zohoarc; b=NSNknjJeFgYhXTR+QgnUVt40b9FRR8+5w8qgkEVNTpTp6BS3Y7+7/lpTXOrImy+OM/BDF8PQI9QPdlP/cnxoraRD/v6R7LY2hB5xPBrK1+fFm/O379T7uo20LvFVd2unArOFZt7829TYTtePxqNuN1wZFkzlyM9Xe7gb+SKpS3U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645501257; 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=BSXblCQU8mxQoISXXQykp4IQLNgqGcwlFZwKb8SS3Qg=; b=ChClwSBrBiNJqGhs4YcQkPSBpPpl8zDkUnUENt0OcCwXA+gHusdYcqkf66UoZyAsEA0neRX8kDJwb54L/hpvbrf9Jt88pSsxqgmJE+UJF0DhBw7rEgXsrvUr0f+J3y4zQyfcMfp/fRYeLeB/YYnJkDPIQJ+6qhmwaxlDKGE0GLk= 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+86844+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 1645501257834518.4281930692608; Mon, 21 Feb 2022 19:40:57 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id UZuCYY1788612xWsFnrSCVgn; Mon, 21 Feb 2022 19:40:57 -0800 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web08.8618.1645501255304662045 for ; Mon, 21 Feb 2022 19:40:56 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10265"; a="312350670" X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="312350670" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 19:40:54 -0800 X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="547554722" X-Received: from guominji-mobl1.ccr.corp.intel.com ([10.238.15.53]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 19:40:53 -0800 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Andrew Fish , Ray Ni Subject: [edk2-devel] [PATCH 2/2] EmulatorPkg/EmuGopDxe: Set ModeInfo after Open successfully Date: Tue, 22 Feb 2022 11:40:38 +0800 Message-Id: <20220222034038.966-3-guomin.jiang@intel.com> In-Reply-To: <20220222034038.966-1-guomin.jiang@intel.com> References: <20220222034038.966-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: pUn7FZjehKwhw49cRpG4fKdnx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1645501257; bh=vvOghnuyKMvE40XED5PxZAJOUdNeaoQ6Y+Fh0nDxzyQ=; h=Cc:Date:From:Reply-To:Subject:To; b=h+9VTCShm8WkVD+A0KkKxofGfyZcxQ0EQOu23kG7K7cSgVLH1b48Q76othQ4k2+R4Jo O04duyJsfDImSdMlNXrwZV9QBQc9BlolBYDzxeO3vEyGFqp3RDavb8zqhjSIa+mqBdFgQ z5oWVqCSVlElah6+LAL7pefoSVXbbhh5EBQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1645501259913100010 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 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c b/EmulatorPkg/EmuGopDxe/GopS= creen.c index 41f748bc6402..ec5ef795d6e5 100644 --- a/EmulatorPkg/EmuGopDxe/GopScreen.c +++ b/EmulatorPkg/EmuGopDxe/GopScreen.c @@ -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 (#86844): https://edk2.groups.io/g/devel/message/86844 Mute This Topic: https://groups.io/mt/89310228/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-