summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2008-09-18 10:19:08 +1000
committerDave Airlie <airlied@linux.ie>2008-09-18 10:19:08 +1000
commit8f38c28a3924dbda5babcf035911e103f27f9a05 (patch)
tree9f15d5b72fb77cf79b59ccc6f433343862d84e55 /linux-core
parent515aa0800cf2d91bdf4706463e0531c5081a2679 (diff)
radeon: fail properly if we can't create the ring.
Normally this will be due to an AGP driver needing updating
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/radeon_gem.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/linux-core/radeon_gem.c b/linux-core/radeon_gem.c
index 58162e52..821a3e13 100644
--- a/linux-core/radeon_gem.c
+++ b/linux-core/radeon_gem.c
@@ -667,7 +667,10 @@ int radeon_alloc_gart_objects(struct drm_device *dev)
DRM_BO_FLAG_MAPPABLE | DRM_BO_FLAG_NO_EVICT,
0, 1, 0, &dev_priv->mm.ring.bo);
if (ret) {
- DRM_ERROR("failed to allocate ring\n");
+ if (dev_priv->flags & RADEON_IS_AGP)
+ DRM_ERROR("failed to allocate ring - most likely an AGP driver bug\n");
+ else
+ DRM_ERROR("failed to allocate ring\n");
return -EINVAL;
}
@@ -1004,8 +1007,10 @@ int radeon_gem_mm_init(struct drm_device *dev)
/* need to allocate some objects in the GART */
/* ring + ring read ptr */
ret = radeon_alloc_gart_objects(dev);
- if (ret)
+ if (ret) {
+ radeon_gem_mm_fini(dev);
return -EINVAL;
+ }
dev_priv->mm_enabled = true;
return 0;
@@ -1508,8 +1513,10 @@ static void radeon_gem_dma_bufs_destroy(struct drm_device *dev)
struct drm_radeon_private *dev_priv = dev->dev_private;
drm_dma_takedown(dev);
- drm_bo_kunmap(&dev_priv->mm.dma_bufs.kmap);
- drm_bo_usage_deref_unlocked(&dev_priv->mm.dma_bufs.bo);
+ if (dev_priv->mm.dma_bufs.bo) {
+ drm_bo_kunmap(&dev_priv->mm.dma_bufs.kmap);
+ drm_bo_usage_deref_unlocked(&dev_priv->mm.dma_bufs.bo);
+ }
}