diff options
author | Girish Pathak <girish.pathak at arm.com> | 2017-09-26 21:15:25 +0100 |
---|---|---|
committer | Leif Lindholm <leif.lindholm@linaro.org> | 2018-04-23 12:01:11 +0100 |
commit | 268aad67445c3a928bc0a84adb008031de980a93 (patch) | |
tree | a80afc08ba512cf6d2210d798ea2b7a0d187886f /ArmPlatformPkg/Library | |
parent | fe787dfb0f94669ce091f80601f2e654eff5728f (diff) | |
download | edk2-268aad67445c3a928bc0a84adb008031de980a93.tar.gz edk2-268aad67445c3a928bc0a84adb008031de980a93.tar.bz2 edk2-268aad67445c3a928bc0a84adb008031de980a93.zip |
ArmPlatformPkg: PCD to swap red/blue format for HDLCD
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>
Diffstat (limited to 'ArmPlatformPkg/Library')
-rw-r--r-- | ArmPlatformPkg/Library/HdLcd/HdLcd.c | 11 | ||||
-rw-r--r-- | ArmPlatformPkg/Library/HdLcd/HdLcd.inf | 4 |
2 files changed, 13 insertions, 2 deletions
diff --git a/ArmPlatformPkg/Library/HdLcd/HdLcd.c b/ArmPlatformPkg/Library/HdLcd/HdLcd.c index 96f2bf437f..5396dde3ba 100644 --- a/ArmPlatformPkg/Library/HdLcd/HdLcd.c +++ b/ArmPlatformPkg/Library/HdLcd/HdLcd.c @@ -73,6 +73,8 @@ LcdSetMode ( SCAN_TIMINGS *Horizontal;
SCAN_TIMINGS *Vertical;
+ EFI_GRAPHICS_PIXEL_FORMAT PixelFormat;
+
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION ModeInfo;
// Set the video mode timings and other relevant information
@@ -96,7 +98,14 @@ LcdSetMode ( return Status;
}
- if (ModeInfo.PixelFormat == 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 platform
+ PixelFormat = FixedPcdGetBool (PcdArmHdLcdSwapBlueRedSelect)
+ ? PixelRedGreenBlueReserved8BitPerColor
+ : PixelBlueGreenRedReserved8BitPerColor;
+
+ if (ModeInfo.PixelFormat == 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/Library/HdLcd/HdLcd.inf index 67aad05d21..7f2ba7bf1c 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.<BR>
+# Copyright (c) 2011-2018, ARM Ltd. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -40,3 +40,5 @@ [FixedPcd]
gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase
+ gArmPlatformTokenSpaceGuid.PcdArmHdLcdSwapBlueRedSelect
+
|