[MPlayer-users] [Patch] Make vidix _vid drivers automatically ignore disabled cards

Jon Burgess jburgess at uklinux.net
Sat Mar 29 15:37:10 CET 2003


My PC has both an onboard ATI Mach64 adapter and a new Radeon 9000 
add-in card. The display uses the add-in adapter by default and has 
disabled the onboard video. When I start up mplayer with "-vo 
vesa:vidix" it currently detects and tries to use the Mach64 adapter and 
it all goes wrong. I can force it by adding ":radeon_vid.so", but I no 
longer need to do this if I apply this patch.

The patch below adds some extra checking on the PCI configuration of the 
adapters during the vixProbe() to ignore those which appear disabled. 
This way it ignores the Mach64 device and corectly picks the Radeon card.

It is loosely based on the detection routine XFree86 uses to pick the 
primary display adapter by looking for the adapter with PCI_COMMAND_IO 
bit being enabled. This patch works for me, but you might like to note 
these poiunts:

- The patch changes the size of the "struct pciinfo_s" which is used by 
libdha.so & the vidix drivers. They all need to be recompiled and 
installed otherwise it goes wrong.

- I haven't tried it on a big endian arch, the PCI command_status field 
might need byte swapping.

- Some adapters might work OK with only memory mapped acess and these 
might be rejected by this change (this might particularly effect 
framebuffer devices). This would be easy to fix adding "PCI_COMMAND_IO | 
PCI_COMMAND_MEM" to the check. I haven't made this change because the 
XFree86 code makes me think is isn't necessary.

- I have only tested the change to the mach64 driver, but I have changed 
all the other as well since the code is very similar.

- The fix still doesn't fix the problem if there are two enabled 
adapters and it picks the wrong one. Ideally I think the parent driver 
to vidix could pass a prefered busID, but I don't know whether this 
information is available.

- The code to find the device is duplicated in all the drivers, perhaps 
we should consider moving this function into libdha.

Any comments are welcome.

    Jon

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: find-enabled.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20030329/4a32448d/attachment.asc>


More information about the MPlayer-users mailing list