]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] AGPGart update
authorDave Jones <davej@suse.de>
Fri, 8 Feb 2002 09:43:27 +0000 (01:43 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Fri, 8 Feb 2002 09:43:27 +0000 (01:43 -0800)
Mostly from 2.4.17 / 18pre.
- Code cleanup
- Fix suspend/resume on several chipsets
- Add support for i820.

drivers/char/Config.in
drivers/char/agp/agp.h
drivers/char/agp/agpgart_be.c
drivers/char/agp/agpgart_fe.c

index 6358b6aa81995ff23009dae407d041c969512c8b..3ed5efcfad87f3411bf69d7cb8f431c9ed119077 100644 (file)
@@ -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
index b6b2355e9053f825470fdb21dde5f4224c0b64bc..a2c4ed580b35455012a2ddfd7b1d44eefdaa53c5 100644 (file)
@@ -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 */
index 630ef9c4adb813be67664c979ad59eea2e9522d2..2f717b9111ea215c528eab4d225b2a74667d64f9 100644 (file)
@@ -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,
index 2c6b9f9a58da41659b87a5083cfd085f5feda2f0..e603a9e5f1e8ab9ca52e7bb5cabf99e3e123a3e5 100644 (file)
@@ -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;
        }