diff --git a/sysutils/edk2/files/patch-OvmfPkg_Include_Protocol_PlatformGopPolicy.h b/sysutils/edk2/files/patch-OvmfPkg_Include_Protocol_PlatformGopPolicy.h new file mode 100644 --- /dev/null +++ b/sysutils/edk2/files/patch-OvmfPkg_Include_Protocol_PlatformGopPolicy.h @@ -0,0 +1,71 @@ +--- OvmfPkg/Include/Protocol/PlatformGopPolicy.h.orig 2023-09-04 06:42:23 UTC ++++ OvmfPkg/Include/Protocol/PlatformGopPolicy.h +@@ -0,0 +1,68 @@ ++/*++ ++ ++Copyright (c) 1999 - 2019, 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 that accompanies this distribution. ++ The full text of the license may be found at ++ http://opensource.org/licenses/bsd-license.php. ++ ++ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, ++ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ++ ++ ++--*/ ++ ++/** @file ++**/ ++ ++#ifndef _PLATFORM_GOP_POLICY_PROTOCOL_H_ ++#define _PLATFORM_GOP_POLICY_PROTOCOL_H_ ++ ++#define EFI_PLATFORM_GOP_POLICY_PROTOCOL_GUID \ ++ { 0xec2e931b, 0x3281, 0x48a5, 0x81, 0x7, 0xdf, 0x8a, 0x8b, 0xed, 0x3c, 0x5d } ++ ++#define PLATFORM_GOP_POLICY_PROTOCOL_REVISION_01 0x01 ++#define PLATFORM_GOP_POLICY_PROTOCOL_REVISION_02 x0222 ++ ++#pragma pack(1) ++ ++typedef enum { ++ LidClosed, ++ LidOpen, ++ LidStatusMax ++} LID_STATUS; ++ ++typedef enum { ++ Docked, ++ UnDocked, ++ DockStatusMax ++} DOCK_STATUS; ++ ++typedef ++EFI_STATUS ++(EFIAPI *GET_PLATFORM_LID_STATUS)( ++ OUT LID_STATUS *CurrentLidStatus ++ ); ++ ++typedef ++EFI_STATUS ++(EFIAPI *GET_VBT_DATA)( ++ OUT EFI_PHYSICAL_ADDRESS *VbtAddress, ++ OUT UINT32 *VbtSize ++ ); ++ ++#pragma pack() ++ ++typedef struct _PLATFORM_GOP_POLICY_PROTOCOL { ++ UINT32 Revision; ++ GET_PLATFORM_LID_STATUS GetPlatformLidStatus; ++ GET_VBT_DATA GetVbtData; ++} PLATFORM_GOP_POLICY_PROTOCOL; ++ ++// ++// Extern the GUID for protocol users. ++// ++extern EFI_GUID gPlatformGOPPolicyGuid; ++ ++#endif diff --git a/sysutils/edk2/files/patch-OvmfPkg_OvmfPkg.dec b/sysutils/edk2/files/patch-OvmfPkg_OvmfPkg.dec new file mode 100644 --- /dev/null +++ b/sysutils/edk2/files/patch-OvmfPkg_OvmfPkg.dec @@ -0,0 +1,10 @@ +--- OvmfPkg/OvmfPkg.dec.orig 2023-08-25 01:54:50 UTC ++++ OvmfPkg/OvmfPkg.dec +@@ -197,6 +197,7 @@ + gQemuAcpiTableNotifyProtocolGuid = {0x928939b2, 0x4235, 0x462f, {0x95, 0x80, 0xf6, 0xa2, 0xb2, 0xc2, 0x1a, 0x4f}} + gEfiMpInitLibMpDepProtocolGuid = {0xbb00a5ca, 0x8ce, 0x462f, {0xa5, 0x37, 0x43, 0xc7, 0x4a, 0x82, 0x5c, 0xa4}} + gEfiMpInitLibUpDepProtocolGuid = {0xa9e7cef1, 0x5682, 0x42cc, {0xb1, 0x23, 0x99, 0x30, 0x97, 0x3f, 0x4a, 0x9f}} ++ gPlatformGOPPolicyGuid = {0xec2e931b, 0x3281, 0x48a5, {0x81, 0x07, 0xdf, 0x8a, 0x8b, 0xed, 0x3c, 0x5d}} + + [PcdsFixedAtBuild] + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|0x0|UINT32|0 diff --git a/sysutils/edk2/files/patch-OvmfPkg_PlatformGopPolicy_PlatformGopPolicy.c b/sysutils/edk2/files/patch-OvmfPkg_PlatformGopPolicy_PlatformGopPolicy.c new file mode 100644 --- /dev/null +++ b/sysutils/edk2/files/patch-OvmfPkg_PlatformGopPolicy_PlatformGopPolicy.c @@ -0,0 +1,117 @@ +--- OvmfPkg/PlatformGopPolicy/PlatformGopPolicy.c.orig 2023-09-04 06:42:48 UTC ++++ OvmfPkg/PlatformGopPolicy/PlatformGopPolicy.c +@@ -0,0 +1,114 @@ ++/** @file ++ Platform GOP Policy ++ ++ GOP drivers calls GetVbtData to get the Video BIOS Table of the Intel Graphics ++ Device. ++ ++ Copyright (C) 1999 - 2019, Intel Corporation. All rights reserved ++ Copyright (C) 2021, Beckhoff Automation GmbH & Co. KG. All rights reserved.
++ ++ This program and the accompanying materials are licensed and made available under ++ the terms and conditions of the BSD License that accompanies this distribution. ++ The full text of the license may be found at ++ http://opensource.org/licenses/bsd-license.php. ++ ++ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, ++ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ++ ++ ++**/ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++#include ++ ++ ++PLATFORM_GOP_POLICY_PROTOCOL mPlatformGOPPolicy; ++VBT_HEADER *mVbt; ++ ++/** ++ The function returns the Platform Lid Status. IBV/OEM can customize this code ++ for their specific policy action. ++ ++ @param[out] CurrentLidStatus Current LID Status. ++ ++ @retval EFI_UNSUPPORTED Function isn't implemented yet. ++ ++**/ ++EFI_STATUS ++EFIAPI ++GetPlatformLidStatus ( ++ OUT LID_STATUS *CurrentLidStatus ++ ) ++{ ++ return EFI_UNSUPPORTED; ++} ++ ++/** ++ The function returns the Video Bios Table size and address. ++ ++ @param[out] VbtAddress Physical Address of Video BIOS Table ++ ++ @param[out] VbtSize Size of Video BIOS Table ++ ++ @retval EFI_STATUS Successfully returned Video BIOS Table address and ++ size. ++ ++**/ ++EFI_STATUS ++EFIAPI ++GetVbtData ( ++ OUT EFI_PHYSICAL_ADDRESS *VbtAddress, ++ OUT UINT32 *VbtSize ++ ) ++{ ++ return EFI_UNSUPPORTED; ++} ++ ++/** ++ Entry point for the Platform GOP Policy Driver. ++ ++ @param[in] ImageHandle Image handle of this driver. ++ ++ @param[in] SystemTable Global system service table. ++ ++ @retval EFI_SUCCESS Initialization complete. ++ ++ @return Error codes propagated from underlying functions. ++**/ ++EFI_STATUS ++EFIAPI ++PlatformGOPPolicyEntryPoint ( ++ IN EFI_HANDLE ImageHandle, ++ IN EFI_SYSTEM_TABLE *SystemTable ++ ) ++ ++{ ++ EFI_STATUS Status; ++ ++ gBS = SystemTable->BootServices; ++ ++ mPlatformGOPPolicy.Revision = PLATFORM_GOP_POLICY_PROTOCOL_REVISION_01; ++ mPlatformGOPPolicy.GetPlatformLidStatus = GetPlatformLidStatus; ++ mPlatformGOPPolicy.GetVbtData = GetVbtData; ++ ++ // ++ // Install protocol to allow access to this Policy. ++ // ++ Status = gBS->InstallMultipleProtocolInterfaces ( ++ &ImageHandle, ++ &gPlatformGOPPolicyGuid, ++ &mPlatformGOPPolicy, ++ NULL ++ ); ++ ++ return Status; ++} diff --git a/sysutils/edk2/files/patch-OvmfPkg_PlatformGopPolicy_PlatformGopPolicy.inf b/sysutils/edk2/files/patch-OvmfPkg_PlatformGopPolicy_PlatformGopPolicy.inf new file mode 100644 --- /dev/null +++ b/sysutils/edk2/files/patch-OvmfPkg_PlatformGopPolicy_PlatformGopPolicy.inf @@ -0,0 +1,55 @@ +--- OvmfPkg/PlatformGopPolicy/PlatformGopPolicy.inf.orig 2023-09-04 06:42:52 UTC ++++ OvmfPkg/PlatformGopPolicy/PlatformGopPolicy.inf +@@ -0,0 +1,52 @@ ++## @file ++# Platform GOP Policy ++# ++# GOP drivers calls GetVbtData to get the Video BIOS Table of the Intel Graphics ++# Device. ++# ++# Copyright (c) 1999 - 2019, Intel Corporation. All rights reserved ++# Copyrigth (C) 2021, Beckhoff Automation GmbH & Co. KG. All rights reserved.
++# ++# This program and the accompanying materials are licensed and made available under ++# the terms and conditions of the BSD License that accompanies this distribution. ++# The full text of the license may be found at ++# http://opensource.org/licenses/bsd-license.php. ++# ++# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, ++# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ++## ++ ++ ++[Defines] ++ INF_VERSION = 0x00010005 ++ BASE_NAME = PlatformGOPPolicy ++ FILE_GUID = 9737D7CA-D869-45e5-A5EF-75D9438688DE ++ MODULE_TYPE = DXE_DRIVER ++ VERSION_STRING = 1.0 ++ ENTRY_POINT = PlatformGOPPolicyEntryPoint ++ ++# ++# The following information is for reference only and not required by the build tools. ++# ++# VALID_ARCHITECTURES = IA32 ++# ++ ++[Sources.common] ++ PlatformGopPolicy.c ++ ++[Packages] ++ MdePkg/MdePkg.dec ++ OvmfPkg/OvmfPkg.dec ++ ++[LibraryClasses] ++ BaseLib ++ DebugLib ++ UefiDriverEntryPoint ++ UefiRuntimeServicesTableLib ++ PciLib ++ ++[Protocols] ++ gPlatformGOPPolicyGuid ++ ++[Depex] ++ TRUE