tech-kern 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 07:13:19AM -0300, Jared McNeill wrote:
> On Thu, 5 Apr 2018, Manuel Bouyer wrote:
> 
> > But still, being able to switch the console from the bootargs is convenient.
> > On the device I'm working with, the normal stdout-path would be the
> > graphic display, but when doing developement I switch to serial console.
> > It's much easier to switch using bootargs (which I can always do using the
> > serial console) than updating the device tree (especially as I can't easily
> > extract the sd card, I have to dissasemble the boards for that).
> 
> Totally agree, that's why the console=fb vs stdout-path logic is there in
> the first place.
> 
> > I think there's a simple way to get it working: leave stdout-path to the
> > serial port, and move sunxi_com to pass 4, so that it's probed before
> > sunxi_dep. This way the kernel starts with console on serial, and switches
> > to graphic if the command line says so when the graphic drivers are activated.
> 
> This would be a regression to the current simplefb setup, which gives early
> kernel output to the selected console device. I'd prefer to use FDT_CONSOLE
> here rather than relying on device attach ordering kludges.

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.

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.
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.
Unless, of course, if you change stdout-path in the device tree early,
My patch to sunxi_platform_bootstrap() just does that for other
framebuffer drivers that the simple framebuffer.

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


Home | Main Index | Thread Index | Old Index