diff options
author | Christian König <christian.koenig@amd.com> | 2014-09-04 20:01:52 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2014-09-11 10:46:00 -0400 |
commit | ae9c0af2c0ea92e57013ab2dd7271ba7d6b2a833 (patch) | |
tree | b524a3c3960582346b60418d068d96317e79696b /drivers/gpu/drm/ttm | |
parent | c4d922b14544d115232b7448a2ea7640ba901eb6 (diff) | |
download | blackbird-op-linux-ae9c0af2c0ea92e57013ab2dd7271ba7d6b2a833.tar.gz blackbird-op-linux-ae9c0af2c0ea92e57013ab2dd7271ba7d6b2a833.zip |
drm/ttm: allow fence to be added as shared
This patch adds a new flag to the ttm_validate_buffer list to
add the fence as shared to the reservation object.
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_execbuf_util.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/ttm/ttm_execbuf_util.c index adafc0f8ec06..8ce508e76208 100644 --- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c +++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c @@ -119,8 +119,14 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket, ret = -EBUSY; } - if (!ret) - continue; + if (!ret) { + if (!entry->shared) + continue; + + ret = reservation_object_reserve_shared(bo->resv); + if (!ret) + continue; + } /* uh oh, we lost out, drop every reservation and try * to only reserve this buffer, then start over if @@ -136,6 +142,9 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket, ret = 0; } + if (!ret && entry->shared) + ret = reservation_object_reserve_shared(bo->resv); + if (unlikely(ret != 0)) { if (ret == -EINTR) ret = -ERESTARTSYS; @@ -183,7 +192,10 @@ void ttm_eu_fence_buffer_objects(struct ww_acquire_ctx *ticket, list_for_each_entry(entry, list, head) { bo = entry->bo; - reservation_object_add_excl_fence(bo->resv, fence); + if (entry->shared) + reservation_object_add_shared_fence(bo->resv, fence); + else + reservation_object_add_excl_fence(bo->resv, fence); ttm_bo_add_to_lru(bo); __ttm_bo_unreserve(bo); } |