From nobody Tue Feb 10 04:32:57 2026 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 1521562371032248.6122285467361; Tue, 20 Mar 2018 09:12:51 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5BAEB2264D253; Tue, 20 Mar 2018 09:06:01 -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 D005E22603AEB for ; Tue, 20 Mar 2018 09:05:53 -0700 (PDT) Received: from E107875.Emea.Arm.com (e107875.emea.arm.com [10.10.1.104]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id w2KGCHM1016075; Tue, 20 Mar 2018 16:12:21 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=girish.pathak@arm.com; receiver=edk2-devel@lists.01.org From: Girish Pathak To: edk2-devel@lists.01.org Date: Tue, 20 Mar 2018 16:12:07 +0000 Message-Id: <20180320161212.79120-12-girish.pathak@arm.com> X-Mailer: git-send-email 2.13.3.windows.1 In-Reply-To: <20180320161212.79120-1-girish.pathak@arm.com> References: <20180320161212.79120-1-girish.pathak@arm.com> Subject: [edk2] [PATCH v3 11/16] ArmPlatformPkg: PCD to swap red/blue format for HDLCD 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: nd@arm.com, Stephanie.Hughes-Fitt@arm.com, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org 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 This change adds a new PCD PcdArmHdlcdSwapBlueRedSelect to swap values for HDLCD RED_SELECT and BLUE_SELECT registers on platforms where blue and red hardware lines are swapped. If set to TRUE in the platform dsc, HDLCD library will swap the values while setting RED_SELECT and BLUE_SELECT registers. The default value of the PCD is FALSE. NOTE: The motive for this is that a discrepancy in the Red/Blue lines exists between some VersatileExpress platforms. Rather than have divergent code, this build switch allows a simple, pragmatic solution. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Girish Pathak Signed-off-by: Evan Lloyd Reviewed-by: Evan Lloyd --- Notes: v3: - Please don't nest CPP and C conditionals like this. It is difficult to follow, and results in poor build time coverage (the non-taken branch at the CPP level is never seen by the compiler) [Ard] =20 Done [Girish] ArmPlatformPkg/ArmPlatformPkg.dec | 3 +++ ArmPlatformPkg/Library/HdLcd/HdLcd.c | 11 ++++++++++- ArmPlatformPkg/Library/HdLcd/HdLcd.inf | 4 +++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ArmPlatformPkg/ArmPlatformPkg.dec b/ArmPlatformPkg/ArmPlatform= Pkg.dec index 378bee9cbc9e4bd50c37b38156016424e24cba73..5231ea822f05c2f281a6190d6ea= e0fc7d0bc0cb3 100644 --- a/ArmPlatformPkg/ArmPlatformPkg.dec +++ b/ArmPlatformPkg/ArmPlatformPkg.dec @@ -104,6 +104,9 @@ [PcdsFixedAtBuild.common] # Default is set to UEFI console font format PixelBlueGreenRedReserved8B= itPerColor gArmPlatformTokenSpaceGuid.PcdGopPixelFormat|0x00000001|UINT32|0x00000040 =20 + ## If set, this will swap settings for HDLCD RED_SELECT and BLUE_SELECT = registers + gArmPlatformTokenSpaceGuid.PcdArmHdLcdSwapBlueRedSelect|FALSE|BOOLEAN|0x= 00000045 + [PcdsFixedAtBuild.common,PcdsDynamic.common] ## PL031 RealTimeClock gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x0|UINT32|0x00000024 diff --git a/ArmPlatformPkg/Library/HdLcd/HdLcd.c b/ArmPlatformPkg/Library/= HdLcd/HdLcd.c index 96f2bf437fbabd2509f860c67c5442def5b5f03d..5396dde3ba6cd147a8333241a9b= c71ab05d7fee3 100644 --- a/ArmPlatformPkg/Library/HdLcd/HdLcd.c +++ b/ArmPlatformPkg/Library/HdLcd/HdLcd.c @@ -73,6 +73,8 @@ LcdSetMode ( SCAN_TIMINGS *Horizontal; SCAN_TIMINGS *Vertical; =20 + EFI_GRAPHICS_PIXEL_FORMAT PixelFormat; + EFI_GRAPHICS_OUTPUT_MODE_INFORMATION ModeInfo; =20 // Set the video mode timings and other relevant information @@ -96,7 +98,14 @@ LcdSetMode ( return Status; } =20 - if (ModeInfo.PixelFormat =3D=3D PixelBlueGreenRedReserved8BitPerColor) { + // By default PcdArmHdLcdSwapBlueRedSelect is set to false + // However on the Juno platform HW lines for BLUE and RED are swapped + // Therefore PcdArmHdLcdSwapBlueRedSelect is set to TRUE for the Juno pl= atform + PixelFormat =3D FixedPcdGetBool (PcdArmHdLcdSwapBlueRedSelect) + ? PixelRedGreenBlueReserved8BitPerColor + : PixelBlueGreenRedReserved8BitPerColor; + + if (ModeInfo.PixelFormat =3D=3D PixelFormat) { MmioWrite32 (HDLCD_REG_RED_SELECT, (8 << 8) | 16); MmioWrite32 (HDLCD_REG_BLUE_SELECT, (8 << 8) | 0); } else { diff --git a/ArmPlatformPkg/Library/HdLcd/HdLcd.inf b/ArmPlatformPkg/Librar= y/HdLcd/HdLcd.inf index 67aad05d210b95b2d23b8e52e4392685efcf3795..7f2ba7bf1c602f4c214eacaa642= 5bf9ec7e6da15 100644 --- a/ArmPlatformPkg/Library/HdLcd/HdLcd.inf +++ b/ArmPlatformPkg/Library/HdLcd/HdLcd.inf @@ -2,7 +2,7 @@ # # Component description file for HDLCD module # -# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.
+# Copyright (c) 2011-2018, 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 @@ -40,3 +40,5 @@ [LibraryClasses] =20 [FixedPcd] gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase + gArmPlatformTokenSpaceGuid.PcdArmHdLcdSwapBlueRedSelect + --=20 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel