summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.demon.co.uk>2001-04-06 08:39:02 +0000
committerAlan Hourihane <alanh@fairlite.demon.co.uk>2001-04-06 08:39:02 +0000
commit2bd9bf98c7bc0c23870f86f97341197114c3e70a (patch)
tree668271ef09ab496e9d3d6bd9161cecbf471c5771
parent5d6ddbca26d695561fb1d08d798a0cc254b805e7 (diff)
Handle drivers that don't have __HAVE_SG defined.
-rw-r--r--linux-core/drmP.h2
-rw-r--r--linux-core/drm_drv.c5
-rw-r--r--linux/drmP.h2
-rw-r--r--linux/drm_drv.h5
4 files changed, 14 insertions, 0 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index 085d1cb8..227ec35a 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -999,12 +999,14 @@ extern int DRM(proc_cleanup)(int minor,
struct proc_dir_entry *root,
struct proc_dir_entry *dev_root);
+#if __HAVE_SG
/* Scatter Gather Support (drm_scatter.h) */
extern void DRM(sg_cleanup)(drm_sg_mem_t *entry);
extern int DRM(sg_alloc)(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int DRM(sg_free)(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
+#endif
/* ATI PCIGART support (ati_pcigart.h) */
extern unsigned long DRM(ati_pcigart_init)(drm_device_t *dev);
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index 3791d7a8..5337646f 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -424,10 +424,15 @@ static int DRM(takedown)( drm_device_t *dev )
*/
break;
case _DRM_SCATTER_GATHER:
+ /* Handle it, but do nothing, if HAVE_SG
+ * isn't defined.
+ */
+#if __HAVE_SG
if(dev->sg) {
DRM(sg_cleanup)(dev->sg);
dev->sg = NULL;
}
+#endif
break;
}
DRM(free)(map, sizeof(*map), DRM_MEM_MAPS);
diff --git a/linux/drmP.h b/linux/drmP.h
index 085d1cb8..227ec35a 100644
--- a/linux/drmP.h
+++ b/linux/drmP.h
@@ -999,12 +999,14 @@ extern int DRM(proc_cleanup)(int minor,
struct proc_dir_entry *root,
struct proc_dir_entry *dev_root);
+#if __HAVE_SG
/* Scatter Gather Support (drm_scatter.h) */
extern void DRM(sg_cleanup)(drm_sg_mem_t *entry);
extern int DRM(sg_alloc)(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int DRM(sg_free)(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
+#endif
/* ATI PCIGART support (ati_pcigart.h) */
extern unsigned long DRM(ati_pcigart_init)(drm_device_t *dev);
diff --git a/linux/drm_drv.h b/linux/drm_drv.h
index 3791d7a8..5337646f 100644
--- a/linux/drm_drv.h
+++ b/linux/drm_drv.h
@@ -424,10 +424,15 @@ static int DRM(takedown)( drm_device_t *dev )
*/
break;
case _DRM_SCATTER_GATHER:
+ /* Handle it, but do nothing, if HAVE_SG
+ * isn't defined.
+ */
+#if __HAVE_SG
if(dev->sg) {
DRM(sg_cleanup)(dev->sg);
dev->sg = NULL;
}
+#endif
break;
}
DRM(free)(map, sizeof(*map), DRM_MEM_MAPS);