From nobody Thu Dec 26 13:38:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1506457007618539.4512270662821; Tue, 26 Sep 2017 13:16:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 72EC720945BD1; Tue, 26 Sep 2017 13:12:42 -0700 (PDT) Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5AD9120945BA4 for ; Tue, 26 Sep 2017 13:12:27 -0700 (PDT) Received: from E111747.Emea.Arm.com (e111747.emea.arm.com [10.1.27.40]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id v8QKFY5f017392; Tue, 26 Sep 2017 21:15:38 +0100 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.96.140; helo=cam-smtp0.cambridge.arm.com; envelope-from=evan.lloyd@arm.com; receiver=edk2-devel@lists.01.org From: evan.lloyd@arm.com To: edk2-devel@lists.01.org Date: Tue, 26 Sep 2017 21:15:26 +0100 Message-Id: <20170926201529.11644-17-evan.lloyd@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170926201529.11644-1-evan.lloyd@arm.com> References: <20170926201529.11644-1-evan.lloyd@arm.com> Subject: [edk2] [PATCH 16/19] ArmPlatformPkg: Reorganize Lcd Graphics Output X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "ard.biesheuvel@linaro.org"@arm.com, "leif.lindholm@linaro.org"@arm.com, "nd@arm.com"@arm.com, "Matteo.Carlini@arm.com"@arm.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Girish Pathak Currently for ArmPlatformPkg, the UEFI Graphics Output Protocol is implemented using platform specific Libraries ((PL111|Hd)LcdArmVExpressLib) and DXE drivers ((PL111|Hd)LcdGraphicsOutputDxe). The platform library handles variations such as platform supported display modes, memory management of the frame buffer, and clock/mux setting. The DXE driver implements the GOP protocol and manages the respective display controller. Although this implementation works for current platforms, we think the way the current DXE driver sources are linked is sub-optimal and needs to be improved, before additions. This change effectively partitions HdLcd.c and PL111Lcd.c from LcdGraphicsOutputProtocol and creates two libraries of type LcdHwLib which can be selected in the platform specific .dsc file. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Girish Pathak Signed-off-by: Evan Lloyd --- ArmPlatformPkg/ArmVExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpress= Lib.inf | 3 +- ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVE= xpressLib.inf | 2 +- ArmPlatformPkg/Drivers/{LcdGraphicsOutputDxe/HdLcdGraphicsOutputDxe.inf = =3D> HdLcd/HdLcd.inf} | 25 +------- ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/{PL111LcdGraphicsOutputDxe.inf= =3D> LcdGraphicsOutputDxe.inf} | 15 ++--- ArmPlatformPkg/Drivers/{LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf= =3D> PL111Lcd/PL111Lcd.inf} | 28 ++------- ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h = | 21 ------- ArmPlatformPkg/Include/Drivers/LcdHw.h = | 64 ++++++++++++++++++++ ArmPlatformPkg/Include/Library/LcdPlatformLib.h = | 1 + ArmPlatformPkg/Drivers/{LcdGraphicsOutputDxe =3D> HdLcd}/HdLcd.c = | 3 +- ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c = | 2 + ArmPlatformPkg/Drivers/{LcdGraphicsOutputDxe =3D> PL111Lcd}/PL111Lcd.c = | 5 +- 11 files changed, 85 insertions(+), 84 deletions(-) diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/HdLcdArmVExpressLib/HdLc= dArmVExpressLib.inf b/ArmPlatformPkg/ArmVExpressPkg/Library/HdLcdArmVExpres= sLib/HdLcdArmVExpressLib.inf index 37756481596c7e978ed9ed0a932eeb2aa0a3b657..1fe93a53f81c46955c62383a2ba= d0e19a9662015 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVEx= pressLib.inf +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVEx= pressLib.inf @@ -18,7 +18,7 @@ [Defines] INF_VERSION =3D 0x00010005 BASE_NAME =3D HdLcdArmVExpress FILE_GUID =3D 535a720e-06c0-4bb9-b563-452216abbed4 - MODULE_TYPE =3D DXE_DRIVER + MODULE_TYPE =3D BASE VERSION_STRING =3D 1.0 LIBRARY_CLASS =3D LcdPlatformLib =20 @@ -40,6 +40,5 @@ [Protocols] gEfiEdidActiveProtocolGuid # Produced =20 [FixedPcd] - gArmVExpressTokenSpaceGuid.PcdPL111LcdMaxMode gArmVExpressTokenSpaceGuid.PcdHdLcdVideoModeOscId gArmPlatformTokenSpaceGuid.PcdGopPixelFormat diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/P= L111LcdArmVExpressLib.inf b/ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdA= rmVExpressLib/PL111LcdArmVExpressLib.inf index 6f1cb3b55ff814d007718b5597f821dd20100477..f6d5bf76dd375d97bac63ca427c= c231792b9e52b 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111Lcd= ArmVExpressLib.inf +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111Lcd= ArmVExpressLib.inf @@ -18,7 +18,7 @@ [Defines] INF_VERSION =3D 0x00010005 BASE_NAME =3D PL111LcdArmVExpressLib FILE_GUID =3D b7f06f20-496f-11e0-a8e8-0002a5d5c51b - MODULE_TYPE =3D DXE_DRIVER + MODULE_TYPE =3D BASE VERSION_STRING =3D 1.0 LIBRARY_CLASS =3D LcdPlatformLib =20 diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcdGraphicsOutpu= tDxe.inf b/ArmPlatformPkg/Drivers/HdLcd/HdLcd.inf similarity index 59% rename from ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcdGraphicsOutput= Dxe.inf rename to ArmPlatformPkg/Drivers/HdLcd/HdLcd.inf index b050add98e3f9cf62ac335883193b9d0928c3dc9..e43c894538cfd7985862997aaa1= b8a381cb6423a 100644 --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcdGraphicsOutputDxe.inf +++ b/ArmPlatformPkg/Drivers/HdLcd/HdLcd.inf @@ -16,15 +16,13 @@ =20 [Defines] INF_VERSION =3D 0x00010005 - BASE_NAME =3D HdLcdGraphicsDxe + BASE_NAME =3D HdLcd FILE_GUID =3D ce660500-824d-11e0-ac72-0002a5d5c51b - MODULE_TYPE =3D DXE_DRIVER + MODULE_TYPE =3D BASE VERSION_STRING =3D 1.0 - ENTRY_POINT =3D LcdGraphicsOutputDxeInitialize + LIBRARY_CLASS =3D LcdHwLib =20 [Sources.common] - LcdGraphicsOutputDxe.c - LcdGraphicsOutputBlt.c HdLcd.c =20 [Packages] @@ -39,26 +37,9 @@ [LibraryClasses] UefiLib BaseLib DebugLib - TimerLib - UefiDriverEntryPoint - UefiBootServicesTableLib IoLib - BaseMemoryLib - LcdPlatformLib - -[Protocols] - gEfiDevicePathProtocolGuid - gEfiGraphicsOutputProtocolGuid # Produced - gEfiEdidDiscoveredProtocolGuid # Produced - gEfiEdidActiveProtocolGuid # Produced - gEfiEdidOverrideProtocolGuid # Produced =20 [FixedPcd] gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase gArmPlatformTokenSpaceGuid.PcdArmHdLcdSwapBlueRedSelect =20 -[FeaturePcd] - gArmPlatformTokenSpaceGuid.PcdGopDisableOnExitBootServices - -[Depex] - gEfiCpuArchProtocolGuid diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOu= tputDxe.inf b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutput= Dxe.inf similarity index 78% copy from ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutpu= tDxe.inf copy to ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf index ad0348500326c4567f0e1b235c84b694e61306bf..edd03c7eb1c39e397c72a4c22e7= d05ab21b53def 100644 --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe= .inf +++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf @@ -2,7 +2,7 @@ # # Component description file for PL111LcdGraphicsOutputDxe module # -# Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
+# Copyright (c) 2017, ARM Ltd. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the B= SD License # which accompanies this distribution. The full text of the license may = be found at @@ -15,8 +15,8 @@ =20 [Defines] INF_VERSION =3D 0x00010005 - BASE_NAME =3D PL111LcdGraphicsDxe - FILE_GUID =3D 407B4008-BF5B-11DF-9547-CF16E0D72085 + BASE_NAME =3D LcdGraphicsDxe + FILE_GUID =3D 89464DAE-8DAA-41FE-A4C8-40D2175AF1E9 MODULE_TYPE =3D DXE_DRIVER VERSION_STRING =3D 1.0 ENTRY_POINT =3D LcdGraphicsOutputDxeInitialize @@ -24,7 +24,6 @@ [Defines] [Sources.common] LcdGraphicsOutputDxe.c LcdGraphicsOutputBlt.c - PL111Lcd.c =20 [Packages] MdePkg/MdePkg.dec @@ -38,22 +37,18 @@ [LibraryClasses] UefiLib BaseLib DebugLib - TimerLib UefiDriverEntryPoint UefiBootServicesTableLib - IoLib BaseMemoryLib LcdPlatformLib + LcdHwLib =20 [Protocols] gEfiDevicePathProtocolGuid gEfiGraphicsOutputProtocolGuid =20 -[FixedPcd] - gArmPlatformTokenSpaceGuid.PcdPL111LcdBase - [FeaturePcd] gArmPlatformTokenSpaceGuid.PcdGopDisableOnExitBootServices =20 [Depex] - gEfiCpuArchProtocolGuid + TRUE diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOu= tputDxe.inf b/ArmPlatformPkg/Drivers/PL111Lcd/PL111Lcd.inf similarity index 59% rename from ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOut= putDxe.inf rename to ArmPlatformPkg/Drivers/PL111Lcd/PL111Lcd.inf index ad0348500326c4567f0e1b235c84b694e61306bf..8e571a02476142af787db90c0ee= 240a784b74a63 100644 --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe= .inf +++ b/ArmPlatformPkg/Drivers/PL111Lcd/PL111Lcd.inf @@ -1,6 +1,6 @@ -#/** @file PL111LcdGraphicsOutputDxe.inf +#/** @file PL111Lcd.inf # -# Component description file for PL111LcdGraphicsOutputDxe module +# Component description file for PL111Lcd module # # Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
# This program and the accompanying materials @@ -15,15 +15,13 @@ =20 [Defines] INF_VERSION =3D 0x00010005 - BASE_NAME =3D PL111LcdGraphicsDxe + BASE_NAME =3D PL111Lcd FILE_GUID =3D 407B4008-BF5B-11DF-9547-CF16E0D72085 - MODULE_TYPE =3D DXE_DRIVER + MODULE_TYPE =3D BASE VERSION_STRING =3D 1.0 - ENTRY_POINT =3D LcdGraphicsOutputDxeInitialize + LIBRARY_CLASS =3D LcdHwLib =20 [Sources.common] - LcdGraphicsOutputDxe.c - LcdGraphicsOutputBlt.c PL111Lcd.c =20 [Packages] @@ -34,26 +32,10 @@ [Packages] ArmPlatformPkg/ArmPlatformPkg.dec =20 [LibraryClasses] - ArmLib UefiLib BaseLib DebugLib - TimerLib - UefiDriverEntryPoint - UefiBootServicesTableLib IoLib - BaseMemoryLib - LcdPlatformLib - -[Protocols] - gEfiDevicePathProtocolGuid - gEfiGraphicsOutputProtocolGuid =20 [FixedPcd] gArmPlatformTokenSpaceGuid.PcdPL111LcdBase - -[FeaturePcd] - gArmPlatformTokenSpaceGuid.PcdGopDisableOnExitBootServices - -[Depex] - gEfiCpuArchProtocolGuid diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputD= xe.h b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h index 85e918de66624d61c6d0e05c5a67c516cd7619aa..76a710fda59279a6642dc2408c7= 90afcf49360b8 100644 --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h +++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h @@ -19,7 +19,6 @@ =20 #include #include -#include #include =20 #include @@ -92,7 +91,6 @@ UINTN GetBytesPerPixel ( IN LCD_BPP Bpp ); - EFI_STATUS EFIAPI GraphicsOutputDxeInitialize ( @@ -105,23 +103,4 @@ InitializeDisplay ( IN LCD_INSTANCE* Instance ); =20 -EFI_STATUS -LcdIdentify ( - VOID -); - -EFI_STATUS -LcdInitialize ( - EFI_PHYSICAL_ADDRESS VramBaseAddress -); - -EFI_STATUS -LcdSetMode ( - IN UINT32 ModeNumber -); - -VOID -LcdShutdown ( - VOID -); #endif /* LCD_GRAPHICS_OUTPUT_DXE_H_ */ diff --git a/ArmPlatformPkg/Include/Drivers/LcdHw.h b/ArmPlatformPkg/Includ= e/Drivers/LcdHw.h new file mode 100644 index 0000000000000000000000000000000000000000..1f5b9c0b7e7decbf1136614b5b1= b482ccd805604 --- /dev/null +++ b/ArmPlatformPkg/Include/Drivers/LcdHw.h @@ -0,0 +1,64 @@ +/** @file LcdHw.h + + This file contains interface functions for LcdHwLib of ArmPlatformPkg + + Copyright (c) 2017, ARM Ltd. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. + +**/ + +#ifndef LCD_HW_H_ +#define LCD_HW_H_ + +#include + +/** Check for presence of display + * + * @retval EFI_SUCCESS Platform implements display. + * @retval EFI_NOT_FOUND Display not found on the platform. + */ +EFI_STATUS +LcdIdentify ( + VOID +); + +/** Initialize display. + * + * @param FrameBaseAddress Address of the frame buffer. + * @retval EFI_SUCCESS Display initialization success. + * @retval !(EFI_SUCCESS) Display initialization failure. + * +**/ +EFI_STATUS +LcdInitialize ( + EFI_PHYSICAL_ADDRESS FrameBaseAddress +); + +/** Set requested mode of the display. + * + * @param ModeNumber Display mode number. + * @retval EFI_SUCCESS Display set mode success. + * @retval EFI_DEVICE_ERROR If mode not found/supported. + * +**/ +EFI_STATUS +LcdSetMode ( + IN UINT32 ModeNumber +); + + +/** De-initializes the display. + * +**/ +VOID +LcdShutdown ( + VOID +); + +#endif /* LCD_HW_H_ */ diff --git a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h b/ArmPlatformP= kg/Include/Library/LcdPlatformLib.h index d357c22c46b62966859793372c447883e12e1e80..78b1780d82b8b698924cc55a292= c30728a3e7060 100644 --- a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h +++ b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h @@ -14,6 +14,7 @@ #ifndef LCD_PLATFORM_LIB_H_ #define LCD_PLATFORM_LIB_H_ =20 +#include #include =20 #define LCD_VRAM_SIZE SIZE_8MB diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcd.c b/ArmPlatf= ormPkg/Drivers/HdLcd/HdLcd.c similarity index 95% rename from ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcd.c rename to ArmPlatformPkg/Drivers/HdLcd/HdLcd.c index 8f83d6ecba290994dbced1c11dfdb6d705323c03..d0f678acc7ac539f4e05a9b35ce= 28baded6c7244 100644 --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcd.c +++ b/ArmPlatformPkg/Drivers/HdLcd/HdLcd.c @@ -19,8 +19,7 @@ #include =20 #include - -#include "LcdGraphicsOutputDxe.h" +#include =20 #define BYTES_PER_PIXEL 4 =20 diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputD= xe.c b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c index c40c8e0fa6f4b5f7798aeb3c8bf3f261f14cb67b..e47142319045783cf98243a1372= d933d89718922 100644 --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c +++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c @@ -20,6 +20,8 @@ =20 #include =20 +#include + #include "LcdGraphicsOutputDxe.h" =20 /********************************************************************** diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111Lcd.c b/ArmPl= atformPkg/Drivers/PL111Lcd/PL111Lcd.c similarity index 95% rename from ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111Lcd.c rename to ArmPlatformPkg/Drivers/PL111Lcd/PL111Lcd.c index 4bad2367982e16d5d23c4eab2e6d91bf7db1c031..439f4f9c1fd7c6339cfa75287f3= fa3718de34d92 100644 --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111Lcd.c +++ b/ArmPlatformPkg/Drivers/PL111Lcd/PL111Lcd.c @@ -11,13 +11,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. =20 **/ - +#include #include #include =20 #include - -#include "LcdGraphicsOutputDxe.h" +#include =20 /********************************************************************** * --=20 Guid("CE165669-3EF3-493F-B85D-6190EE5B9759") _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel