Commit 6ce6d295 authored by Dave Jones's avatar Dave Jones

[AGPGART] Add AGP3 support for all VIA AGP3 chipsets.

Previously, only KT400 worked. Now, if we detect an AGP3 header,
we check the chipset to see if theres an AGP3 gfx card too
(which puts the chipset into 3.0 mode), and then adjust the
agp_bridge struct accordingly.
parent ee8771d7
...@@ -345,13 +345,29 @@ static struct agp_device_ids via_agp_device_ids[] __initdata = ...@@ -345,13 +345,29 @@ static struct agp_device_ids via_agp_device_ids[] __initdata =
{ }, /* dummy final entry, always present */ { }, /* dummy final entry, always present */
}; };
/*
* VIA's AGP3 chipsets do magick to put the AGP bridge compliant
* with the same standards version as the graphics card.
*/
static void check_via_agp3 (struct agp_bridge_data *bridge)
{
u8 reg;
pci_read_config_byte(bridge->dev, VIA_AGPSEL, &reg);
/* Check AGP 2.0 compatibility mode. */
if ((reg & (1<<1))==0)
bridge->driver = &via_agp3_driver;
}
static int __init agp_via_probe(struct pci_dev *pdev, static int __init agp_via_probe(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
struct agp_device_ids *devs = via_agp_device_ids; struct agp_device_ids *devs = via_agp_device_ids;
struct agp_bridge_data *bridge; struct agp_bridge_data *bridge;
int j = 0; int j = 0;
u8 cap_ptr, reg; u8 cap_ptr;
cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP); cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
if (!cap_ptr) if (!cap_ptr)
...@@ -382,40 +398,25 @@ static int __init agp_via_probe(struct pci_dev *pdev, ...@@ -382,40 +398,25 @@ static int __init agp_via_probe(struct pci_dev *pdev,
if (!bridge) if (!bridge)
return -ENOMEM; return -ENOMEM;
get_agp_version(bridge);
bridge->dev = pdev; bridge->dev = pdev;
bridge->capndx = cap_ptr; bridge->capndx = cap_ptr;
bridge->driver = &via_driver; bridge->driver = &via_driver;
switch (pdev->device) {
case PCI_DEVICE_ID_VIA_8367_0:
/* /*
* Garg, there are KT400s with KT266 IDs. * Garg, there are KT400s with KT266 IDs.
*/ */
if (pdev->device == PCI_DEVICE_ID_VIA_8367_0) {
/* Is there a KT400 subsystem ? */ /* Is there a KT400 subsystem ? */
if (pdev->subsystem_device != PCI_DEVICE_ID_VIA_8377_0) if (pdev->subsystem_device == PCI_DEVICE_ID_VIA_8377_0) {
break;
printk(KERN_INFO PFX "Found KT400 in disguise as a KT266.\n"); printk(KERN_INFO PFX "Found KT400 in disguise as a KT266.\n");
/*FALLTHROUGH*/ check_via_agp3(bridge);
case PCI_DEVICE_ID_VIA_8377_0:
/*
* The KT400 does magick to put the AGP bridge compliant
* with the same standards version as the graphics card.
*/
pci_read_config_byte(pdev, VIA_AGPSEL, &reg);
/* Check AGP 2.0 compatibility mode. */
if ((reg & (1<<1))==0) {
bridge->driver = &via_agp3_driver;
break;
} }
/*FALLTHROUGH*/
default:
break;
} }
/* If this is an AGP3 bridge, check which mode its in and adjust. */
bridge->dev = pdev; if (bridge->major_version >= 3)
bridge->capndx = cap_ptr; check_via_agp3(bridge);
/* Fill in the mode register */ /* Fill in the mode register */
pci_read_config_dword(pdev, pci_read_config_dword(pdev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment