pciaccess clean up

Tiago Vignatti vignatti at c3sl.ufpr.br
Sun Mar 2 20:32:39 PST 2008

Tiago Vignatti escreveu:
> I'm tracing why Xorg isn't posting correctly the secondary cards and for
> sure there's a lot of code (basically xf86pciBus.c) that will be also
> nuked after this be fixed (btw, is there anyone being able to start a
> secondary card under master branch today?).

Hi guys,

I spent some time comparing what the Xorg without pciaccess (server-1.4 
branch) does different from Xorg with pciaccess (master branch) trying 
to understand what we're missing in this problem above [0].

In Xorg without pciaccess the scheme to enable the resources of a given 
card on server initialization is as follows:

     1. Disable all pci accesses: the bus and pci devices

     2. Enable current VGA card access:
        xf86EnableAccess() -> pciSetBusAccess()
        xf86EnableAccess() -> pciIo_MemAccessEnable()

     3. PreInit() phase: if the card is not yet the one which is routing
        the informations, initialize it through int10:

     4. xf86PostScreenInit() phase:
        xf86EnterServerState() -> setAccess() -> pciMemAccessEnable()

while in the pciaccess Xorg, only the step 2 is performed. So strange.

I see that a lot of functions concerning to enable/disable the resources 
in Xorg with pciaccess are commented. In a frustrated attempt I 
uncomment it out but my machine hard frozen and then I preferred to ask 
for some guidance here.

An interesting thing that motivated me to think that this way of 
enable/disable the resources is the correct to follow was because when I 
initialize one video card using 1.4 branch, exit it nicely and then try 
to initialize the *same* card using the master branch, all succeed fine. 
But when I initialize one video card using 1.4 branch and then 
initialize another one using master branch, the Xorg doesn't runs. IOW, 
Xorg 1.4 knows how to route informations to a given card even if the 
routing is disabled for that card. OTOH, Xorg master doesn't know, so we 
must hook some of that commented code to do these tasks.

Am I in the right way?

Thank you,

[0] I think this can be considered as a bug blocker of server 1.5, don't?

Tiago Vignatti
C3SL - Centro de Computação Científica e Software Livre

More information about the xorg mailing list