On Wed, Mar 15, 2017 at 11:23:05PM +0100, Gert Menke wrote:
Hi again,
okay, it seems I don't have any 24bpp vesa modes, only 32bpp. But SeaBIOS assumes that BMPs are 24bpp only. This patch makes SeaBIOS support 32bpp BMPs.
Thanks.
FYI, patches for seabios should be sent via 'git send-email' or 'git format-patch' and they should contain a signed-off-by line in the description. Also, tabs should be avoided (in favor of spaces). See: https://www.seabios.org/Contributing
diff --git a/src/bmp.c b/src/bmp.c index 96a2b3f..e9bc6a3 100644 --- a/src/bmp.c +++ b/src/bmp.c @@ -56,10 +56,9 @@ typedef struct tagRGBQUAD {
- arrange horizontal pixel data, add extra space in the dest buffer
for every line
*/ -static void raw_data_format_adjust_24bpp(u8 *src, u8 *dest, int width,
int height, int bytes_per_line_dest)
+static void raw_data_format_adjust(u8 *src, u8 *dest, int width,
int height, int bytes_per_line_src, int bytes_per_line_dest)
{
- int bytes_per_line_src = 3 * width; int i; for (i = 0 ; i < height ; i++) { memcpy(dest + i * bytes_per_line_dest,
@@ -95,10 +94,11 @@ int bmp_decode(struct bmp_decdata *bmp, unsigned char *data, int data_size) }
/* get bmp properties */ -void bmp_get_size(struct bmp_decdata *bmp, int *width, int *height) +void bmp_get_info(struct bmp_decdata *bmp, int *width, int *height, int *bpp) { *width = bmp->width; *height = bmp->height;
- *bpp = bmp->bpp;
}
Wouldn't it be better to adjust raw_data_format_adjust() to convert from 24bpp bmps to 32bit mode automatically? Seems annoying to have to store a 32bit bmp in flash. Doing so would also simplify enable_bootsplash() and find_videomode() too.
-Kevin