On Thu, Sep 26, 2024 at 07:31:49AM +0200, Ahmad Fatoum wrote:
> On 25.09.24 16:34, Sascha Hauer wrote:
> > the splash command has an option for setting a background colour. This
> > doesn't always fill the whole screen as expected.
> > 
> > struct fb_info has a line_length field that specifies the length in
> > bytes of a single line. That length may be bigger than the actually
> > visible area as specified by xres. In this case filling the area as
> > calculated by xres*yres fills the invisible pixels between xres and
> > line_length, but it doesn't fill the whole visible area. Fix this by
> > iterating over the lines, filling the visible area of each line.
> 
> I have trouble understanding this. What is line_length if not
> bytes per pixel multiplied by xres?

Some hardware might have alignment restrictions on the address where the
new line starts. In that case line_length is longer than xres*bpp. Also
the picture in the framebuffer might be wider than the visible area.

In my case I allocate a framebuffer for the biggest resolution the
monitor supports. When changing the resolution to a smaller one I can
keep the framebuffer and still show something useful by keeping
line_length and just adjusting xres.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Reply via email to