summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_ttm.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-05-09 15:34:59 +0200
committerDave Airlie <airlied@redhat.com>2012-05-09 18:22:46 +0200
commit7c0d409db56dab0fb211d7710403456c7b4b794b (patch)
tree36131dc6bf8775e726f46009fa1246c7777608c0 /drivers/gpu/drm/radeon/radeon_ttm.c
parentdrm/radeon: rip out the ib pool (diff)
downloadlinux-7c0d409db56dab0fb211d7710403456c7b4b794b.tar.xz
linux-7c0d409db56dab0fb211d7710403456c7b4b794b.zip
drm/radeon: immediately free ttm-move semaphore
We can now protected the semaphore ram by a fence, so free it immediately. Signed-off-by: Christian König <deathsimple@vodafone.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_ttm.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_ttm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 5e3d54ded1b3..0f6aee8aa152 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -223,6 +223,7 @@ static int radeon_move_blit(struct ttm_buffer_object *bo,
struct radeon_device *rdev;
uint64_t old_start, new_start;
struct radeon_fence *fence, *old_fence;
+ struct radeon_semaphore *sem = NULL;
int r;
rdev = radeon_get_rdev(bo->bdev);
@@ -272,15 +273,16 @@ static int radeon_move_blit(struct ttm_buffer_object *bo,
bool sync_to_ring[RADEON_NUM_RINGS] = { };
sync_to_ring[old_fence->ring] = true;
- r = radeon_semaphore_create(rdev, &fence->semaphore);
+ r = radeon_semaphore_create(rdev, &sem);
if (r) {
radeon_fence_unref(&fence);
return r;
}
- r = radeon_semaphore_sync_rings(rdev, fence->semaphore,
+ r = radeon_semaphore_sync_rings(rdev, sem,
sync_to_ring, fence->ring);
if (r) {
+ radeon_semaphore_free(rdev, sem, NULL);
radeon_fence_unref(&fence);
return r;
}
@@ -292,6 +294,7 @@ static int radeon_move_blit(struct ttm_buffer_object *bo,
/* FIXME: handle copy error */
r = ttm_bo_move_accel_cleanup(bo, (void *)fence, NULL,
evict, no_wait_reserve, no_wait_gpu, new_mem);
+ radeon_semaphore_free(rdev, sem, fence);
radeon_fence_unref(&fence);
return r;
}