]> xenbits.xensource.com Git - seabios.git/commitdiff
SeaVGABios/cbvga: Advertise correct pixel format
authorPatrick Rudolph <siro@das-labor.org>
Mon, 29 May 2017 17:25:10 +0000 (19:25 +0200)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 12 Jun 2017 19:10:05 +0000 (15:10 -0400)
Accumulate the pixel format's bits instead relying on coreboot's
bits_per_pixel, which says nothing about the active pixel format.

Allows VBE to correctly advertise XRGB8 and BGRX8 framebuffer formats,
commonly used by coreboot.

Fixes at least Windows Bootloader and gfxboot.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
vgasrc/cbvga.c

index b8216a9e61ab4c047c92ee7c05d41bddc6048c7b..39ffdbb26796f604126173c9182309e74d7e31f5 100644 (file)
@@ -1,6 +1,7 @@
 // Simple framebuffer vgabios for use with coreboot native vga init.
 //
 // Copyright (C) 2014  Kevin O'Connor <kevin@koconnor.net>
+// Copyright (C) 2017  Patrick Rudolph <siro@das-labor.org>
 //
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
@@ -164,7 +165,8 @@ cbvga_setup(void)
     }
 
     u64 addr = GET_FARVAR(0, cbfb->physical_address);
-    u8 bpp = GET_FARVAR(0, cbfb->bits_per_pixel);
+    u8 bpp = cbfb->blue_mask_size + cbfb->green_mask_size
+             + cbfb->red_mask_size + cbfb->reserved_mask_size;
     u32 xlines = GET_FARVAR(0, cbfb->x_resolution);
     u32 ylines = GET_FARVAR(0, cbfb->y_resolution);
     u32 linelength = GET_FARVAR(0, cbfb->bytes_per_line);