[LinuxBIOS] [Patch] Fix CONFIG_CONSOLE_VGA handling in default pci_dev_init.

Luc Verhaegen libv at skynet.be
Thu Jan 3 02:03:03 CET 2008


On Wed, Jan 02, 2008 at 01:26:10PM -0800, ron minnich wrote:
> On Jan 2, 2008 1:16 AM, Luc Verhaegen <libv at skynet.be> wrote:
> > The CONFIG_CONSOLE_VGA and CONFIG_PCI_ROM_RUN logic in
> > src/devices/pci_device.c:pci_dev_init is messed up.
> 
> It may be hard to read, but I am pretty sure it is doing the right
> thing. Can you provide an instance in which it does the wrong thing?

pci_dev_init is the default pci device initialisation routine.

It is a dumb pci device initialisation routine, lacking all device 
specific knowledge.

It can only try to achieve anything when there is a pci rom present 
which can do the initialisation for us.

When we choose to not run pci roms, we do not initialise anything, and 
we certainly shouldn't go claiming we did either.

When we choose to not run pci roms, why do we still run pci roms of 
devices if they just happen to be VGA devices?

So why bother setting vga_inited outside of PCI_ROM_RUN?

If you still do not believe logic, then please set CONFIG_CONSOLE_VGA 
without setting CONFIG_PCI_ROM_RUN and then build your rom. The build 
will fail due to missing symbols.

This is how i came across this issue in the first place.

What i am trying to do is implement native VGA bring-up for unichrome. I 
have had userspace code doing this on top of a clean linuxbios for more 
than 8 months. This is not just my X driver, i can also set up standard 
vga text mode, so it is not a pipe dream.

In that light it is perfectly valid to claim CONFIG_CONSOLE_VGA 
without setting CONFIG_PCI_ROM_RUN, because:
* i have no need for a vga rom, as i provide the necessary code for a
  full vga text mode bringup myself.
* i have no need to run any other rom either.
* i do want vga console logging.

So when i initialise the unichrome, i set vga_inited myself, like any 
device driver should when it initialises a vga compatible device to a 
vga compatible state and expects the console code to make use of it as a 
vga compatible console.

Since the lunacy that is the northbridge/via/vt8623/vgabios code never
bothered to set up vga_inited, i am not breaking this either. Because 
how does one break what is already broken, and why should i bother 
fixing what isn't worth fixing? It will eventually be tossed anyway, as 
it will be done properly.

Since I am trailblazing native vga bringup, it is perfectly 
understandable that some bumps are encountered along the way. What i do 
not understand is how something so perfectly logical is rejected without 
proper consideration, tossed aside as if it were a mindless cleanup.

I do not do mindless cleanups.

Feel free to read over my tiny and trivial patch again.

Thank you for making my day, and a happy 2008 to you too.

Luc Verhaegen.
A now very agitated SUSE/Novell X Driver Developer.




More information about the coreboot mailing list