Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261224AbVARDnl (ORCPT ); Mon, 17 Jan 2005 22:43:41 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261222AbVARDnl (ORCPT ); Mon, 17 Jan 2005 22:43:41 -0500 Received: from rproxy.gmail.com ([64.233.170.196]:18231 "EHLO rproxy.gmail.com") by vger.kernel.org with ESMTP id S261224AbVARDnR (ORCPT ); Mon, 17 Jan 2005 22:43:17 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type; b=nLmM3uglptvxRnNmMZkjWZ1rxOzoLb1QNzUsFPdkgHMuFze44dkGNNE8eH1jAN9Z00vP6KYSN4swVTSnujhI7wrax24FbvkKBPkg/B8LZqxq2grC/5dcVKN/mwXwTJM2Ut9AHkxNOlAaJSBIccxTs6cA3PDDXpBVsdqceayR67w= Message-ID: <9e47339105011719436a9e5038@mail.gmail.com> Date: Mon, 17 Jan 2005 22:43:16 -0500 From: Jon Smirl Reply-To: Jon Smirl To: Alan Cox , Egbert Eich , Linux Kernel Mailing List , Jesse Barnes Subject: Patch to control VGA bus routing and active VGA device. Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_252_26133641.1106019796414" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 17182 Lines: 250 ------=_Part_252_26133641.1106019796414 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline 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@gmail.com ------=_Part_252_26133641.1106019796414 Content-Type: application/octet-stream; name="patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="patch" ZGlmZiAtTnJ1IGEvYXJjaC9pMzg2L3BjaS9maXh1cC5jIGIvYXJjaC9pMzg2L3BjaS9maXh1cC5j Ci0tLSBhL2FyY2gvaTM4Ni9wY2kvZml4dXAuYwkyMDA1LTAxLTE3IDIyOjQwOjUxIC0wNTowMAor KysgYi9hcmNoL2kzODYvcGNpL2ZpeHVwLmMJMjAwNS0wMS0xNyAyMjo0MDo1MSAtMDU6MDAKQEAg LTM3NSw2ICszNzUsNiBAQAogCQl9CiAJCWJ1cyA9IGJ1cy0+cGFyZW50OwogCX0KLQlwZGV2LT5y ZXNvdXJjZVtQQ0lfUk9NX1JFU09VUkNFXS5mbGFncyB8PSBJT1JFU09VUkNFX1JPTV9TSEFET1c7 CisJcGRldi0+cmVzb3VyY2VbUENJX1JPTV9SRVNPVVJDRV0uZmxhZ3MgfD0gSU9SRVNPVVJDRV9S T01fU0hBRE9XIHwgSU9SRVNPVVJDRV9WR0FfQUNUSVZFOwogfQogREVDTEFSRV9QQ0lfRklYVVBf SEVBREVSKFBDSV9BTllfSUQsIFBDS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ZFCQkoMTw8 MykJLyogVkdBIGRldmljZSBpcyBhY3RpdmUgKi8KIAogLyogUEMvSVNBL3doYXRldmVyIC0gdGhl IG5vcm1hbCBQQyBhZGRyZXNzIHNwYWNlczogSU8gYW5kIG1lbW9yeSAqLwogZXh0ZXJuIHN0cnVj dCByZXNvdXJjZSBpb3BvcnRfcmVzb3VyY2U7Cg== ------=_Part_252_26133641.1106019796414-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/