summaryrefslogtreecommitdiff
path: root/Platform
diff options
context:
space:
mode:
Diffstat (limited to 'Platform')
-rw-r--r--Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpress.c23
-rw-r--r--Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpressLib.inf1
-rw-r--r--Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpress.c38
-rw-r--r--Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf1
4 files changed, 35 insertions, 28 deletions
diff --git a/Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpress.c b/Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpress.c
index 0c3a4efd6d..f7cae39c9c 100644
--- a/Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpress.c
+++ b/Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpress.c
@@ -15,7 +15,6 @@
#include <PiDxe.h>
#include <Library/ArmPlatformSysConfigLib.h>
-#include <Library/IoLib.h>
#include <Library/PcdLib.h>
#include <Library/DebugLib.h>
#include <Library/DxeServicesTableLib.h>
@@ -93,6 +92,10 @@ EFI_EDID_ACTIVE_PROTOCOL mEdidActive = {
@param[in] Handle Handle to the LCD device instance.
@retval EFI_SUCCESS Plaform library initialized successfully.
+ @retval EFI_UNSUPPORTED PcdGopPixelFormat must be
+ PixelRedGreenBlueReserved8BitPerColor OR
+ PixelBlueGreenRedReserved8BitPerColor
+ any other format is not supported.
@retval !(EFI_SUCCESS) Other errors.
**/
EFI_STATUS
@@ -101,6 +104,17 @@ LcdPlatformInitializeDisplay (
)
{
EFI_STATUS Status;
+ EFI_GRAPHICS_PIXEL_FORMAT PixelFormat;
+
+ // PixelBitMask and PixelBltOnly pixel formats are not supported
+ PixelFormat = FixedPcdGet32 (PcdGopPixelFormat);
+ if (PixelFormat != PixelRedGreenBlueReserved8BitPerColor &&
+ PixelFormat != PixelBlueGreenRedReserved8BitPerColor) {
+
+ ASSERT (PixelFormat == PixelRedGreenBlueReserved8BitPerColor ||
+ PixelFormat == PixelBlueGreenRedReserved8BitPerColor);
+ return EFI_UNSUPPORTED;
+ }
// Set the FPGA multiplexer to select the video output from the
// motherboard or the daughterboard
@@ -282,12 +296,7 @@ LcdPlatformQueryMode (
Info->VerticalResolution = mDisplayModes[ModeNumber].Vertical.Resolution;
Info->PixelsPerScanLine = mDisplayModes[ModeNumber].Horizontal.Resolution;
- /* Bits per Pixel is always LCD_BITS_PER_PIXEL_24 */
- Info->PixelFormat = PixelRedGreenBlueReserved8BitPerColor;
- Info->PixelInformation.RedMask = LCD_24BPP_RED_MASK;
- Info->PixelInformation.GreenMask = LCD_24BPP_GREEN_MASK;
- Info->PixelInformation.BlueMask = LCD_24BPP_BLUE_MASK;
- Info->PixelInformation.ReservedMask = LCD_24BPP_RESERVED_MASK;
+ Info->PixelFormat = FixedPcdGet32 (PcdGopPixelFormat);
return EFI_SUCCESS;
}
diff --git a/Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpressLib.inf b/Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpressLib.inf
index eb2a3c94b8..9b0d358846 100644
--- a/Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpressLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpressLib.inf
@@ -41,3 +41,4 @@
[FixedPcd]
gArmVExpressTokenSpaceGuid.PcdHdLcdVideoModeOscId
+ gArmPlatformTokenSpaceGuid.PcdGopPixelFormat
diff --git a/Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpress.c b/Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpress.c
index a6fab279e3..2f4814a2ad 100644
--- a/Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpress.c
+++ b/Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpress.c
@@ -149,7 +149,12 @@ EFI_EDID_ACTIVE_PROTOCOL mEdidActive = {
/** PL111 Platform specific initialization function.
@param[in] Handle Handle to the LCD device instance.
+
@retval EFI_SUCCESS Plaform library initialized successfully.
+ @retval EFI_UNSUPPORTED PcdGopPixelFormat must be
+ PixelRedGreenBlueReserved8BitPerColor OR
+ PixelBlueGreenRedReserved8BitPerColor
+ any other format is not supported
@retval !(EFI_SUCCESS) Other errors.
**/
EFI_STATUS
@@ -158,6 +163,17 @@ LcdPlatformInitializeDisplay (
)
{
EFI_STATUS Status;
+ EFI_GRAPHICS_PIXEL_FORMAT PixelFormat;
+
+ // PixelBitMask and PixelBltOnly pixel formats are not supported
+ PixelFormat = FixedPcdGet32 (PcdGopPixelFormat);
+ if (PixelFormat != PixelRedGreenBlueReserved8BitPerColor &&
+ PixelFormat != PixelBlueGreenRedReserved8BitPerColor) {
+
+ ASSERT (PixelFormat == PixelRedGreenBlueReserved8BitPerColor ||
+ PixelFormat == PixelBlueGreenRedReserved8BitPerColor);
+ return EFI_UNSUPPORTED;
+ }
// Set the FPGA multiplexer to select the video output from the motherboard
// or the daughterboard
@@ -372,27 +388,7 @@ LcdPlatformQueryMode (
Info->VerticalResolution = mDisplayModes[ModeNumber].Vertical.Resolution;
Info->PixelsPerScanLine = mDisplayModes[ModeNumber].Horizontal.Resolution;
- switch (mDisplayModes[ModeNumber].Bpp) {
- case LCD_BITS_PER_PIXEL_24:
- Info->PixelFormat = PixelRedGreenBlueReserved8BitPerColor;
- Info->PixelInformation.RedMask = LCD_24BPP_RED_MASK;
- Info->PixelInformation.GreenMask = LCD_24BPP_GREEN_MASK;
- Info->PixelInformation.BlueMask = LCD_24BPP_BLUE_MASK;
- Info->PixelInformation.ReservedMask = LCD_24BPP_RESERVED_MASK;
- break;
-
- case LCD_BITS_PER_PIXEL_16_555:
- case LCD_BITS_PER_PIXEL_16_565:
- case LCD_BITS_PER_PIXEL_12_444:
- case LCD_BITS_PER_PIXEL_8:
- case LCD_BITS_PER_PIXEL_4:
- case LCD_BITS_PER_PIXEL_2:
- case LCD_BITS_PER_PIXEL_1:
- default:
- // These are not supported
- ASSERT (FALSE);
- break;
- }
+ Info->PixelFormat = FixedPcdGet32 (PcdGopPixelFormat);
return EFI_SUCCESS;
}
diff --git a/Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf b/Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf
index f480000936..2bf14f999e 100644
--- a/Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf
@@ -42,3 +42,4 @@
[FixedPcd]
gArmVExpressTokenSpaceGuid.PcdPL111LcdMaxMode
gArmVExpressTokenSpaceGuid.PcdPL111LcdVideoModeOscId
+ gArmPlatformTokenSpaceGuid.PcdGopPixelFormat