|
From: Andy P. <at...@us...> - 2002-04-11 20:02:26
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char/agp
In directory usw-pr-cvs1:/tmp/cvs-serv17293/char/agp
Modified Files:
Makefile agp.h agpgart_be.c agpgart_fe.c
Log Message:
synch 2.4.15 commit 55
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/agp/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 14 Jan 2001 18:03:52 -0000 1.1.1.1
+++ Makefile 11 Apr 2002 13:30:59 -0000 1.2
@@ -7,7 +7,7 @@
export-objs := agpgart_be.o
-multi-objs := agpgart.o
+list-multi := agpgart.o
agpgart-objs := agpgart_fe.o agpgart_be.o
obj-$(CONFIG_AGP) += agpgart.o
Index: agp.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/agp/agp.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- agp.h 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ agp.h 11 Apr 2002 13:30:59 -0000 1.2
@@ -92,7 +92,7 @@
u32 mode;
enum chipset_type type;
enum aper_size_type size_type;
- u32 *key_list;
+ unsigned long *key_list;
atomic_t current_memory_agp;
atomic_t agp_in_use;
int max_memory_agp; /* in number of pages */
@@ -101,6 +101,7 @@
int num_aperture_sizes;
int num_of_masks;
int capndx;
+ int cant_use_aperture;
/* Links to driver specific functions */
@@ -119,15 +120,22 @@
void (*free_by_type) (agp_memory *);
unsigned long (*agp_alloc_page) (void);
void (*agp_destroy_page) (unsigned long);
+ int (*suspend)(void);
+ void (*resume)(void);
+
};
#define OUTREG32(mmap, addr, val) __raw_writel((val), (mmap)+(addr))
#define OUTREG16(mmap, addr, val) __raw_writew((val), (mmap)+(addr))
-#define OUTREG8 (mmap, addr, val) __raw_writeb((val), (mmap)+(addr))
+#define OUTREG8(mmap, addr, val) __raw_writeb((val), (mmap)+(addr))
#define INREG32(mmap, addr) __raw_readl((mmap)+(addr))
#define INREG16(mmap, addr) __raw_readw((mmap)+(addr))
-#define INREG8 (mmap, addr) __raw_readb((mmap)+(addr))
+#define INREG8(mmap, addr) __raw_readb((mmap)+(addr))
+
+#define KB(x) ((x) * 1024)
+#define MB(x) (KB (KB (x)))
+#define GB(x) (MB (KB (x)))
#define CACHE_FLUSH agp_bridge.cache_flush
#define A_SIZE_8(x) ((aper_size_info_8 *) x)
@@ -142,10 +150,6 @@
#define A_IDXFIX() (A_SIZE_FIX(agp_bridge.aperture_sizes) + i)
#define MAXKEY (4096 * 32)
-#ifndef min
-#define min(a,b) (((a)<(b))?(a):(b))
-#endif
-
#define AGPGART_MODULE_NAME "agpgart"
#define PFX AGPGART_MODULE_NAME ": "
@@ -160,15 +164,33 @@
#ifndef PCI_DEVICE_ID_VIA_8363_0
#define PCI_DEVICE_ID_VIA_8363_0 0x0305
#endif
+#ifndef PCI_DEVICE_ID_VIA_82C694X_0
+#define PCI_DEVICE_ID_VIA_82C694X_0 0x0605
+#endif
#ifndef PCI_DEVICE_ID_INTEL_810_0
#define PCI_DEVICE_ID_INTEL_810_0 0x7120
#endif
+#ifndef PCI_DEVICE_ID_INTEL_830_M_0
+#define PCI_DEVICE_ID_INTEL_830_M_0 0x3575
+#endif
+#ifndef PCI_DEVICE_ID_INTEL_830_M_1
+#define PCI_DEVICE_ID_INTEL_830_M_1 0x3577
+#endif
+#ifndef PCI_DEVICE_ID_INTEL_820_0
+#define PCI_DEVICE_ID_INTEL_820_0 0x2500
+#endif
#ifndef PCI_DEVICE_ID_INTEL_840_0
#define PCI_DEVICE_ID_INTEL_840_0 0x1a21
#endif
+#ifndef PCI_DEVICE_ID_INTEL_845_0
+#define PCI_DEVICE_ID_INTEL_845_0 0x1a30
+#endif
#ifndef PCI_DEVICE_ID_INTEL_850_0
#define PCI_DEVICE_ID_INTEL_850_0 0x2530
#endif
+#ifndef PCI_DEVICE_ID_INTEL_860_0
+#define PCI_DEVICE_ID_INTEL_860_0 0x2532
+#endif
#ifndef PCI_DEVICE_ID_INTEL_810_DC100_0
#define PCI_DEVICE_ID_INTEL_810_DC100_0 0x7122
#endif
@@ -199,6 +221,12 @@
#ifndef PCI_DEVICE_ID_AMD_IRONGATE_0
#define PCI_DEVICE_ID_AMD_IRONGATE_0 0x7006
#endif
+#ifndef PCI_DEVICE_ID_AMD_761_0
+#define PCI_DEVICE_ID_AMD_761_0 0x700e
+#endif
+#ifndef PCI_DEVICE_ID_AMD_762_0
+#define PCI_DEVICE_ID_AMD_762_0 0x700C
+#endif
#ifndef PCI_VENDOR_ID_AL
#define PCI_VENDOR_ID_AL 0x10b9
#endif
@@ -232,14 +260,42 @@
#define INTEL_NBXCFG 0x50
#define INTEL_ERRSTS 0x91
+/* intel i830 registers */
+#define I830_GMCH_CTRL 0x52
+#define I830_GMCH_ENABLED 0x4
+#define I830_GMCH_MEM_MASK 0x1
+#define I830_GMCH_MEM_64M 0x1
+#define I830_GMCH_MEM_128M 0
+#define I830_GMCH_GMS_MASK 0x70
+#define I830_GMCH_GMS_DISABLED 0x00
+#define I830_GMCH_GMS_LOCAL 0x10
+#define I830_GMCH_GMS_STOLEN_512 0x20
+#define I830_GMCH_GMS_STOLEN_1024 0x30
+#define I830_GMCH_GMS_STOLEN_8192 0x40
+#define I830_RDRAM_CHANNEL_TYPE 0x03010
+#define I830_RDRAM_ND(x) (((x) & 0x20) >> 5)
+#define I830_RDRAM_DDT(x) (((x) & 0x18) >> 3)
+
+/* intel i820 registers */
+#define INTEL_I820_RDCR 0x51
+#define INTEL_I820_ERRSTS 0xc8
+
/* intel i840 registers */
#define INTEL_I840_MCHCFG 0x50
-#define INTEL_I840_ERRSTS 0xc8
+#define INTEL_I840_ERRSTS 0xc8
+
+/* intel i845 registers */
+#define INTEL_I845_AGPM 0x51
+#define INTEL_I845_ERRSTS 0xc8
/* intel i850 registers */
#define INTEL_I850_MCHCFG 0x50
#define INTEL_I850_ERRSTS 0xc8
+/* intel i860 registers */
+#define INTEL_I860_MCHCFG 0x50
+#define INTEL_I860_ERRSTS 0xc8
+
/* intel i810 registers */
#define I810_GMADDR 0x10
#define I810_MMADDR 0x14
@@ -258,6 +314,8 @@
#define I810_DRAM_ROW_0 0x00000001
#define I810_DRAM_ROW_0_SDRAM 0x00000001
+
+
/* VIA register */
#define VIA_APBASE 0x10
#define VIA_GARTCTRL 0x80
@@ -291,5 +349,24 @@
#define ALI_CACHE_FLUSH_CTRL 0xD0
#define ALI_CACHE_FLUSH_ADDR_MASK 0xFFFFF000
#define ALI_CACHE_FLUSH_EN 0x100
+
+/* Serverworks Registers */
+#define SVWRKS_APSIZE 0x10
+#define SVWRKS_SIZE_MASK 0xfe000000
+
+#define SVWRKS_MMBASE 0x14
+#define SVWRKS_CACHING 0x4b
+#define SVWRKS_FEATURE 0x68
+
+/* func 1 registers */
+#define SVWRKS_AGP_ENABLE 0x60
+#define SVWRKS_COMMAND 0x04
+
+/* Memory mapped registers */
+#define SVWRKS_GART_CACHE 0x02
+#define SVWRKS_GATTBASE 0x04
+#define SVWRKS_TLBFLUSH 0x10
+#define SVWRKS_POSTFLUSH 0x14
+#define SVWRKS_DIRFLUSH 0x0c
#endif /* _AGP_BACKEND_PRIV_H */
Index: agpgart_be.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/agp/agpgart_be.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- agpgart_be.c 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ agpgart_be.c 11 Apr 2002 13:30:59 -0000 1.2
@@ -38,6 +38,7 @@
#include <linux/init.h>
#include <linux/pagemap.h>
#include <linux/miscdevice.h>
+#include <linux/pm.h>
#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/io.h>
@@ -48,6 +49,7 @@
MODULE_AUTHOR("Jeff Hartmann <jha...@pr...>");
MODULE_PARM(agp_try_unsupported, "1i");
[...2064 lines suppressed...]
+}
+
extern int agp_frontend_initialize(void);
extern void agp_frontend_cleanup(void);
@@ -2793,11 +4157,14 @@
}
inter_module_register("drm_agp", THIS_MODULE, &drm_agp);
+
+ pm_register(PM_PCI_DEV, PM_PCI_ID(agp_bridge.dev), agp_power);
return 0;
}
static void __exit agp_cleanup(void)
{
+ pm_unregister_all(agp_power);
agp_frontend_cleanup();
agp_backend_cleanup();
inter_module_unregister("drm_agp");
Index: agpgart_fe.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/agp/agpgart_fe.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- agpgart_fe.c 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ agpgart_fe.c 11 Apr 2002 13:30:59 -0000 1.2
@@ -749,11 +749,6 @@
}
-static long long agp_lseek(struct file *file, long long offset, int origin)
-{
- return -ESPIPE;
-}
-
static ssize_t agp_read(struct file *file, char *buf,
size_t count, loff_t * ppos)
{
@@ -852,6 +847,9 @@
if (copy_from_user(&reserve, (void *) arg, sizeof(agp_region))) {
return -EFAULT;
}
+ if ((unsigned) reserve.seg_count >= ~0U/sizeof(agp_segment))
+ return -EFAULT;
+
client = agp_find_client_by_pid(reserve.pid);
if (reserve.seg_count == 0) {
@@ -872,6 +870,9 @@
} else {
agp_segment *segment;
+ if (reserve.seg_count >= 16384)
+ return -EINVAL;
+
segment = kmalloc((sizeof(agp_segment) * reserve.seg_count),
GFP_KERNEL);
@@ -879,7 +880,7 @@
return -ENOMEM;
}
if (copy_from_user(segment, (void *) reserve.seg_list,
- GFP_KERNEL)) {
+ sizeof(agp_segment) * reserve.seg_count)) {
kfree(segment);
return -EFAULT;
}
@@ -1077,7 +1078,7 @@
static struct file_operations agp_fops =
{
owner: THIS_MODULE,
- llseek: agp_lseek,
+ llseek: no_llseek,
read: agp_read,
write: agp_write,
ioctl: agp_ioctl,
@@ -1105,7 +1106,8 @@
return 0;
}
-static void __exit agp_frontend_cleanup(void)
+void __exit agp_frontend_cleanup(void)
{
misc_deregister(&agp_miscdev);
}
+
|