Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: graphic drivers and simplefb



On Thu, Apr 05, 2018 at 08:08:13AM -0300, Jared McNeill wrote:
> On Thu, 5 Apr 2018, Manuel Bouyer wrote:
> 
> > On Thu, Apr 05, 2018 at 07:40:35AM -0300, Jared McNeill wrote:
> > > On Thu, 5 Apr 2018, Manuel Bouyer wrote:
> > > 
> > > > Does it really do that ?
> > > > Reading the sources nothing is displayed until simplefb_attach() is called.
> > > > simplefb_console_consinit() calls genfb_cnattach() but it does nothing.
> > > > The dmesg buffer is replayed when genfb attaches with the console flag.
> > > 
> > > Doh, you're right. I'll have to fix that :)
> > 
> > but that's not easy. You'd need not only simplefb but also the
> > raster stuff to be set up. I'm not sure we want to go that far
> > in the early stages of the kenrel boot.
> > Things are even worse when we have to set up a full graphic pipeline.
> > You may even need interrupts ...
> 
> For simplefb I have everything I need..

OK, so in this case you'd want to have simplefb be the console,
until a more complete graphic driver attaches and take over
(much like we do with vga vs drm drivers in the x86 world).

> 
> > > 
> > > > Actually FDT_CONSOLE doens't prevent the serial port from taking over the
> > > > console if the stdout-path says so - and even if the command line says
> > > > otherwise.
> > > 
> > > Looks like we're missing a call to com_is_console in sunxi_com. This should
> > > be fixed too..
> > 
> > I've been wondering about it too. But anyway, something, somewhere, it DTRT.
> > I have 3 serial ports active in my platform, and only com0 is console.
> > And if I change stdout-path (like my patch does, or in the fdt) then
> > com0 is not console any more.
> 
> This is because we call comcnattach (via FDT_CONSOLE) only for the one
> specified by stdout-path, and com.c:com_attach_subr only attaches console to
> that one.

OK that's what I missed. I only looked at the is_console boolean.

> 
> > > > Actually it works with simplefb because /chosen/framebuffer is probed and
> > > > attaches after com0 (and it's not an ordering kludge: it's just luck).
> > > > As sunxidep is attached before com0, com0 has the last word.
> > > 
> > > Not behavior I want to rely on :/
> > 
> > Note that this is also how allwniner works: com0 is console,
> > until a graphic driver attaches. In allwinner serial ports are attached
> > before graphics.
> > And I'd like to keep this behavior, it's very usefull for debugging.
> 
> Boards exist where serial console is difficult or impossible to access. Lets
> come up with a solution that satisfies all cases..

Sure. In this case I guess stdout-path will not be set to the serial port
though, so it should not use the serial port at all. I don't think we have
anything to change for this.

What I'm talking about is: stdout-path is set to the serial port, but
we have console=fb in the bootargs. In this case I think we could use
the serial port as console util the graphic driver (be it simplefb or
something else) is attached, at which point it will attach as console and
replay the dmesg buffer.

For this we need either to have the serial port attach before the
graphic drivers, or have a way to reset the console status of the serial
port when needed.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index