diff options
author | Dave Airlie <airlied@linux.ie> | 2008-09-18 10:19:08 +1000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2008-09-18 10:19:08 +1000 |
commit | 8f38c28a3924dbda5babcf035911e103f27f9a05 (patch) | |
tree | 9f15d5b72fb77cf79b59ccc6f433343862d84e55 | |
parent | 515aa0800cf2d91bdf4706463e0531c5081a2679 (diff) |
radeon: fail properly if we can't create the ring.
Normally this will be due to an AGP driver needing updating
-rw-r--r-- | linux-core/radeon_gem.c | 15 | ||||
-rw-r--r-- | shared-core/radeon_cp.c | 8 |
2 files changed, 18 insertions, 5 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); + } } diff --git a/shared-core/radeon_cp.c b/shared-core/radeon_cp.c index 63957cd7..6c5bf03b 100644 --- a/shared-core/radeon_cp.c +++ b/shared-core/radeon_cp.c @@ -2549,7 +2549,9 @@ int radeon_driver_load(struct drm_device *dev, unsigned long flags) if (drm_core_check_feature(dev, DRIVER_MODESET)) { - radeon_gem_mm_init(dev); + ret = radeon_gem_mm_init(dev); + if (ret) + goto modeset_fail; radeon_modeset_init(dev); radeon_modeset_cp_init(dev); @@ -2560,6 +2562,10 @@ int radeon_driver_load(struct drm_device *dev, unsigned long flags) return ret; +modeset_fail: + dev->driver->driver_features &= ~DRIVER_MODESET; + drm_put_minor(&dev->control); + return ret; } |