]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg: PCD to swap red/blue format for HDLCD
authorGirish Pathak <girish.pathak at arm.com>
Tue, 26 Sep 2017 20:15:25 +0000 (21:15 +0100)
committerLeif Lindholm <leif.lindholm@linaro.org>
Mon, 23 Apr 2018 11:01:11 +0000 (12:01 +0100)
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 <girish.pathak@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPlatformPkg/ArmPlatformPkg.dec
ArmPlatformPkg/Library/HdLcd/HdLcd.c
ArmPlatformPkg/Library/HdLcd/HdLcd.inf

index 99ca4e1822652f3768b1b1ead365671bd2a9ccc1..372cf2dc09586ab41d97b915b0601ea495161d5f 100644 (file)
   # Default is set to UEFI console font format PixelBlueGreenRedReserved8BitPerColor\r
   gArmPlatformTokenSpaceGuid.PcdGopPixelFormat|0x00000001|UINT32|0x00000040\r
 \r
+  ## If set, this will swap settings for HDLCD RED_SELECT and BLUE_SELECT registers\r
+  gArmPlatformTokenSpaceGuid.PcdArmHdLcdSwapBlueRedSelect|FALSE|BOOLEAN|0x00000045\r
+\r
 [PcdsFixedAtBuild.common,PcdsDynamic.common]\r
   ## PL031 RealTimeClock\r
   gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x0|UINT32|0x00000024\r
index 96f2bf437fbabd2509f860c67c5442def5b5f03d..5396dde3ba6cd147a8333241a9bc71ab05d7fee3 100644 (file)
@@ -73,6 +73,8 @@ LcdSetMode (
   SCAN_TIMINGS      *Horizontal;\r
   SCAN_TIMINGS      *Vertical;\r
 \r
+  EFI_GRAPHICS_PIXEL_FORMAT  PixelFormat;\r
+\r
   EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  ModeInfo;\r
 \r
   // Set the video mode timings and other relevant information\r
@@ -96,7 +98,14 @@ LcdSetMode (
     return Status;\r
   }\r
 \r
-  if (ModeInfo.PixelFormat == PixelBlueGreenRedReserved8BitPerColor) {\r
+  // By default PcdArmHdLcdSwapBlueRedSelect is set to false\r
+  // However on the Juno platform HW lines for BLUE and RED are swapped\r
+  // Therefore PcdArmHdLcdSwapBlueRedSelect is set to TRUE for the Juno platform\r
+  PixelFormat = FixedPcdGetBool (PcdArmHdLcdSwapBlueRedSelect)\r
+                ? PixelRedGreenBlueReserved8BitPerColor\r
+                : PixelBlueGreenRedReserved8BitPerColor;\r
+\r
+  if (ModeInfo.PixelFormat == PixelFormat) {\r
     MmioWrite32 (HDLCD_REG_RED_SELECT,  (8 << 8) | 16);\r
     MmioWrite32 (HDLCD_REG_BLUE_SELECT, (8 << 8) | 0);\r
   } else {\r
index 67aad05d210b95b2d23b8e52e4392685efcf3795..7f2ba7bf1c602f4c214eacaa6425bf9ec7e6da15 100644 (file)
@@ -2,7 +2,7 @@
 #\r
 #  Component description file for HDLCD module\r
 #\r
-#  Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
+#  Copyright (c) 2011-2018, ARM Ltd. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -40,3 +40,5 @@
 \r
 [FixedPcd]\r
   gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase\r
+  gArmPlatformTokenSpaceGuid.PcdArmHdLcdSwapBlueRedSelect\r
+\r