summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Fonseca <jrfonseca@users.sourceforge.net>2003-06-07 12:30:22 +0000
committerJose Fonseca <jrfonseca@users.sourceforge.net>2003-06-07 12:30:22 +0000
commite3a149f08095f1a7321fce890b1337098485f254 (patch)
tree2ca7efdb5a5e7e76c443135268cac9ff1fd37851
parentf723f743c55156039525a5f49dfe6e0fd141c8df (diff)
Check that the AGPGART "drm_agp" symbol pointer is valid before
initializing the DRM device - this was causing a kernel oops when the AGPGART module wasn't loaded.
-rw-r--r--linux/drm_agp.h2
-rw-r--r--linux/drm_agp_tmp.h6
2 files changed, 6 insertions, 2 deletions
diff --git a/linux/drm_agp.h b/linux/drm_agp.h
index 27c2b29f9..251245e6a 100644
--- a/linux/drm_agp.h
+++ b/linux/drm_agp.h
@@ -70,7 +70,7 @@ typedef struct drm_agp_head {
extern int DRM(agp_acquire)(void);
extern void DRM(agp_release)(void);
-extern void DRM(agp_enable)(unsigned mode);
+extern void DRM(agp_enable)(unsigned long mode);
extern agp_memory *DRM(agp_allocate_memory)(size_t pages, u32 type);
extern int DRM(agp_free_memory)(agp_memory *handle);
extern int DRM(agp_bind_memory)(agp_memory *handle, off_t start);
diff --git a/linux/drm_agp_tmp.h b/linux/drm_agp_tmp.h
index c247ec882..2418d791b 100644
--- a/linux/drm_agp_tmp.h
+++ b/linux/drm_agp_tmp.h
@@ -77,7 +77,7 @@ void DRM(agp_release)(void)
/**
* Enable the AGP bus.
*/
-void DRM(agp_enable)(unsigned mode)
+void DRM(agp_enable)(unsigned long mode)
{
if (drm_agp->enable)
drm_agp->enable(mode);
@@ -494,6 +494,9 @@ void DRM(agp_init_dev)(drm_device_t *dev)
{
drm_agp_head_t *head = NULL;
+ if (!drm_agp)
+ return;
+
if (!(head = DRM(alloc)(sizeof(*head), DRM_MEM_AGPLISTS)))
return;
@@ -501,6 +504,7 @@ void DRM(agp_init_dev)(drm_device_t *dev)
drm_agp->copy_info(&head->agp_info);
if (head->agp_info.chipset == NOT_SUPPORTED) {
DRM(free)(head, sizeof(*head), DRM_MEM_AGPLISTS);
+ return;
}
head->memory = NULL;
#if LINUX_VERSION_CODE <= 0x020408