summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_execbuf_util.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-09-12 13:58:27 +1000
committerDave Airlie <airlied@redhat.com>2014-09-12 13:58:27 +1000
commit10d123b2f2b5bf54f59a884f12018d24a97d5a63 (patch)
tree308e3e9a7e687e9324fb7b18b5d9f90309f49ee7 /drivers/gpu/drm/ttm/ttm_execbuf_util.c
parente351943b081f4d9e6f692ce1a6117e8d2e71f478 (diff)
parent298593b609ecbf9e8a99e8a41c8c46acb3528468 (diff)
downloadlinux-10d123b2f2b5bf54f59a884f12018d24a97d5a63.tar.bz2
Merge branch 'drm-next-3.18' of git://people.freedesktop.org/~agd5f/linux into drm-next
concurrent buffer reads. * 'drm-next-3.18' of git://people.freedesktop.org/~agd5f/linux: drm/radeon: allow concurrent buffer reads drm/radeon: add the infrastructure for concurrent buffer access drm/ttm: allow fence to be added as shared
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_execbuf_util.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_execbuf_util.c18
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);
}