Merge tag 'efi-2019-10-rc4-4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
[oweals/u-boot.git] / lib / efi_loader / efi_gop.c
index c1a814cd43a2ba87f7d2a1471ac89d829923134d..1511e3bdb4220ce8a61be4ee4aa56b456ccad0f9 100644 (file)
@@ -319,7 +319,7 @@ static efi_status_t gop_blt_vid_to_buf(struct efi_gop *this,
  * details.
  *
  * @this:              the graphical output protocol
- * @model_number:      the mode to be set
+ * @mode_number:       the mode to be set
  * Return:             status code
  */
 static efi_status_t EFIAPI gop_set_mode(struct efi_gop *this, u32 mode_number)
@@ -503,26 +503,26 @@ efi_status_t efi_gop_register(void)
        gopobj->mode.info = &gopobj->info;
        gopobj->mode.info_size = sizeof(gopobj->info);
 
+       gopobj->mode.fb_base = fb_base;
+       gopobj->mode.fb_size = fb_size;
+
+       gopobj->info.version = 0;
+       gopobj->info.width = col;
+       gopobj->info.height = row;
 #ifdef CONFIG_DM_VIDEO
        if (bpix == VIDEO_BPP32)
 #else
        if (bpix == LCD_COLOR32)
 #endif
        {
-               /*
-                * With 32bit color space we can directly expose the frame
-                * buffer
-                */
-               gopobj->mode.fb_base = fb_base;
-               gopobj->mode.fb_size = fb_size;
+               gopobj->info.pixel_format = EFI_GOT_BGRA8;
+       } else {
+               gopobj->info.pixel_format = EFI_GOT_BITMASK;
+               gopobj->info.pixel_bitmask[0] = 0xf800; /* red */
+               gopobj->info.pixel_bitmask[1] = 0x07e0; /* green */
+               gopobj->info.pixel_bitmask[2] = 0x001f; /* blue */
        }
-
-       gopobj->info.version = 0;
-       gopobj->info.width = col;
-       gopobj->info.height = row;
-       gopobj->info.pixel_format = EFI_GOT_BGRA8;
        gopobj->info.pixels_per_scanline = col;
-
        gopobj->bpix = bpix;
        gopobj->fb = fb;