All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: u-boot@lists.denx.de
Subject: [PATCH v3] video: sunxi_display: Convert to DM_VIDEO
Date: Mon, 22 Feb 2021 10:02:23 +0100	[thread overview]
Message-ID: <20210222090223.4uvwdlcyq3lpcyb4@gilmour> (raw)
In-Reply-To: <CAPnjgZ2iBFYfHFtszB+BZ8X2hyN+ZV4QJQzJ80OPTnkhL6k+AQ@mail.gmail.com>

On Sun, Feb 21, 2021 at 09:24:18AM -0700, Simon Glass wrote:
> > > > +static int sunxi_de_bind(struct udevice *dev)
> > > > +{
> > > > +       struct video_uc_plat *plat = dev_get_uclass_plat(dev);
> > > > +
> > > > +       plat->size = LCD_MAX_WIDTH * LCD_MAX_HEIGHT *
> > > > +                    (1 << LCD_MAX_LOG2_BPP) / 8;
> > >
> > > Should use enum video_log2_bpp here. Also see VNBYTES().
> >
> > LCD_MAX_LOG2_BPP is defined as VIDEO_BPP32 at the very top. Sure will
> > use VNBYTES.
> >
> > On a related topic: IIUC this is called several times, for a start once
> > before relocation, where it's supposed to give an upper bound?
> > Are subsequent calls then expected to be more precise? Our 32MB frame
> > buffer is *very* generous, for the usual FullHD display we just need
> > 8MB. But we would only know this in probe(), when we have learned the
> > output device and the video modes it supports.
> > So is there a way to restrict (and possibly also move) the framebuffer
> > in probe()?
> 
> I suppose you can, but that is not what is expected. You don't save
> memory for U-Boot (and it doesn't matter), but making it smaller so
> that linux uses less would be worthwhile. We just need to make sure
> this is documented in video.h and tested.
> 
> To be clear, you have my review thg, so these are things that can be done later.

Seems Andre seems to be motivated to rework that driver, I guess we
could also rework how this is done.

Ideally, we should be describing the reserved buffer through a
reserved-memory node in the DT instead of carving out some memory for
Linux. That way, if we don't have simplefb support, or it's replaced by
something else eventually, we have a chance a claiming that memory back
at some point, instead of just ignoring it.

Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210222/bf7f06fc/attachment.sig>

  reply	other threads:[~2021-02-22  9:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05  1:07 [PATCH v3] video: sunxi_display: Convert to DM_VIDEO Andre Przywara
2021-02-05 16:04 ` Maxime Ripard
2021-02-05 16:27 ` Jernej Škrabec
2021-02-05 19:31   ` Andre Przywara
2021-02-07 14:37 ` Simon Glass
2021-02-08  1:36   ` Andre Przywara
2021-02-08  4:21     ` Simon Glass
2021-02-21  0:07   ` Andre Przywara
2021-02-21  0:45     ` Tom Rini
2021-02-21 16:47       ` Anatolij Gustschin
2021-02-22  0:17         ` Andre Przywara
2021-02-22  7:37           ` Anatolij Gustschin
2021-02-21 16:24     ` Simon Glass
2021-02-22  9:02       ` Maxime Ripard [this message]
2021-02-22  8:59     ` Maxime Ripard

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=20210222090223.4uvwdlcyq3lpcyb4@gilmour \
    --to=maxime@cerno.tech \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.