summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/Makefile.kernel4
-rw-r--r--linux/agpsupport.c12
-rw-r--r--linux/drmP.h1
-rw-r--r--linux/gamma_drv.c2
-rw-r--r--linux/i810_drv.c3
-rw-r--r--linux/mga_drv.c3
-rw-r--r--linux/r128_drv.c4
-rw-r--r--linux/tdfx_drv.c13
8 files changed, 36 insertions, 6 deletions
diff --git a/linux/Makefile.kernel b/linux/Makefile.kernel
index bf92d775..2937898f 100644
--- a/linux/Makefile.kernel
+++ b/linux/Makefile.kernel
@@ -66,7 +66,7 @@ ifeq ($(CONFIG_DRM_R128),y)
OX_OBJS += r128_drv.o
O_OBJS += r128_context.o r128_bufs.o r128_dma.o
else
- ifeq ($(CONFIG_DRM_I810),m)
+ ifeq ($(CONFIG_DRM_R128),m)
MIX_OBJS += r128_drv.o
MI_OBJS += r128_context.o r128_bufs.o r128_dma.o
M_OBJS += r128.o
@@ -102,7 +102,7 @@ i810.o: i810_drv.o i810_context.o i810_bufs.o i810_dma.o $(L_OBJS)
$(LD) $(LD_RFLAG) -r -o $@ i810_drv.o i810_bufs.o i810_dma.o \
i810_context.o $(L_OBJS)
-r128.o: r128_drv.o r128_context.o r128_bufs.o $(L_OBJS)
+r128.o: r128_drv.o r128_context.o r128_bufs.o r128_dma.o $(L_OBJS)
$(LD) $(LD_RFLAG) -r -o $@ r128_drv.o r128_bufs.o r128_dma.o \
r128_context.o $(L_OBJS)
diff --git a/linux/agpsupport.c b/linux/agpsupport.c
index c89c3e25..628e8cad 100644
--- a/linux/agpsupport.c
+++ b/linux/agpsupport.c
@@ -313,3 +313,15 @@ drm_agp_head_t *drm_agp_init(void)
}
return head;
}
+
+void drm_agp_uninit(void)
+{
+ drm_agp_fill_t *fill;
+
+ for (fill = &drm_agp_fill[0]; fill->name; fill++) {
+#if LINUX_VERSION_CODE >= 0x020400
+ if ((*fill->f).address) put_module_symbol((*fill->f).address);
+#endif
+ (*fill->f).address = 0;
+ }
+}
diff --git a/linux/drmP.h b/linux/drmP.h
index 866aabf6..d8791bf9 100644
--- a/linux/drmP.h
+++ b/linux/drmP.h
@@ -728,6 +728,7 @@ extern void drm_ctxbitmap_free(drm_device_t *dev, int ctx_handle);
#ifdef DRM_AGP
/* AGP/GART support (agpsupport.c) */
extern drm_agp_head_t *drm_agp_init(void);
+extern void drm_agp_uninit(void);
extern int drm_agp_acquire(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int drm_agp_release(struct inode *inode, struct file *filp,
diff --git a/linux/gamma_drv.c b/linux/gamma_drv.c
index cfe20ad8..7290bc28 100644
--- a/linux/gamma_drv.c
+++ b/linux/gamma_drv.c
@@ -30,7 +30,9 @@
*/
#include <linux/config.h>
+#ifndef EXPORT_SYMTAB
#define EXPORT_SYMTAB
+#endif
#include "drmP.h"
#include "gamma_drv.h"
#include <linux/pci.h>
diff --git a/linux/i810_drv.c b/linux/i810_drv.c
index c01008ef..d8c49a57 100644
--- a/linux/i810_drv.c
+++ b/linux/i810_drv.c
@@ -30,7 +30,9 @@
*/
#include <linux/config.h>
+#ifndef EXPORT_SYMTAB
#define EXPORT_SYMTAB
+#endif
#include "drmP.h"
#include "i810_drv.h"
@@ -420,6 +422,7 @@ void i810_cleanup(void)
drm_ctxbitmap_cleanup(dev);
i810_takedown(dev);
if (dev->agp) {
+ drm_agp_uninit();
drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
dev->agp = NULL;
}
diff --git a/linux/mga_drv.c b/linux/mga_drv.c
index 75f14bee..30c8880f 100644
--- a/linux/mga_drv.c
+++ b/linux/mga_drv.c
@@ -31,7 +31,9 @@
*/
#include <linux/config.h>
+#ifndef EXPORT_SYMTAB
#define EXPORT_SYMTAB
+#endif
#include "drmP.h"
#include "mga_drv.h"
EXPORT_SYMBOL(mga_init);
@@ -434,6 +436,7 @@ void mga_cleanup(void)
mga_takedown(dev);
if (dev->agp) {
+ drm_agp_uninit();
drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
dev->agp = NULL;
}
diff --git a/linux/r128_drv.c b/linux/r128_drv.c
index 125de17d..e78d0231 100644
--- a/linux/r128_drv.c
+++ b/linux/r128_drv.c
@@ -30,7 +30,9 @@
*/
#include <linux/config.h>
+#ifndef EXPORT_SYMTAB
#define EXPORT_SYMTAB
+#endif
#include "drmP.h"
#include "r128_drv.h"
EXPORT_SYMBOL(r128_init);
@@ -409,7 +411,7 @@ void r128_cleanup(void)
r128_takedown(dev);
#ifdef DRM_AGP
if (dev->agp) {
- /* FIXME -- free other information, too */
+ drm_agp_uninit();
drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
dev->agp = NULL;
}
diff --git a/linux/tdfx_drv.c b/linux/tdfx_drv.c
index b8e2ec30..97bd4180 100644
--- a/linux/tdfx_drv.c
+++ b/linux/tdfx_drv.c
@@ -31,7 +31,9 @@
*/
#include <linux/config.h>
+#ifndef EXPORT_SYMTAB
#define EXPORT_SYMTAB
+#endif
#include "drmP.h"
#include "tdfx_drv.h"
EXPORT_SYMBOL(tdfx_init);
@@ -241,9 +243,7 @@ static int tdfx_takedown(drm_device_t *dev)
drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
temp = temp_next;
}
- if(dev->agp->acquired) (*drm_agp.release)();
- drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
- dev->agp = NULL;
+ if (dev->agp->acquired) (*drm_agp.release)();
}
#endif
/* Clear vma list (only built for debugging) */
@@ -368,6 +368,13 @@ void tdfx_cleanup(void)
}
drm_ctxbitmap_cleanup(dev);
tdfx_takedown(dev);
+#ifdef DRM_AGP
+ if (dev->agp) {
+ drm_agp_uninit();
+ drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
+ dev->agp = NULL;
+ }
+#endif
}
int tdfx_version(struct inode *inode, struct file *filp, unsigned int cmd,