Re: pci_fixup_video() bogosity

Benjamin Herrenschmidt
2005-03-08T07:24:00Z

On Tue, 2005-03-08 at 00:57 -0500, Jon Smirl wrote:
> On Tue, 08 Mar 2005 15:38:29 +1100, Benjamin Herrenschmidt
> <benh@kernel.crashing.org> wrote:
> > Hi !
> >
> > While working on writing a VGA access arbiter for kernel & userland,
> > I wondered how to properly get my "initial" state at boot. For that,
> > I looked at how the new PCI ROM stuff does to find out who owns the
> > memory shadow at c0000, and found it quite bogus.
> >
> > >From what I see, the code is only based on looking at what bridges
> > have VGA forwarding enabled. It doesn't test the actual IO and Memory
> > enable bits of the VGA cards themselves.
>
> Let's fix it up and make it more robust. I was playing with checking
> IO/mem enable and forgot to finish it.

Ok, have a look at my prototype VGA arbiter. I need something similar to
spot the "default" VGA device at boot, maybe your stuff could be moved
completely to the arbiter ?
>
> > What if you have 2 cards under the same bridge ?
>
> I believe the default on x86 is to pick the one in the lowest slot
> number. What happens on PPC?

What I mean is your code won't work afaik, you should check the one
which has MEM/IO enabled. On PPC, I don't know, depends on the firmware,
pretty much all pmac cards come with the legacy decoding disabled anyway
(they are fully posted in "native" mode by the firmware).

Some PPC's have x86 emulators and/or some VGA capabilities, but then, I
expect only one of them to be left enabled by the firmware.

Ben.