X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPlatformPkg%2FLibrary%2FPL111Lcd%2FPL111Lcd.c;h=0496376fffe514651a70f58a3316894a4b2b319c;hp=c9e2736911881fc36b51562b9259b7bccf30747d;hb=fe787dfb0f94669ce091f80601f2e654eff5728f;hpb=262c88461b6bf6fab2b13cef9421fbd777357ac3 diff --git a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c index c9e2736911..0496376fff 100644 --- a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c +++ b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c @@ -76,7 +76,6 @@ LcdInitialize ( @retval EFI_SUCCESS Display mode set successfuly. @retval !(EFI_SUCCESS) Other errors. - **/ EFI_STATUS LcdSetMode ( @@ -89,6 +88,8 @@ LcdSetMode ( UINT32 LcdControl; LCD_BPP LcdBpp; + EFI_GRAPHICS_OUTPUT_MODE_INFORMATION ModeInfo; + // Set the video mode timings and other relevant information Status = LcdPlatformGetTimings ( ModeNumber, @@ -109,6 +110,13 @@ LcdSetMode ( return Status; } + // Get the pixel format information + Status = LcdPlatformQueryMode (ModeNumber, &ModeInfo); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + // Disable the CLCD_LcdEn bit MmioAnd32 (PL111_REG_LCD_CONTROL, ~PL111_CTRL_LCD_EN); @@ -142,7 +150,10 @@ LcdSetMode ( // PL111_REG_LCD_CONTROL LcdControl = PL111_CTRL_LCD_EN | PL111_CTRL_LCD_BPP (LcdBpp) | - PL111_CTRL_LCD_TFT | PL111_CTRL_LCD_PWR | PL111_CTRL_BGR; + PL111_CTRL_LCD_TFT | PL111_CTRL_LCD_PWR; + if (ModeInfo.PixelFormat == PixelBlueGreenRedReserved8BitPerColor) { + LcdControl |= PL111_CTRL_BGR; + } MmioWrite32 (PL111_REG_LCD_CONTROL, LcdControl); return EFI_SUCCESS;