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
This commit is contained in:
Michel Daenzer 2003-07-25 10:31:37 +00:00
parent 3669639b21
commit 32ef0f59a8
2 changed files with 8 additions and 0 deletions

View file

@ -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;

View file

@ -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;