From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 BC0E181EDF for ; Mon, 23 Jan 2017 02:45:42 -0800 (PST) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C2D8C04B947; Mon, 23 Jan 2017 10:45:43 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-14.phx2.redhat.com [10.3.116.14]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0NAjf1A014405; Mon, 23 Jan 2017 05:45:42 -0500 To: Ruiyu Ni , edk2-devel@ml01.01.org References: <20170123061149.279944-1-ruiyu.ni@intel.com> <20170123061149.279944-4-ruiyu.ni@intel.com> Cc: Jordan Justen From: Laszlo Ersek Message-ID: <65f4c204-eebf-e437-6e6e-04612ad2b773@redhat.com> Date: Mon, 23 Jan 2017 11:45:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170123061149.279944-4-ruiyu.ni@intel.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 23 Jan 2017 10:45:43 +0000 (UTC) Subject: Re: [PATCH 3/3] OvmfPkg/QemuVideoDxe: Frame buffer config size may change in new mode X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2017 10:45:42 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 01/23/17 07:11, Ruiyu Ni wrote: > https://bugzilla.tianocore.org/show_bug.cgi?id=339 > > The patch removes the assumption in QemuVideoDxe driver that it > wrongly assumes the frame buffer configure size is the same in > different video modes. > The assumption is true in old FrameBufferBltLib but is false in > new implementation. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ruiyu Ni > Cc: Jordan Justen > Cc: Laszlo Ersek > --- > OvmfPkg/QemuVideoDxe/Gop.c | 47 +++++++++++++++++++++++++--------------------- > 1 file changed, 26 insertions(+), 21 deletions(-) Reviewed-by: Laszlo Ersek Thanks! Laszlo > diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c > index 5485ba3..359e921 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 - 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2007 - 2017, 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 > @@ -189,30 +189,35 @@ Routine Description: > QemuVideoCompleteModeData (Private, This->Mode); > > // > - // Allocate when using first time. > + // Re-initialize the frame buffer configure when mode changes. > // > - if (Private->FrameBufferBltConfigure == NULL) { > - Status = FrameBufferBltConfigure ( > - (VOID*) (UINTN) This->Mode->FrameBufferBase, > - This->Mode->Info, > - Private->FrameBufferBltConfigure, > - &Private->FrameBufferBltConfigureSize > - ); > - ASSERT (Status == RETURN_BUFFER_TOO_SMALL); > + Status = FrameBufferBltConfigure ( > + (VOID*) (UINTN) This->Mode->FrameBufferBase, > + This->Mode->Info, > + Private->FrameBufferBltConfigure, > + &Private->FrameBufferBltConfigureSize > + ); > + if (Status == RETURN_BUFFER_TOO_SMALL) { > + // > + // Frame buffer configure may be larger in new mode. > + // > + if (Private->FrameBufferBltConfigure != NULL) { > + FreePool (Private->FrameBufferBltConfigure); > + } > Private->FrameBufferBltConfigure = > AllocatePool (Private->FrameBufferBltConfigureSize); > - } > + ASSERT (Private->FrameBufferBltConfigure != NULL); > > - // > - // Create the configuration for FrameBufferBltLib > - // > - ASSERT (Private->FrameBufferBltConfigure != NULL); > - Status = FrameBufferBltConfigure ( > - (VOID*) (UINTN) This->Mode->FrameBufferBase, > - This->Mode->Info, > - Private->FrameBufferBltConfigure, > - &Private->FrameBufferBltConfigureSize > - ); > + // > + // Create the configuration for FrameBufferBltLib > + // > + Status = FrameBufferBltConfigure ( > + (VOID*) (UINTN) This->Mode->FrameBufferBase, > + This->Mode->Info, > + Private->FrameBufferBltConfigure, > + &Private->FrameBufferBltConfigureSize > + ); > + } > ASSERT (Status == RETURN_SUCCESS); > > return EFI_SUCCESS; >