From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Thu, 09 May 2019 16:25:20 -0700 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6CD5333025F; Thu, 9 May 2019 23:25:19 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-234.rdu2.redhat.com [10.10.120.234]) by smtp.corp.redhat.com (Postfix) with ESMTP id 38812646A0; Thu, 9 May 2019 23:25:18 +0000 (UTC) Subject: Re: [Patch] OvmfPkg/QemuVideoDxe: Remove dependency on OptionRomPkg To: Michael D Kinney , devel@edk2.groups.io Cc: Jordan Justen , Ard Biesheuvel References: <20190509173948.13160-1-michael.d.kinney@intel.com> From: "Laszlo Ersek" Message-ID: Date: Fri, 10 May 2019 01:25:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190509173948.13160-1-michael.d.kinney@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 09 May 2019 23:25:19 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hello Mike, On 05/09/19 19:39, Michael D Kinney wrote: > Update the QemuVideoDxe driver to not depend on the > OptionRomPkg to support moving OptionRomPkg to the > edk2-platforms repository. > > The only dependency on the OptionRomPkg is the use of > PcdDriverSupportedEfiVersion to set the version value in the > EFI Driver Supported EFI Version Protocol. This protocol is > intended for use in drivers for add-in devices, which does not > apply to the QEMU integrated video controller. Since this > protocol does not apply to QEMU environment, remove both the > PCD and the installation of the EFI Driver Supported EFI > Version Protocol. > > Cc: Jordan Justen > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Signed-off-by: Michael D Kinney > --- > OvmfPkg/QemuVideoDxe/Driver.c | 15 +-------------- > OvmfPkg/QemuVideoDxe/DriverSupportedEfiVersion.c | 15 --------------- > OvmfPkg/QemuVideoDxe/Qemu.h | 3 +-- > OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf | 6 +----- > 4 files changed, 3 insertions(+), 36 deletions(-) > delete mode 100644 OvmfPkg/QemuVideoDxe/DriverSupportedEfiVersion.c Thanks for the patch! The code is ready to go in. I'd like to request one update with the commit message. Please replace the following sentence in the middle: This protocol is intended for use in drivers for add-in devices, which does not apply to the QEMU integrated video controller. with: Quoting the UEFI-2.8 spec, "This protocol is required for EFI drivers that are *on* PCI and other plug in cards" (emphasis ours). However, QemuVideoDxe is always part of the OVMF platform firmware, and is never read by PciBusDxe from the PCI ROM BAR of QEMU's emulated graphics cards. (I'm asking for this update because I don't consider the QEMU GPUs in question integrated devices (such as the IGD is, on physical boards). The QEMU GPUs may not be hotpluggable, yes, but I think they still qualify as discrete (cold-pluggable) PCI devices. For example, OVMF can be run on "headless" (serial port only) QEMU VMs too.) With that update: Reviewed-by: Laszlo Ersek Thank you very much! Laszlo > > diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c > index 45bcfb8fd1..e8a613ef33 100644 > --- a/OvmfPkg/QemuVideoDxe/Driver.c > +++ b/OvmfPkg/QemuVideoDxe/Driver.c > @@ -2,7 +2,7 @@ > This driver is a sample implementation of the Graphics Output Protocol for > the QEMU (Cirrus Logic 5446) video controller. > > - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
> + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
> > SPDX-License-Identifier: BSD-2-Clause-Patent > > @@ -982,18 +982,5 @@ InitializeQemuVideo ( > ); > ASSERT_EFI_ERROR (Status); > > - // > - // Install EFI Driver Supported EFI Version Protocol required for > - // EFI drivers that are on PCI and other plug in cards. > - // > - gQemuVideoDriverSupportedEfiVersion.FirmwareVersion = PcdGet32 (PcdDriverSupportedEfiVersion); > - Status = gBS->InstallMultipleProtocolInterfaces ( > - &ImageHandle, > - &gEfiDriverSupportedEfiVersionProtocolGuid, > - &gQemuVideoDriverSupportedEfiVersion, > - NULL > - ); > - ASSERT_EFI_ERROR (Status); > - > return Status; > } > diff --git a/OvmfPkg/QemuVideoDxe/DriverSupportedEfiVersion.c b/OvmfPkg/QemuVideoDxe/DriverSupportedEfiVersion.c > deleted file mode 100644 > index c06f1d73cf..0000000000 > --- a/OvmfPkg/QemuVideoDxe/DriverSupportedEfiVersion.c > +++ /dev/null > @@ -1,15 +0,0 @@ > -/** @file > - Driver supported version protocol for the QEMU video driver. > - > - Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
> - > - SPDX-License-Identifier: BSD-2-Clause-Patent > - > -**/ > -#include "Qemu.h" > - > -EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL gQemuVideoDriverSupportedEfiVersion = { > - sizeof (EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL), // Size of Protocol structure. > - 0 // Version number to be filled at start up. > -}; > - > diff --git a/OvmfPkg/QemuVideoDxe/Qemu.h b/OvmfPkg/QemuVideoDxe/Qemu.h > index 2b64f1e2b0..87c933935f 100644 > --- a/OvmfPkg/QemuVideoDxe/Qemu.h > +++ b/OvmfPkg/QemuVideoDxe/Qemu.h > @@ -1,7 +1,7 @@ > /** @file > QEMU Video Controller Driver > > - Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent > > **/ > @@ -156,7 +156,6 @@ extern QEMU_VIDEO_BOCHS_MODES QemuVideoBochsModes[]; > extern EFI_DRIVER_BINDING_PROTOCOL gQemuVideoDriverBinding; > extern EFI_COMPONENT_NAME_PROTOCOL gQemuVideoComponentName; > extern EFI_COMPONENT_NAME2_PROTOCOL gQemuVideoComponentName2; > -extern EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL gQemuVideoDriverSupportedEfiVersion; > > // > // Io Registers defined by VGA > diff --git a/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf b/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf > index 4e29b0c20f..fe8befd51d 100644 > --- a/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf > +++ b/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf > @@ -2,7 +2,7 @@ > # This driver is a sample implementation of the Graphics Output Protocol for > # the QEMU (Cirrus Logic 5446) video controller. > # > -# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > @@ -29,7 +29,6 @@ [Defines] > [Sources.common] > ComponentName.c > Driver.c > - DriverSupportedEfiVersion.c > Gop.c > Initialize.c > Qemu.h > @@ -41,7 +40,6 @@ [Sources.Ia32, Sources.X64] > [Packages] > MdePkg/MdePkg.dec > MdeModulePkg/MdeModulePkg.dec > - OptionRomPkg/OptionRomPkg.dec > OvmfPkg/OvmfPkg.dec > > [LibraryClasses] > @@ -59,12 +57,10 @@ [LibraryClasses] > UefiLib > > [Protocols] > - gEfiDriverSupportedEfiVersionProtocolGuid # PROTOCOL ALWAYS_PRODUCED > gEfiGraphicsOutputProtocolGuid # PROTOCOL BY_START > gEfiDevicePathProtocolGuid # PROTOCOL BY_START > gEfiPciIoProtocolGuid # PROTOCOL TO_START > > [Pcd] > - gOptionRomPkgTokenSpaceGuid.PcdDriverSupportedEfiVersion > gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId > gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask >