mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: "open list:BAREBOX" <barebox@lists.infradead.org>
Subject: Re: [PATCH 2/5] commands: splash: honour line_length
Date: Thu, 26 Sep 2024 08:48:58 +0200	[thread overview]
Message-ID: <ZvUD2m_iUoOpECju@pengutronix.de> (raw)
In-Reply-To: <3ca957de-45b3-4759-a0c4-7b85e5b309fb@pengutronix.de>

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	other threads:[~2024-09-26  7:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 14:34 [PATCH 0/5] graphics updates Sascha Hauer
2024-09-25 14:34 ` [PATCH 1/5] graphic_utils: Clip to screen boundaries Sascha Hauer
2024-09-26  5:26   ` Ahmad Fatoum
2024-09-25 14:34 ` [PATCH 2/5] commands: splash: honour line_length Sascha Hauer
2024-09-26  5:31   ` Ahmad Fatoum
2024-09-26  6:48     ` Sascha Hauer [this message]
2024-09-25 14:34 ` [PATCH 3/5] gui: fix alpha blend Sascha Hauer
2024-09-26  5:33   ` Ahmad Fatoum
2024-09-25 14:34 ` [PATCH 4/5] fbconsole: make background pixels transparent Sascha Hauer
2024-09-26  5:38   ` Ahmad Fatoum
2024-09-26  7:02     ` Sascha Hauer
2024-09-25 14:34 ` [PATCH 5/5] fbconsole: actually store rows/cols Sascha Hauer
2024-09-26  5:39   ` Ahmad Fatoum
2024-09-27 10:38 ` [PATCH 0/5] graphics updates Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZvUD2m_iUoOpECju@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox