Patch to control VGA bus routing and active VGA device.

From: Jon Smirl
Date: Mon Jan 17 2005 - 22:44:47 EST


Attached is a patch to control VGA bus routing and the active VGA
device. It works by adding sysfs attributes to bridge and VGA devices.
The bridge attribute is read only and indicates if the bridge is
routing VGA. The attribute on the device has four values:

/* echo these values to the sysfs vga attribute on a VGA device */
enum eEnable {
VGA_DISABLE_THIS = 0, /* If this VGA is enabled, disable it. */
VGA_ENABLE_THIS = 1, /* Disable all VGAs then enable this VGA, mark
as active VGA */
/* Used while resetting a board, board being reset may not be the active VGA */
VGA_DISABLE_ALL = 2, /* Remember active VGA then disable all VGAa and
devices */
VGA_ENABLE_ACTIVE = 3, /* Make sure all VGAs are disabled, then
reenable active VGA */
};

States 2 and 3 are using during a reset cycle. You need to disable the
active VGA, run the reset on the new card, turn it off and then
restore the active one.

I cannot get this code to work. I have a machine with three buses, the
main one, a PCI one and an AGP one. If I turn off routing from one
bridge and turn it on on the other, I cannot get the VGA card to
respond to the IO requests. There must be something more to routing
VGA than what is in this code. The patch is pretty simple so it
shouldn't be too hard to find the problem. I know my machine can route
VGA since vbios.vm86 does it when reseting my secondary cards.

Can any of you PCI/VGA experts tell me what is wrong? Patch is against
current Linus BK.

This code, plus the ROM code already in the kernel, plus a tiny piece
to generate a hotplug event, is enough to let me write a user space
app for secondary card reset.

--
Jon Smirl
jonsmirl@xxxxxxxxx

Attachment: patch
Description: Binary data