From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 76F1C224CCC39 for ; Tue, 13 Mar 2018 06:03:20 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DAC7F406E8C3; Tue, 13 Mar 2018 13:09:41 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-124-72.rdu2.redhat.com [10.10.124.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id 065D32166BAE; Tue, 13 Mar 2018 13:09:40 +0000 (UTC) To: Ruiyu Ni , edk2-devel@lists.01.org Cc: Jordan Justen , Ard Biesheuvel References: <20180313100544.123552-1-ruiyu.ni@intel.com> From: Laszlo Ersek Message-ID: Date: Tue, 13 Mar 2018 14:09:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180313100544.123552-1-ruiyu.ni@intel.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 13 Mar 2018 13:09:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 13 Mar 2018 13:09:41 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' 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 13:03:22 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Ray, 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 = QEMU_VIDEO_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS (This); > > @@ -271,7 +272,19 @@ Routine Description: > } > ASSERT (Status == RETURN_SUCCESS); > > - return EFI_SUCCESS; > + // > + // Per UEFI Spec, need to clear the visible portions of the output display 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 > Thanks for the patch! What would you think of the following update: FrameBufferBlt() is documented 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 end, just ASSERT() that FrameBufferBlt() succeeds. (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.) If you agree with the idea, please update the patch before pushing it. If you disagree with it, I don't insist. Reviewed-by: Laszlo Ersek Thanks Laszlo