Commit bd4b161b authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] AGPGart update

Mostly from 2.4.17 / 18pre.
- Code cleanup
- Fix suspend/resume on several chipsets
- Add support for i820.
parent b5635319
......@@ -208,7 +208,7 @@ endmenu
dep_tristate '/dev/agpgart (AGP Support)' CONFIG_AGP $CONFIG_DRM_AGP
if [ "$CONFIG_AGP" != "n" ]; then
bool ' Intel 440LX/BX/GX and I815/I830M/I840/I850 support' CONFIG_AGP_INTEL
bool ' Intel 440LX/BX/GX and I815/I820/I830M/I840/I845/I850/I860 support' CONFIG_AGP_INTEL
bool ' Intel I810/I815/I830M (on-board) support' CONFIG_AGP_I810
bool ' VIA chipset support' CONFIG_AGP_VIA
bool ' AMD Irongate, 761, and 762 support' CONFIG_AGP_AMD
......
......@@ -179,6 +179,9 @@ struct agp_bridge_data {
#ifndef PCI_DEVICE_ID_INTEL_820_0
#define PCI_DEVICE_ID_INTEL_820_0 0x2500
#endif
#ifndef PCI_DEVICE_ID_INTEL_820_UP_0
#define PCI_DEVICE_ID_INTEL_820_UP_0 0x2501
#endif
#ifndef PCI_DEVICE_ID_INTEL_840_0
#define PCI_DEVICE_ID_INTEL_840_0 0x1a21
#endif
......@@ -189,7 +192,7 @@ struct agp_bridge_data {
#define PCI_DEVICE_ID_INTEL_850_0 0x2530
#endif
#ifndef PCI_DEVICE_ID_INTEL_860_0
#define PCI_DEVICE_ID_INTEL_860_0 0x2532
#define PCI_DEVICE_ID_INTEL_860_0 0x2531
#endif
#ifndef PCI_DEVICE_ID_INTEL_810_DC100_0
#define PCI_DEVICE_ID_INTEL_810_DC100_0 0x7122
......@@ -276,6 +279,7 @@ struct agp_bridge_data {
#define I830_RDRAM_ND(x) (((x) & 0x20) >> 5)
#define I830_RDRAM_DDT(x) (((x) & 0x18) >> 3)
/* This one is for I830MP w. an external graphic card */
#define INTEL_I830_ERRSTS 0x92
/* intel i820 registers */
......
......@@ -409,8 +409,18 @@ static void agp_generic_agp_enable(u32 mode)
* AGP devices and collect their data.
*/
while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
device)) != NULL) {
pci_for_each_dev(device)
{
/*
* Enable AGP devices. Most will be VGA display but
* some may be coprocessors on non VGA devices too
*/
if((((device->class >> 16) & 0xFF) != PCI_BASE_CLASS_DISPLAY) &&
(device->class != (PCI_CLASS_PROCESSOR_CO << 8)))
continue;
pci_read_config_dword(device, 0x04, &scratch);
if (!(scratch & 0x00100000))
......@@ -1826,7 +1836,7 @@ static int __init intel_820_setup (struct pci_dev *pdev)
agp_bridge.needs_scratch_page = FALSE;
agp_bridge.configure = intel_820_configure;
agp_bridge.fetch_size = intel_8xx_fetch_size;
agp_bridge.cleanup = intel_cleanup;
agp_bridge.cleanup = intel_820_cleanup;
agp_bridge.tlb_flush = intel_820_tlbflush;
agp_bridge.mask_memory = intel_mask_memory;
agp_bridge.agp_enable = agp_generic_agp_enable;
......@@ -1839,6 +1849,9 @@ static int __init intel_820_setup (struct pci_dev *pdev)
agp_bridge.free_by_type = agp_generic_free_by_type;
agp_bridge.agp_alloc_page = agp_generic_alloc_page;
agp_bridge.agp_destroy_page = agp_generic_destroy_page;
agp_bridge.suspend = agp_generic_suspend;
agp_bridge.resume = agp_generic_resume;
agp_bridge.cant_use_aperture = 0;
return 0;
......@@ -1869,6 +1882,9 @@ static int __init intel_830mp_setup (struct pci_dev *pdev)
agp_bridge.free_by_type = agp_generic_free_by_type;
agp_bridge.agp_alloc_page = agp_generic_alloc_page;
agp_bridge.agp_destroy_page = agp_generic_destroy_page;
agp_bridge.suspend = agp_generic_suspend;
agp_bridge.resume = agp_generic_resume;
agp_bridge.cant_use_aperture = 0;
return 0;
......@@ -3307,8 +3323,18 @@ static void serverworks_agp_enable(u32 mode)
* AGP devices and collect their data.
*/
while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
device)) != NULL) {
pci_for_each_dev(device)
{
/*
* Enable AGP devices. Most will be VGA display but
* some may be coprocessors on non VGA devices too
*/
if((((device->class >> 16) & 0xFF) != PCI_BASE_CLASS_DISPLAY) &&
(device->class != (PCI_CLASS_PROCESSOR_CO << 8)))
continue;
pci_read_config_dword(device, 0x04, &scratch);
if (!(scratch & 0x00100000))
......@@ -3611,6 +3637,12 @@ static struct {
"Intel",
"i820",
intel_820_setup },
{ PCI_DEVICE_ID_INTEL_820_UP_0,
PCI_VENDOR_ID_INTEL,
INTEL_I820,
"Intel",
"i820",
intel_820_setup },
{ PCI_DEVICE_ID_INTEL_830_M_0,
PCI_VENDOR_ID_INTEL,
INTEL_I830_M,
......
......@@ -301,7 +301,7 @@ static agp_memory *agp_allocate_memory_wrap(size_t pg_count, u32 type)
agp_memory *memory;
memory = agp_allocate_memory(pg_count, type);
printk(KERN_DEBUG "memory : %p\n", memory);
printk(KERN_DEBUG "agp_allocate_memory: %p\n", memory);
if (memory == NULL) {
return NULL;
}
......
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