aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_bo.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2013-11-12 19:23:46 -0500
committerBen Skeggs <bskeggs@redhat.com>2013-11-13 23:55:06 -0500
commit5d216f6013d54a6085d5e499407aec6d67e79990 (patch)
tree472870c1928b1533644b8b3e44e5517d0bdc44fa /drivers/gpu/drm/nouveau/nouveau_bo.c
parent0bae1d61c7512580f1622a880d82164c9534fce3 (diff)
drm/nouveau: allow nouveau_fence_ref() to be a noop
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bo.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bo.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 949ab0cbc4ab..129aceed407d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -98,12 +98,7 @@ nv10_bo_put_tile_region(struct drm_device *dev, struct nouveau_drm_tile *tile,
98 98
99 if (tile) { 99 if (tile) {
100 spin_lock(&drm->tile.lock); 100 spin_lock(&drm->tile.lock);
101 if (fence) { 101 tile->fence = nouveau_fence_ref(fence);
102 /* Mark it as pending. */
103 tile->fence = fence;
104 nouveau_fence_ref(fence);
105 }
106
107 tile->used = false; 102 tile->used = false;
108 spin_unlock(&drm->tile.lock); 103 spin_unlock(&drm->tile.lock);
109 } 104 }
@@ -1462,14 +1457,12 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt *ttm)
1462void 1457void
1463nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence) 1458nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence)
1464{ 1459{
1460 struct nouveau_fence *new_fence = nouveau_fence_ref(fence);
1465 struct nouveau_fence *old_fence = NULL; 1461 struct nouveau_fence *old_fence = NULL;
1466 1462
1467 if (likely(fence))
1468 nouveau_fence_ref(fence);
1469
1470 spin_lock(&nvbo->bo.bdev->fence_lock); 1463 spin_lock(&nvbo->bo.bdev->fence_lock);
1471 old_fence = nvbo->bo.sync_obj; 1464 old_fence = nvbo->bo.sync_obj;
1472 nvbo->bo.sync_obj = fence; 1465 nvbo->bo.sync_obj = new_fence;
1473 spin_unlock(&nvbo->bo.bdev->fence_lock); 1466 spin_unlock(&nvbo->bo.bdev->fence_lock);
1474 1467
1475 nouveau_fence_unref(&old_fence); 1468 nouveau_fence_unref(&old_fence);