[SeaBIOS] Re: Bootsplash.jpg encoding question.

2022-03-31 Thread Daniel Maslowski via SeaBIOS
Hey,

I've been there and ported lodepng to SeaBIOS because I wanted full
resolution graphics:

https://github.com/orangecms/seabios/tree/png

Might need some rebase and adjustments by now. I tried to upstream this,
but mailing list and git turned out a bit tough for me; there was also a
question on the license. You'd find that here in the archives.

Cheers! :-)

On Thu, 31 Mar 2022, 18:19 Michał Żygowski, 
wrote:

> Hi,
>
> On 31.03.2022 15:25, AreYouLoco? via SeaBIOS wrote:
> > Hi,
> >
> > I am trying to make SeaBIOS on Thinkpad T420 running coreboot display
> bootsplash but I am failing to prepare the file.
> >
> > I tried to export file using GIMP and this info:
> >
> https://puri.sm/wp-content/uploads/2017/02/coreboot-splash-gimp-export-options-annotated.png
> >
> > Relevant part of the coreboot log is:
> > 1508[INFO ] Setting up bootsplash in 1366x768@32
> > 1509[INFO ] CBFS: Found 'bootsplash.jpg' @0x46480 size 0x48e5 in mcache
> @0x7ffdd1c8
> > 1510[DEBUG] Bootsplash image resolution: 1366x768
> > 1511[ERROR] Bootsplash could not be decoded. jpeg_decode returned 4.
> >
> > I also tried to add bootsplash.bmp but then it says it didnt found
> bootsplash.jpg.
> >
> > Any hints?
>
> This is actually a little bit tricky. JPEG decoder in SeaBIOS and
> coreboot allows only images which size granularity is 16 bytes. Sooo:
> 768 pixels / 16 = 48 OK. But 1366 pixels / 16 = 85.375 NOT OK.
>
> You are basically hitting ERR_WIDTH_MISMATCH:
> https://github.com/coreboot/coreboot/blob/master/src/lib/jpeg.c#L292
>
> If you have a nice BMP file, it doesn't have the width/height
> granularity constraints unlike JPEG. coreboot will not decode
> bootsplash.bmp, but SeaBIOS gladly consumes BMP files. Additionally I
> recommend compressing it with LZMA (BMPs are heavy). So on your coreboot
> image I would execute:
>
> cbfstool coreboot.rom add -f path/to/bootsplash.bmp -t raw -n
> bootsplash.bmp.lzma -c lzma -r COREBOOT
>
> The command will add the path/to/bootsplash.bmp file to CBFS under the
> name bootsplash.bmp.lzma with LZMA compression enabled. SeaBIOS is able
> to detect .lzma extension in CBFS files and automatically decompresses
> the files if needed.
>
> Additionally compile SeaBIOS with some debug level, SeaBIOS should be
> able to put it into cbmem console:
> https://github.com/coreboot/seabios/blob/master/src/output.c#L46 in case
> you would need to inspect further issues (BMP may have problem with
> incorrect bpp format - bits per pixel, you need to set a correct one in
> GIMP:
> https://github.com/coreboot/seabios/blob/master/src/bootsplash.c#L178).
>
> Good luck.
> --
> Michał Żygowski
> Firmware Engineer
> GPG: 6B5BA214D21FCEB2
> https://3mdeb.com | @3mdeb_com
> ___
> SeaBIOS mailing list -- seabios@seabios.org
> To unsubscribe send an email to seabios-le...@seabios.org
>
___
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-le...@seabios.org


[SeaBIOS] [PATCH 1/1] sercon: do not screwup the xterm on the serial console

2022-03-25 Thread Daniel Maslowski via SeaBIOS
From: Trammell Hudson 

---
 src/sercon.c | 21 -
 1 file changed, 21 deletions(-)

diff --git a/src/sercon.c b/src/sercon.c
index 3019d9b4..a65c51e1 100644
--- a/src/sercon.c
+++ b/src/sercon.c
@@ -99,12 +99,6 @@ static void sercon_putchar(u8 chr)
 }
 }
 
-static void sercon_term_reset(void)
-{
-sercon_putchar('\x1b');
-sercon_putchar('c');
-}
-
 static void sercon_term_clear_screen(void)
 {
 sercon_putchar('\x1b');
@@ -113,15 +107,6 @@ static void sercon_term_clear_screen(void)
 sercon_putchar('J');
 }
 
-static void sercon_term_no_linewrap(void)
-{
-sercon_putchar('\x1b');
-sercon_putchar('[');
-sercon_putchar('?');
-sercon_putchar('7');
-sercon_putchar('l');
-}
-
 static void sercon_term_cursor_goto(u8 row, u8 col)
 {
 row++; col++;
@@ -308,7 +293,6 @@ static void sercon_lazy_putchar(u8 chr, u8 attr, u8 
teletype)
 /* Set video mode */
 static void sercon_1000(struct bregs *regs)
 {
-u8 clearscreen = !(regs->al & 0x80);
 u8 mode = regs->al & 0x7f;
 u8 rows, cols;
 
@@ -345,11 +329,6 @@ static void sercon_1000(struct bregs *regs)
 SET_LOW(sercon_col_last, 0);
 SET_LOW(sercon_row_last, 0);
 SET_LOW(sercon_attr_last, 0);
-
-sercon_term_reset();
-sercon_term_no_linewrap();
-if (clearscreen)
-sercon_term_clear_screen();
 }
 
 /* Set text-mode cursor shape */
-- 
2.32.0

___
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-le...@seabios.org