Commit 2ed9f81e authored by Linus Torvalds's avatar Linus Torvalds

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

into home.osdl.org:/home/torvalds/v2.5/linux
parents e1237147 c36cf3b5
......@@ -395,6 +395,7 @@ unsigned long agp_generic_mask_memory(unsigned long addr, int type);
#define AGPSTAT 0x4
#define AGPCMD 0x8
#define AGPNISTAT 0xc
#define AGPCTRL 0x10
#define AGPNEPG 0x16
#define AGPNICMD 0x20
......
......@@ -9,8 +9,6 @@
#include <linux/agp_backend.h>
#include "agp.h"
static int agp_try_unsupported __initdata = 0;
static int ali_fetch_size(void)
{
int i;
......@@ -292,16 +290,10 @@ static int __init agp_ali_probe(struct pci_dev *pdev,
goto found;
}
if (!agp_try_unsupported) {
printk(KERN_ERR PFX
"Unsupported ALi chipset (device id: %04x),"
" you might want to try agp_try_unsupported=1.\n",
pdev->device);
return -ENODEV;
}
printk(KERN_ERR PFX "Unsupported ALi chipset (device id: %04x)\n",
pdev->device);
return -ENODEV;
printk(KERN_WARNING PFX "Trying generic ALi routines"
" for device id: %04x\n", pdev->device);
found:
bridge = agp_alloc_bridge();
......@@ -328,6 +320,7 @@ static int __init agp_ali_probe(struct pci_dev *pdev,
devs[j].chipset_name = "M1641";
break;
case 0x43:
devs[j].chipset_name = "M????";
break;
case 0x47:
devs[j].chipset_name = "M1647";
......@@ -397,7 +390,6 @@ static void __exit agp_ali_cleanup(void)
module_init(agp_ali_init);
module_exit(agp_ali_cleanup);
MODULE_PARM(agp_try_unsupported, "1i");
MODULE_AUTHOR("Dave Jones <davej@codemonkey.org.uk>");
MODULE_LICENSE("GPL and additional rights");
......@@ -11,8 +11,6 @@
#include <linux/mm.h>
#include "agp.h"
static int agp_try_unsupported __initdata = 0;
struct amd_page_map {
unsigned long *real;
unsigned long *remapped;
......@@ -404,16 +402,9 @@ static int __init agp_amdk7_probe(struct pci_dev *pdev,
}
}
if (!agp_try_unsupported) {
printk(KERN_ERR PFX
"Unsupported AMD chipset (device id: %04x),"
" you might want to try agp_try_unsupported=1.\n",
printk(KERN_ERR PFX "Unsupported AMD chipset (device id: %04x)\n",
pdev->device);
return -ENODEV;
}
printk(KERN_WARNING PFX "Trying generic AMD routines"
" for device id: %04x\n", pdev->device);
return -ENODEV;
found:
bridge = agp_alloc_bridge();
......@@ -476,5 +467,4 @@ static void __exit agp_amdk7_cleanup(void)
module_init(agp_amdk7_init);
module_exit(agp_amdk7_cleanup);
MODULE_PARM(agp_try_unsupported, "1i");
MODULE_LICENSE("GPL and additional rights");
......@@ -106,7 +106,11 @@ static int agp_find_max(void)
{
long memory, index, result;
memory = (num_physpages << PAGE_SHIFT) >> 20;
#if PAGE_SHIFT < 20
memory = num_physpages >> (20 - PAGE_SHIFT);
#else
memory = num_physpages << (PAGE_SHIFT - 20);
#endif
index = 1;
while ((memory > maxes_table[index].mem) && (index < 8))
......
......@@ -459,9 +459,9 @@ static void agp_v3_parse_one(u32 *mode, u32 *cmd, u32 *tmp)
/* Clear out unwanted bits. */
if (*cmd & AGPSTAT3_8X)
*cmd = ~(AGPSTAT3_4X | AGPSTAT3_RSVD);
*cmd &= ~(AGPSTAT3_4X | AGPSTAT3_RSVD);
if (*cmd & AGPSTAT3_4X)
*cmd = ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
*cmd &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
}
//FIXME: This doesn't smell right.
......@@ -545,7 +545,7 @@ EXPORT_SYMBOL(get_agp_version);
void agp_generic_enable(u32 mode)
{
u32 command;
u32 command, temp;
u32 agp3;
get_agp_version(agp_bridge);
......@@ -577,7 +577,13 @@ void agp_generic_enable(u32 mode)
agp_device_command(command, TRUE);
return;
} else {
printk (KERN_INFO PFX "Device is in legacy mode,"
/* Disable calibration cycle in RX91<1> when not in AGP3.0 mode of operation.*/
command &= ~(7<<10) ;
pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx+AGPCTRL, &temp);
temp |= (1<<9);
pci_write_config_dword(agp_bridge->dev, agp_bridge->capndx+AGPCTRL, temp);
printk (KERN_INFO PFX "Device is in legacy mode,"
" falling back to 2.x\n");
}
}
......
......@@ -13,9 +13,6 @@
#include <linux/agp_backend.h>
#include "agp.h"
static int agp_try_unsupported __initdata = 0;
static struct aper_size_info_fixed intel_i810_sizes[] =
{
{64, 16384, 4},
......@@ -1358,15 +1355,9 @@ static int __init agp_intel_probe(struct pci_dev *pdev,
name = "E7205";
break;
default:
if (!agp_try_unsupported) {
printk(KERN_ERR PFX
"Unsupported Intel chipset (device id: %04x),"
" you might want to try agp_try_unsupported=1.\n",
printk(KERN_ERR PFX "Unsupported Intel chipset (device id: %04x)\n",
pdev->device);
return -ENODEV;
}
bridge->driver = &intel_generic_driver;
break;
return -ENODEV;
};
bridge->dev = pdev;
......@@ -1485,6 +1476,5 @@ static void __exit agp_intel_cleanup(void)
module_init(agp_intel_init);
module_exit(agp_intel_cleanup);
MODULE_PARM(agp_try_unsupported, "1i");
MODULE_AUTHOR("Dave Jones <davej@codemonkey.org.uk>");
MODULE_LICENSE("GPL and additional rights");
......@@ -25,9 +25,6 @@
#define NVIDIA_3_APBASE 0x50
#define NVIDIA_3_APLIMIT 0x54
static int agp_try_unsupported __initdata = 0;
static struct _nvidia_private {
struct pci_dev *dev_1;
struct pci_dev *dev_2;
......@@ -299,17 +296,9 @@ static int __init agp_nvidia_probe(struct pci_dev *pdev,
nvidia_private.wbc_mask = 0x80000000;
break;
default:
if (!agp_try_unsupported) {
printk(KERN_ERR PFX
"Unsupported NVIDIA chipset (device id: %04x),"
" you might want to try agp_try_unsupported=1.\n",
printk(KERN_ERR PFX "Unsupported NVIDIA chipset (device id: %04x)\n",
pdev->device);
return -ENODEV;
}
printk(KERN_WARNING PFX
"Trying generic NVIDIA routines for device id: %04x\n",
pdev->device);
break;
return -ENODEV;
}
bridge = agp_alloc_bridge();
......@@ -372,7 +361,6 @@ static void __exit agp_nvidia_cleanup(void)
module_init(agp_nvidia_init);
module_exit(agp_nvidia_cleanup);
MODULE_PARM(agp_try_unsupported, "1i");
MODULE_LICENSE("GPL and additional rights");
MODULE_AUTHOR("NVIDIA Corporation");
......@@ -8,8 +8,6 @@
#include <linux/agp_backend.h>
#include "agp.h"
static int agp_try_unsupported __initdata = 0;
static int sis_fetch_size(void)
{
u8 temp_size;
......@@ -187,16 +185,9 @@ static int __init agp_sis_probe(struct pci_dev *pdev,
}
}
if (!agp_try_unsupported) {
printk(KERN_ERR PFX
"Unsupported SiS chipset (device id: %04x),"
" you might want to try agp_try_unsupported=1.\n",
printk(KERN_ERR PFX "Unsupported SiS chipset (device id: %04x)\n",
pdev->device);
return -ENODEV;
}
printk(KERN_WARNING PFX "Trying generic SiS routines"
" for device id: %04x\n", pdev->device);
return -ENODEV;
found:
bridge = agp_alloc_bridge();
......@@ -258,5 +249,4 @@ static void __exit agp_sis_cleanup(void)
module_init(agp_sis_init);
module_exit(agp_sis_cleanup);
MODULE_PARM(agp_try_unsupported, "1i");
MODULE_LICENSE("GPL and additional rights");
......@@ -8,8 +8,6 @@
#include <linux/agp_backend.h>
#include "agp.h"
static int agp_try_unsupported __initdata = 0;
struct serverworks_page_map {
unsigned long *real;
unsigned long *remapped;
......@@ -457,9 +455,9 @@ static int __init agp_serverworks_probe(struct pci_dev *pdev,
case 0x0007:
break;
default:
if (!agp_try_unsupported)
return -ENODEV;
break;
printk(KERN_ERR PFX "Unsupported Serverworks chipset "
"(device id: %04x)\n", pdev->device);
return -ENODEV;
}
serverworks_private.svrwrks_dev = bridge_dev;
......@@ -542,6 +540,5 @@ static void __exit agp_serverworks_cleanup(void)
module_init(agp_serverworks_init);
module_exit(agp_serverworks_cleanup);
MODULE_PARM(agp_try_unsupported, "1i");
MODULE_LICENSE("GPL and additional rights");
......@@ -10,8 +10,6 @@
#include <asm/pci-bridge.h>
#include "agp.h"
static int agp_try_unsupported __initdata = 0;
static int uninorth_fetch_size(void)
{
int i;
......@@ -324,15 +322,9 @@ static int __init agp_uninorth_probe(struct pci_dev *pdev,
}
}
if (!agp_try_unsupported) {
printk(KERN_ERR PFX "Unsupported Apple chipset"
" (device id: %04x).\n", pdev->device);
printk(KERN_ERR PFX "You might want to try"
" agp_try_unsupported=1\n");
return -ENODEV;
}
printk(KERN_ERR PFX "Trying generic Uninorth routines"
" for device id %04x\n", pdev->device);
printk(KERN_ERR PFX "Unsupported Apple chipset (device id: %04x).\n",
pdev->device);
return -ENODEV;
found:
bridge = agp_alloc_bridge();
......@@ -392,6 +384,5 @@ static void __exit agp_uninorth_cleanup(void)
module_init(agp_uninorth_init);
module_exit(agp_uninorth_cleanup);
MODULE_PARM(agp_try_unsupported, "1i");
MODULE_AUTHOR("Ben Herrenschmidt & Paul Mackerras");
MODULE_LICENSE("GPL");
......@@ -9,9 +9,6 @@
#include <linux/agp_backend.h>
#include "agp.h"
static int agp_try_unsupported __initdata = 0;
static int via_fetch_size(void)
{
int i;
......@@ -123,6 +120,14 @@ static int via_configure_agp3(void)
/* attbase - aperture GATT base */
pci_write_config_dword(agp_bridge->dev, VIA_AGP3_ATTBASE,
agp_bridge->gatt_bus_addr & 0xfffff000);
/* 1. Enable GTLB in RX90<7>, all AGP aperture access needs to fetch
* translation table first.
* 2. Enable AGP aperture in RX91<0>. This bit controls the enabling of the
* graphics AGP aperture for the AGP3.0 port.
*/
pci_read_config_dword(agp_bridge->dev, VIA_AGP3_GARTCTRL, &temp);
pci_write_config_dword(agp_bridge->dev, VIA_AGP3_GARTCTRL, temp | (3<<7));
return 0;
}
......@@ -382,16 +387,9 @@ static int __init agp_via_probe(struct pci_dev *pdev,
}
}
if (!agp_try_unsupported) {
printk(KERN_ERR PFX
"Unsupported VIA chipset (device id: %04x),"
" you might want to try agp_try_unsupported=1.\n",
printk(KERN_ERR PFX "Unsupported VIA chipset (device id: %04x)\n",
pdev->device);
return -ENODEV;
}
printk(KERN_WARNING PFX "Trying generic VIA routines"
" for device id: %04x\n", pdev->device);
return -ENODEV;
found:
bridge = agp_alloc_bridge();
......@@ -470,6 +468,5 @@ static void __exit agp_via_cleanup(void)
module_init(agp_via_init);
module_exit(agp_via_cleanup);
MODULE_PARM(agp_try_unsupported, "1i");
MODULE_LICENSE("GPL and additional rights");
MODULE_AUTHOR("Dave Jones <davej@codemonkey.org.uk>");
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