diff options
author | Maarten Lankhorst <maarten.lankhorst@canonical.com> | 2014-04-09 10:19:30 -0400 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@canonical.com> | 2014-09-02 11:28:48 -0400 |
commit | 809e9447b92ffe1346b2d6ec390e212d5307f61c (patch) | |
tree | 11d04d4ef34cd681cf63efa11a90992c7865eb27 /drivers/gpu/drm/nouveau/nouveau_bo.c | |
parent | 9242829a87e970773628f30522d2278dd91890ec (diff) |
drm/nouveau: use shared fences for readable objects
nouveau keeps track in userspace whether a buffer is being
written to or being read, but it doesn't use that information.
Change this to allow multiple readers on the same bo.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Acked-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.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 6cf7db070faf..eea74b127b03 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c | |||
@@ -94,7 +94,7 @@ nv10_bo_put_tile_region(struct drm_device *dev, struct nouveau_drm_tile *tile, | |||
94 | 94 | ||
95 | if (tile) { | 95 | if (tile) { |
96 | spin_lock(&drm->tile.lock); | 96 | spin_lock(&drm->tile.lock); |
97 | tile->fence = nouveau_fence_ref((struct nouveau_fence *)fence); | 97 | tile->fence = (struct nouveau_fence *)fence_get(fence); |
98 | tile->used = false; | 98 | tile->used = false; |
99 | spin_unlock(&drm->tile.lock); | 99 | spin_unlock(&drm->tile.lock); |
100 | } | 100 | } |
@@ -970,7 +970,7 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, | |||
970 | } | 970 | } |
971 | 971 | ||
972 | mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING); | 972 | mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING); |
973 | ret = nouveau_fence_sync(nouveau_bo(bo), chan); | 973 | ret = nouveau_fence_sync(nouveau_bo(bo), chan, true); |
974 | if (ret == 0) { | 974 | if (ret == 0) { |
975 | ret = drm->ttm.move(chan, bo, &bo->mem, new_mem); | 975 | ret = drm->ttm.move(chan, bo, &bo->mem, new_mem); |
976 | if (ret == 0) { | 976 | if (ret == 0) { |
@@ -1458,11 +1458,14 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt *ttm) | |||
1458 | } | 1458 | } |
1459 | 1459 | ||
1460 | void | 1460 | void |
1461 | nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence) | 1461 | nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence, bool exclusive) |
1462 | { | 1462 | { |
1463 | struct reservation_object *resv = nvbo->bo.resv; | 1463 | struct reservation_object *resv = nvbo->bo.resv; |
1464 | 1464 | ||
1465 | reservation_object_add_excl_fence(resv, &fence->base); | 1465 | if (exclusive) |
1466 | reservation_object_add_excl_fence(resv, &fence->base); | ||
1467 | else if (fence) | ||
1468 | reservation_object_add_shared_fence(resv, &fence->base); | ||
1466 | } | 1469 | } |
1467 | 1470 | ||
1468 | struct ttm_bo_driver nouveau_bo_driver = { | 1471 | struct ttm_bo_driver nouveau_bo_driver = { |