summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_object.c
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2010-04-26 15:52:20 -0400
committerDave Airlie <airlied@redhat.com>2010-05-18 18:21:17 +1000
commit5876dd249e8e47c730cac090bf6edd88e5f04327 (patch)
treece5c99862483dca878bef6ac8c8280c380344f4e /drivers/gpu/drm/radeon/radeon_object.c
parent2aba631c008e7d82e3ec45dd32bec1ea63a963cf (diff)
radeon: Unmap vram pages when reclocking
Touching vram while the card is reclocking can lead to lockups. Unmap any pages that could be touched by the CPU and block any accesses to vram until the reclocking is complete. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_object.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_object.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index 6a8617bac14..06def708b01 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -112,9 +112,11 @@ int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj,
radeon_ttm_placement_from_domain(bo, domain);
/* Kernel allocation are uninterruptible */
+ mutex_lock(&rdev->vram_mutex);
r = ttm_bo_init(&rdev->mman.bdev, &bo->tbo, size, type,
&bo->placement, 0, 0, !kernel, NULL, size,
&radeon_ttm_bo_destroy);
+ mutex_unlock(&rdev->vram_mutex);
if (unlikely(r != 0)) {
if (r != -ERESTARTSYS)
dev_err(rdev->dev,
@@ -170,7 +172,9 @@ void radeon_bo_unref(struct radeon_bo **bo)
if ((*bo) == NULL)
return;
tbo = &((*bo)->tbo);
+ mutex_lock(&(*bo)->rdev->vram_mutex);
ttm_bo_unref(&tbo);
+ mutex_unlock(&(*bo)->rdev->vram_mutex);
if (tbo == NULL)
*bo = NULL;
}