summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Daenzer <michel@daenzer.net>2003-07-25 10:31:37 +0000
committerMichel Daenzer <michel@daenzer.net>2003-07-25 10:31:37 +0000
commit32ef0f59a8d62460da338568af347286aa450146 (patch)
tree5ecdd097da6ec25cc5a2a303b4cd6ae4fc297955
parent3669639b2162d0ec0d3f9b47b2e443b6d89d1cee (diff)
Fail in DRM(agp_acquire) if the AGP aperture can't be used, such that the X
server falls back to PCI GART or disables the DRI gracefully
-rw-r--r--linux-core/drm_agpsupport.c4
-rw-r--r--linux/drm_agpsupport.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c
index bab7b45c..6eaadfc2 100644
--- a/linux-core/drm_agpsupport.c
+++ b/linux-core/drm_agpsupport.c
@@ -106,6 +106,10 @@ int DRM(agp_acquire)(struct inode *inode, struct file *filp,
if (!dev->agp || dev->agp->acquired || !drm_agp->acquire)
return -EINVAL;
+#ifndef VMAP_4_ARGS
+ if ( dev->agp->cant_use_aperture )
+ return -EINVAL;
+#endif
if ((retcode = drm_agp->acquire())) return retcode;
dev->agp->acquired = 1;
return 0;
diff --git a/linux/drm_agpsupport.h b/linux/drm_agpsupport.h
index bab7b45c..6eaadfc2 100644
--- a/linux/drm_agpsupport.h
+++ b/linux/drm_agpsupport.h
@@ -106,6 +106,10 @@ int DRM(agp_acquire)(struct inode *inode, struct file *filp,
if (!dev->agp || dev->agp->acquired || !drm_agp->acquire)
return -EINVAL;
+#ifndef VMAP_4_ARGS
+ if ( dev->agp->cant_use_aperture )
+ return -EINVAL;
+#endif
if ((retcode = drm_agp->acquire())) return retcode;
dev->agp->acquired = 1;
return 0;