[PATCH 2/3] efi_loader: GOP: Add 30bpp support

Simon Glass sjg at chromium.org
Sat Sep 25 15:40:57 CEST 2021


Hi Mark,

On Thu, 16 Sept 2021 at 07:02, Mark Kettenis <kettenis at openbsd.org> wrote:
>
> Provide correct framebuffer information for 30bpp modes.
>
> Signed-off-by: Mark Kettenis <kettenis at openbsd.org>
> ---
>  lib/efi_loader/efi_gop.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/lib/efi_loader/efi_gop.c b/lib/efi_loader/efi_gop.c
> index 1206b2d7a2..42bf49b184 100644
> --- a/lib/efi_loader/efi_gop.c
> +++ b/lib/efi_loader/efi_gop.c
> @@ -227,6 +227,7 @@ static efi_uintn_t gop_get_bpp(struct efi_gop *this)
>
>         switch (gopobj->bpix) {
>  #ifdef CONFIG_DM_VIDEO
> +       case VIDEO_BPP30:
>         case VIDEO_BPP32:
>  #else
>         case LCD_COLOR32:
> @@ -468,6 +469,7 @@ efi_status_t efi_gop_register(void)
>         switch (bpix) {
>  #ifdef CONFIG_DM_VIDEO
>         case VIDEO_BPP16:
> +       case VIDEO_BPP30:
>         case VIDEO_BPP32:
>  #else
>         case LCD_COLOR32:
> @@ -518,6 +520,14 @@ efi_status_t efi_gop_register(void)
>  #endif
>         {
>                 gopobj->info.pixel_format = EFI_GOT_BGRA8;
> +#ifdef CONFIG_DM_VIDEO

Can avoid #ifdefs please? Does this work?

if (IS_ENABLED(CONFIG_DM_VIDEO) && IS_ENABLED(CONFIG_VIDEO_BPP30) &&
bpix == VIDEO_BPP30)

Heinrich might know if we can just require DM_VIDEO.

> +       } else if (bpix == VIDEO_BPP30) {
> +               gopobj->info.pixel_format = EFI_GOT_BITMASK;
> +               gopobj->info.pixel_bitmask[0] = 0x3ff00000; /* red */
> +               gopobj->info.pixel_bitmask[1] = 0x000ffc00; /* green */
> +               gopobj->info.pixel_bitmask[2] = 0x000003ff; /* blue */
> +               gopobj->info.pixel_bitmask[3] = 0xc0000000; /* reserved */
> +#endif
>         } else {
>                 gopobj->info.pixel_format = EFI_GOT_BITMASK;
>                 gopobj->info.pixel_bitmask[0] = 0xf800; /* red */
> --
> 2.33.0
>

Tested on: Macbook Air M1
Tested-by: Simon Glass <sjg at chromium.org>

Regards,
Simon


More information about the U-Boot mailing list