From nobody Thu Dec 26 12:58:30 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 1513967682000871.7962004788452; Fri, 22 Dec 2017 10:34:42 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 346B922198F6A; Fri, 22 Dec 2017 10:29:41 -0800 (PST) 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 2FF1522225C17 for ; Fri, 22 Dec 2017 10:29:36 -0800 (PST) Received: from E111747.Emea.Arm.com (e111747.emea.arm.com [10.1.25.75]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id vBMIYOYX007680; Fri, 22 Dec 2017 18:34:24 GMT 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: Fri, 22 Dec 2017 18:34:07 +0000 Message-Id: <20171222183418.8616-3-evan.lloyd@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171222183418.8616-1-evan.lloyd@arm.com> References: <20171222183418.8616-1-evan.lloyd@arm.com> Subject: [edk2] [PATCH v2 02/13] ArmPlatformPkg: Tidy Lcd code: Updated comments 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: , 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 There is no functional modification in this change some comments are modified and a few new comments are added. This is to prevent mixing formatting changes with functional changes. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Girish Pathak Signed-off-by: Evan Lloyd --- ArmPlatformPkg/Include/Library/LcdPlatformLib.h | 92 ++= +++++++++++++----- ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c | 20 ++= --- ArmPlatformPkg/Library/HdLcd/HdLcd.c | 29 ++= +++- ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c | 24 ++= ++- 4 files changed, 127 insertions(+), 38 deletions(-) diff --git a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h b/ArmPlatformP= kg/Include/Library/LcdPlatformLib.h index b9316ec8de8425a83e2f627f5c24821ff9a2f750..2a70307031fc21c8fb0d655d358= ca9a102a95920 100644 --- a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h +++ b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h @@ -18,9 +18,7 @@ =20 #define LCD_VRAM_SIZE SIZE_8MB =20 -// // Modes definitions -// #define VGA 0 #define SVGA 1 #define XGA 2 @@ -29,9 +27,7 @@ #define UXGA 5 #define HD 6 =20 -// // VGA Mode: 640 x 480 -// #define VGA_H_RES_PIXELS 640 #define VGA_V_RES_PIXELS 480 #define VGA_OSC_FREQUENCY 23750000 /* 0x016A6570 */ @@ -44,9 +40,7 @@ #define VGA_V_FRONT_PORCH ( 3 - 1) #define VGA_V_BACK_PORCH ( 13 - 1) =20 -// // SVGA Mode: 800 x 600 -// #define SVGA_H_RES_PIXELS 800 #define SVGA_V_RES_PIXELS 600 #define SVGA_OSC_FREQUENCY 38250000 /* 0x0247A610 */ @@ -59,9 +53,7 @@ #define SVGA_V_FRONT_PORCH ( 3 - 1) #define SVGA_V_BACK_PORCH ( 17 - 1) =20 -// // XGA Mode: 1024 x 768 -// #define XGA_H_RES_PIXELS 1024 #define XGA_V_RES_PIXELS 768 #define XGA_OSC_FREQUENCY 63500000 /* 0x03C8EEE0 */ @@ -74,9 +66,7 @@ #define XGA_V_FRONT_PORCH ( 3 - 1) #define XGA_V_BACK_PORCH ( 23 - 1) =20 -// // SXGA Mode: 1280 x 1024 -// #define SXGA_H_RES_PIXELS 1280 #define SXGA_V_RES_PIXELS 1024 #define SXGA_OSC_FREQUENCY 109000000 /* 0x067F3540 */ @@ -89,9 +79,7 @@ #define SXGA_V_FRONT_PORCH ( 3 - 1) #define SXGA_V_BACK_PORCH ( 29 - 1) =20 -// // WSXGA+ Mode: 1680 x 1050 -// #define WSXGA_H_RES_PIXELS 1680 #define WSXGA_V_RES_PIXELS 1050 #define WSXGA_OSC_FREQUENCY 147000000 /* 0x08C30AC0 */ @@ -104,9 +92,7 @@ #define WSXGA_V_FRONT_PORCH ( 4 - 1) #define WSXGA_V_BACK_PORCH ( 41 - 1) =20 -// // UXGA Mode: 1600 x 1200 -// #define UXGA_H_RES_PIXELS 1600 #define UXGA_V_RES_PIXELS 1200 #define UXGA_OSC_FREQUENCY 161000000 /* 0x0998AA40 */ @@ -119,9 +105,7 @@ #define UXGA_V_FRONT_PORCH ( 3 - 1) #define UXGA_V_BACK_PORCH ( 38 - 1) =20 -// // HD Mode: 1920 x 1080 -// #define HD_H_RES_PIXELS 1920 #define HD_V_RES_PIXELS 1080 #define HD_OSC_FREQUENCY 165000000 /* 0x09D5B340 */ @@ -134,10 +118,7 @@ #define HD_V_FRONT_PORCH ( 3 - 1) #define HD_V_BACK_PORCH ( 32 - 1) =20 -// // Colour Masks -// - #define LCD_24BPP_RED_MASK 0x00FF0000 #define LCD_24BPP_GREEN_MASK 0x0000FF00 #define LCD_24BPP_BLUE_MASK 0x000000FF @@ -158,7 +139,7 @@ #define LCD_12BPP_444_BLUE_MASK 0x0000000F #define LCD_12BPP_444_RESERVED_MASK 0x0000F000 =20 -/** The enumeration indexes maps the PL111 LcdBpp values used in the LCD C= ontrol +/** The enumeration maps the PL111 LcdBpp values used in the LCD Control Register **/ typedef enum { @@ -172,33 +153,94 @@ typedef enum { LCD_BITS_PER_PIXEL_12_444 } LCD_BPP; =20 +/** Platform related initialization function. + + @param[in] Handle Handle to the LCD device instance. + + @retval EFI_SUCCESS Plaform library initialized successfully. + @retval !(EFI_SUCCESS) Other errors. +**/ EFI_STATUS LcdPlatformInitializeDisplay ( IN EFI_HANDLE Handle ); =20 +/** Allocate VRAM memory in DRAM for the frame buffer + (unless it is reserved already). + + The allocated address can be used to set the frame buffer. + + @param[out] VramBaseAddress A pointer to the frame buffer address. + @param[out] VramSize A pointer to the size of the frame + buffer in bytes + + @retval EFI_SUCCESS Frame buffer memory allocated successfu= lly. + @retval !(EFI_SUCCESS) Other errors. +**/ EFI_STATUS LcdPlatformGetVram ( OUT EFI_PHYSICAL_ADDRESS* VramBaseAddress, OUT UINTN* VramSize ); =20 +/** Return total number of modes supported. + + Note: Valid mode numbers are 0 to MaxMode - 1 + See Section 12.9 of the UEFI Specification 2.7 + + @retval UINT32 Mode Number. +**/ UINT32 LcdPlatformGetMaxMode ( VOID ); =20 +/** Set the requested display mode. + + @param[in] ModeNumber Mode Number. + + @retval EFI_SUCCESS Mode set successfully. + @retval EFI_INVALID_PARAMETER Requested mode not found. + @retval !(EFI_SUCCESS) Other errors. +**/ EFI_STATUS LcdPlatformSetMode ( IN UINT32 ModeNumber ); =20 +/** Return information for the requested mode number. + + @param[in] ModeNumber Mode Number. + @param[out] Info Pointer for returned mode information + (on success). + + @retval EFI_SUCCESS Mode information for the requested mode + returned successfully. + @retval EFI_INVALID_PARAMETER Requested mode not found. +**/ EFI_STATUS LcdPlatformQueryMode ( IN UINT32 ModeNumber, OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info ); =20 +/** Return display timing information for the requested mode number. + + @param[in] ModeNumber Mode Number. + + @param[out] HRes Pointer to horizontal resolution. + @param[out] HSync Pointer to horizontal sync width. + @param[out] HBackPorch Pointer to horizontal back porch. + @param[out] HFrontPorch Pointer to horizontal front porch. + @param[out] VRes Pointer to vertical resolution. + @param[out] VSync Pointer to vertical sync width. + @param[out] VBackPorch Pointer to vertical back porch. + @param[out] VFrontPorch Pointer to vertical front porch. + + @retval EFI_SUCCESS Display timing information for the reque= sted + mode returned successfully. + @retval EFI_INVALID_PARAMETER Requested mode not found. +**/ EFI_STATUS LcdPlatformGetTimings ( IN UINT32 ModeNumber, @@ -212,6 +254,16 @@ LcdPlatformGetTimings ( OUT UINT32* VFrontPorch ); =20 +/** Return bits per pixel information for a mode number. + + @param[in] ModeNumber Mode Number. + + @param[out] Bpp Pointer to value bits per pixel. + + @retval EFI_SUCCESS Bit per pixel information for the reques= ted + mode returned successfully. + @retval EFI_INVALID_PARAMETER Requested mode not found. +**/ EFI_STATUS LcdPlatformGetBpp ( IN UINT32 ModeNumber, diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputD= xe.c b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c index 948e5692c943cdf62a10f4e6290470d3ccd334f1..72895a751784413d50e2cbf4550= 091b896a4f1d3 100644 --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c +++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c @@ -1,13 +1,14 @@ /** @file + This file implements the Graphics Output protocol for Arm platforms =20 - Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
- This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD= License - which accompanies this distribution. The full text of the license may be= found at - http://opensource.org/licenses/bsd-license.php + Copyright (c) 2011-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 =20 - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPL= IED. + 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. =20 **/ =20 @@ -22,11 +23,6 @@ =20 #include "LcdGraphicsOutputDxe.h" =20 -/** This file implements the Graphics Output protocol on ArmVersatileExpre= ss - using the Lcd controller - -**/ - // // Global variables // diff --git a/ArmPlatformPkg/Library/HdLcd/HdLcd.c b/ArmPlatformPkg/Library/= HdLcd/HdLcd.c index f1fffb1e83173f03f044fc0f4a5ad5c0b864695b..079fe64ccf30dc21c357298511a= eb660faa67e4a 100644 --- a/ArmPlatformPkg/Library/HdLcd/HdLcd.c +++ b/ArmPlatformPkg/Library/HdLcd/HdLcd.c @@ -1,4 +1,5 @@ /** @file + This file contains the platform independent parts of HdLcd =20 Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
=20 @@ -21,10 +22,6 @@ =20 #include "HdLcd.h" =20 -/** This file contains all the bits of the Lcd that are - platform independent. -**/ - STATIC UINTN GetBytesPerPixel ( @@ -51,6 +48,12 @@ GetBytesPerPixel ( } } =20 +/** Initialize display. + + @param[in] VramBaseAddress Address of the frame buffer. + + @retval EFI_SUCCESS Display initialization successful. +**/ EFI_STATUS LcdInitialize ( IN EFI_PHYSICAL_ADDRESS VramBaseAddress @@ -82,6 +85,14 @@ LcdInitialize ( return EFI_SUCCESS; } =20 +/** Set requested mode of the display. + + @param[in] ModeNumber Display mode number. + + @retval EFI_SUCCESS Display mode set successfully. + @retval EFI_DEVICE_ERROR Reurns an error if display timing + information is not available. +**/ EFI_STATUS LcdSetMode ( IN UINT32 ModeNumber @@ -150,6 +161,8 @@ LcdSetMode ( return EFI_SUCCESS; } =20 +/** De-initializes the display. +**/ VOID LcdShutdown (VOID) { @@ -157,6 +170,14 @@ LcdShutdown (VOID) MmioWrite32 (HDLCD_REG_COMMAND, HDLCD_DISABLE); } =20 +/** Check for presence of HDLCD. + + @retval EFI_SUCCESS Returns success if platform implements a = HDLCD + controller. + + @retval EFI_NOT_FOUND HDLCD display controller not found on the + platform +**/ EFI_STATUS LcdIdentify (VOID) { diff --git a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c b/ArmPlatformPkg/Li= brary/PL111Lcd/PL111Lcd.c index 19a5f3c58c63173f6528d7c1eedf51053dbeaf7e..b1b7d0dd19076e3afba0d144af8= d95b9f350006c 100644 --- a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c +++ b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c @@ -1,4 +1,5 @@ /** @file + This file contains the platform independent parts of PL111Lcd =20 Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
=20 @@ -19,9 +20,12 @@ =20 #include "PL111Lcd.h" =20 -/** This file contains all the bits of the PL111 that are - platform independent. +/** Check for presence of PL111. =20 + @retval EFI_SUCCESS Returns success if platform implements a + PL111 controller. + + @retval EFI_NOT_FOUND PL111 display controller not found the plaf= orm. **/ EFI_STATUS LcdIdentify (VOID) @@ -43,6 +47,12 @@ LcdIdentify (VOID) return EFI_NOT_FOUND; } =20 +/** Initialize display. + + @param[in] VramBaseAddress Address of the frame buffer. + + @retval EFI_SUCCESS Initialization of display successful. +**/ EFI_STATUS LcdInitialize ( IN EFI_PHYSICAL_ADDRESS VramBaseAddress @@ -58,6 +68,14 @@ LcdInitialize ( return EFI_SUCCESS; } =20 +/** Set requested mode of the display. + + @param[in] ModeNumbe Display mode number. + + @retval EFI_SUCCESS Display set mode successfuly. + @retval EFI_DEVICE_ERROR It returns an error if display timing + information is not available. +**/ EFI_STATUS LcdSetMode ( IN UINT32 ModeNumber @@ -128,6 +146,8 @@ LcdSetMode ( return EFI_SUCCESS; } =20 +/** De-initializes the display. +*/ VOID LcdShutdown (VOID) { --=20 Guid("CE165669-3EF3-493F-B85D-6190EE5B9759") _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel