[SeaBIOS] [PATCH v6 1/3] Boot up with a splash picture configurable

Kevin O'Connor kevin at koconnor.net
Fri Jul 8 02:05:58 CEST 2011


On Thu, Jul 07, 2011 at 05:38:09PM +0800, Wayne Xia wrote:
> added an option to let seabios show BMP file as a logo.
> 
> Signed-off-by: Wayne Xia <xiawenc at linux.vnet.ibm.com>

Thanks.  As before, I'm okay with patch 1 and 2 and if there are no
other comments I'll commit them.

I don't see the need for patch 3 - if someone wants to show a
bootsplash they can pass in "menu=on" or QEmu can imply "menu=on" when
a bootsplash is requested.

[...]
> +static void raw_data_format_adjust_24bpp(u8 *src, u8 *dest, int width,
> +                                        int height, int bytes_per_line_dest)
> +{
> +    int cy = height;
> +    u8 *pd, *ps, *pd_valid, *ps_lastline;
> +    int bytes_per_line_src = 3 * width;
> +    while (cy > 0) {
> +        ps = bytes_per_line_src*cy + src - 1;
> +        /*  verical line sequence reverse */
> +        pd = bytes_per_line_dest * (height - cy + 1) + dest - 1;
> +        ps_lastline = ps - bytes_per_line_src;
> +        pd_valid = pd - (bytes_per_line_dest - bytes_per_line_src);
> +        while (pd > pd_valid) {
> +            *(pd--) = 0;
> +        }
> +        while (ps > ps_lastline) {
> +            *(pd--) = *(ps--);
> +        }
> +        cy--;
> +    }
> +}

Can't this be written as:

static void raw_data_format_adjust_24bpp(u8 *src, u8 *dest, int width,
                                         int height, int bytes_per_line_dest)
{
    int bytes_per_line_src = 3 * width;
    int i;
    for (i=0; i<height; i++)
        memcpy(&dest[(height - i - 1) * bytes_per_line_dest]
               , &src[i * bytes_per_line_src]
               , bytes_per_line_src);
}

[...]
> @@ -241,7 +293,10 @@ done:
>      free(picture);
>      free(vesa_info);
>      free(mode_info);
> -    free(jpeg);
> +    if (jpeg != NULL)
> +        free(jpeg);
> +    if (bmp != NULL)
> +        free(bmp);

Minor nit - free() is defined to check for NULL, so it is safe to just
unconditionally call free().

-Kevin



More information about the SeaBIOS mailing list