From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 64DEC224CCC08 for ; Tue, 13 Mar 2018 07:03:22 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Mar 2018 07:09:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,465,1515484800"; d="scan'208";a="38413539" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga001.jf.intel.com with ESMTP; 13 Mar 2018 07:09:43 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 13 Mar 2018 07:09:40 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 13 Mar 2018 07:09:40 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.226]) by shsmsx102.ccr.corp.intel.com ([169.254.2.80]) with mapi id 14.03.0319.002; Tue, 13 Mar 2018 22:09:37 +0800 From: "Ni, Ruiyu" To: Laszlo Ersek , "edk2-devel@lists.01.org" CC: "Justen, Jordan L" , Ard Biesheuvel Thread-Topic: [edk2] [PATCH] OvmfPkg/Gop: clear the screen to black in SetMode() Thread-Index: AQHTurL5xulvAxJM8Ue4GUEUr9LLwKPNnZQAgACWswA= Date: Tue, 13 Mar 2018 14:09:37 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BBF2DC1@SHSMSX104.ccr.corp.intel.com> References: <20180313100544.123552-1-ruiyu.ni@intel.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDdkNTc4M2EtOGI0Yy00OTJkLThlOGEtOGY3M2Y5YzFjODE0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJMeEo5bGJLejlYSTdvMDFDZW9xTmdHYlZYZ0dFV05CSVVnZ3pvWGxhWUZ0NlhkMDhHK1l2YlBmMXE5SW8wSzE5In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] OvmfPkg/Gop: clear the screen to black in SetMode() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 14:03:22 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of La= szlo > Ersek > Sent: Tuesday, March 13, 2018 9:10 PM > To: Ni, Ruiyu ; edk2-devel@lists.01.org > Cc: Justen, Jordan L ; Ard Biesheuvel > > Subject: Re: [edk2] [PATCH] OvmfPkg/Gop: clear the screen to black in Set= Mode() >=20 > Hi Ray, >=20 > On 03/13/18 11:05, Ruiyu Ni wrote: > > Today's implementation forgot to clear the screen to black in > > SetMode(). It causes SCT SetMode() test fails. > > > > The patch adds the clear screen operation in SetMode() to fix the SCT > > failure. > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Ruiyu Ni > > Cc: Jordan Justen > > Cc: Laszlo Ersek > > Cc: Ard Biesheuvel > > --- > > OvmfPkg/QemuVideoDxe/Gop.c | 23 ++++++++++++++++++----- > > 1 file changed, 18 insertions(+), 5 deletions(-) > > > > diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c > > index 512fd27acb..f573f7011a 100644 > > --- a/OvmfPkg/QemuVideoDxe/Gop.c > > +++ b/OvmfPkg/QemuVideoDxe/Gop.c > > @@ -1,7 +1,7 @@ > > /** @file > > Graphics Output Protocol functions for the QEMU video controller. > > > > - Copyright (c) 2007 - 2017, Intel Corporation. All rights > > reserved.
> > + Copyright (c) 2007 - 2018, Intel Corporation. All rights > > + reserved.
> > > > This program and the accompanying materials > > are licensed and made available under the terms and conditions of > > the BSD License @@ -196,9 +196,10 @@ Routine Description: > > > > --*/ > > { > > - QEMU_VIDEO_PRIVATE_DATA *Private; > > - QEMU_VIDEO_MODE_DATA *ModeData; > > - RETURN_STATUS Status; > > + QEMU_VIDEO_PRIVATE_DATA *Private; > > + QEMU_VIDEO_MODE_DATA *ModeData; > > + RETURN_STATUS Status; > > + EFI_GRAPHICS_OUTPUT_BLT_PIXEL Black; > > > > Private =3D QEMU_VIDEO_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS > (This); > > > > @@ -271,7 +272,19 @@ Routine Description: > > } > > ASSERT (Status =3D=3D RETURN_SUCCESS); > > > > - return EFI_SUCCESS; > > + // > > + // Per UEFI Spec, need to clear the visible portions of the output d= isplay to > black. > > + // > > + ZeroMem (&Black, sizeof (Black)); > > + return FrameBufferBlt ( > > + Private->FrameBufferBltConfigure, > > + &Black, > > + EfiBltVideoFill, > > + 0, 0, > > + 0, 0, > > + This->Mode->Info->HorizontalResolution, This->Mode->Info- > >VerticalResolution, > > + 0 > > + ); > > } > > > > EFI_STATUS > > >=20 > Thanks for the patch! >=20 > What would you think of the following update: FrameBufferBlt() is documen= ted > to return RETURN_INVALID_PARAMETER for "Invalid parameter were passed in"= , > and RETURN_SUCCESS otherwise ("The Blt operation was performed > successfully"). I suggest that we keep the "return EFI_SUCCESS" in the en= d, just > ASSERT() that FrameBufferBlt() succeeds. >=20 > (Even if there was a third possibility, i.e. for FrameBufferBlt() to fail= for a > different reason, I think that should still not report that > SetMode() failed.) I agree! >=20 > If you agree with the idea, please update the patch before pushing it. > If you disagree with it, I don't insist. >=20 > Reviewed-by: Laszlo Ersek >=20 > Thanks > Laszlo > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel