Commit bce0670d authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-dj.bkbits.net/agpgart

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 6079e248 67221af3
......@@ -165,7 +165,7 @@ config AGP_EFFICEON
tristate "Transmeta Efficeon support"
depends on AGP && X86 && !X86_64
help
This option fives you AGP support for the Transmeta Efficeon
This option gives you AGP support for the Transmeta Efficeon
series processors with integrated northbridges.
You should say Y here if you use XFree86 3.3.6 or 4.x and want to
......
......@@ -536,6 +536,15 @@ static struct pci_device_id agp_amd64_pci_table[] = {
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
},
/* VIA K8T800Pro */
{
.class = (PCI_CLASS_BRIDGE_HOST << 8),
.class_mask = ~0,
.vendor = PCI_VENDOR_ID_VIA,
.device = PCI_DEVICE_ID_VIA_K8T800PRO_0,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
},
/* VIA K8T800 */
{
.class = (PCI_CLASS_BRIDGE_HOST << 8),
......
/*
* AGPGART driver.
* Copyright (C) 2002-2003 Dave Jones.
* Copyright (C) 2002-2004 Dave Jones.
* Copyright (C) 1999 Jeff Hartmann.
* Copyright (C) 1999 Precision Insight, Inc.
* Copyright (C) 1999 Xi Graphics, Inc.
......@@ -404,12 +404,18 @@ static void agp_v2_parse_one(u32 *mode, u32 *cmd, u32 *tmp)
*cmd &= ~(AGPSTAT2_1X | AGPSTAT2_4X); /* 2X */
if (*cmd & AGPSTAT2_1X)
*cmd &= ~(AGPSTAT2_2X | AGPSTAT2_4X); /* 1Xf */
*cmd &= ~(AGPSTAT2_2X | AGPSTAT2_4X); /* 1X */
}
/*
* mode = requested mode.
* cmd = PCI_AGP_STATUS from agp bridge.
* tmp = PCI_AGP_STATUS from graphic card.
*/
static void agp_v3_parse_one(u32 *mode, u32 *cmd, u32 *tmp)
{
u32 origcmd=*cmd, origtmp=*tmp;
/* ARQSZ - Set the value to the maximum one.
* Don't allow the mode register to override values. */
*cmd = ((*cmd & ~AGPSTAT_ARQSZ) |
......@@ -452,17 +458,43 @@ static void agp_v3_parse_one(u32 *mode, u32 *cmd, u32 *tmp)
*mode |= AGPSTAT3_4X;
}
if (!((*cmd & AGPSTAT3_8X) && (*tmp & AGPSTAT3_8X) && (*mode & AGPSTAT3_8X)))
*cmd &= ~AGPSTAT3_8X;
if (*mode & AGPSTAT3_8X) {
if (!(*cmd & AGPSTAT3_8X)) {
*cmd &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
*cmd |= AGPSTAT3_4X;
printk ("%s requested AGPx8 but bridge not capable.\n", current->comm);
return;
}
if (!(*tmp & AGPSTAT3_8X)) {
*cmd &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
*cmd |= AGPSTAT3_4X;
printk ("%s requested AGPx8 but graphic card not capable.\n", current->comm);
return;
}
/* All set, bridge & device can do AGP x8*/
*cmd &= ~(AGPSTAT3_4X | AGPSTAT3_RSVD);
return;
if (!((*cmd & AGPSTAT3_4X) && (*tmp & AGPSTAT3_4X) && (*mode & AGPSTAT3_4X)))
*cmd &= ~AGPSTAT3_4X;
} else {
/* Clear out unwanted bits. */
if (*cmd & AGPSTAT3_8X)
*cmd &= ~(AGPSTAT3_4X | AGPSTAT3_RSVD);
if (*cmd & AGPSTAT3_4X)
/*
* If we didn't specify AGPx8, we can only do x4.
* If the hardware can't do x4, we're up shit creek, and never
* should have got this far.
*/
*cmd &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
if ((*cmd & AGPSTAT3_4X) && (*tmp & AGPSTAT3_4X))
*cmd |= AGPSTAT3_4X;
else {
printk (KERN_INFO PFX "Badness. Don't know which AGP mode to set. "
"[cmd:%x tmp:%x fell back to:- cmd:%x tmp:%x]\n",
origcmd, origtmp, *cmd, *tmp);
if (!(*cmd & AGPSTAT3_4X))
printk (KERN_INFO PFX "Bridge couldn't do AGP x4.\n");
if (!(*tmp & AGPSTAT3_4X))
printk (KERN_INFO PFX "Graphic card couldn't do AGP x4.\n");
}
}
}
//FIXME: This doesn't smell right.
......@@ -479,6 +511,8 @@ u32 agp_collect_device_status(u32 mode, u32 cmd)
if (!cap_ptr)
continue;
//FIXME: We should probably skip anything here that
// isn't an AGP graphic card.
/*
* Ok, here we have a AGP device. Disable impossible
* settings, and adjust the readqueue to the minimum.
......
......@@ -447,6 +447,7 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
struct agp_bridge_data *bridge;
struct pci_dev *bridge_dev;
u32 temp, temp2;
u8 cap_ptr = 0;
/* Everything is on func 1 here so we are hardcoding function one */
bridge_dev = pci_find_slot((unsigned int)pdev->bus->number,
......@@ -457,6 +458,8 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
return -ENODEV;
}
cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
switch (pdev->device) {
case 0x0006:
/* ServerWorks CNB20HE
......@@ -470,6 +473,7 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
break;
default:
if (cap_ptr)
printk(KERN_ERR PFX "Unsupported Serverworks chipset "
"(device id: %04x)\n", pdev->device);
return -ENODEV;
......
......@@ -434,6 +434,7 @@ static struct pci_device_id agp_via_pci_table[] = {
.subvendor = PCI_ANY_ID, \
.subdevice = PCI_ANY_ID, \
}
ID(PCI_DEVICE_ID_VIA_82C597_0),
ID(PCI_DEVICE_ID_VIA_82C598_0),
ID(PCI_DEVICE_ID_VIA_8501_0),
ID(PCI_DEVICE_ID_VIA_8601_0),
......
......@@ -1176,6 +1176,7 @@
#define PCI_DEVICE_ID_VIA_8763_0 0x0198
#define PCI_DEVICE_ID_VIA_8380_0 0x0204
#define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259
#define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282
#define PCI_DEVICE_ID_VIA_8363_0 0x0305
#define PCI_DEVICE_ID_VIA_8371_0 0x0391
#define PCI_DEVICE_ID_VIA_8501_0 0x0501
......
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