drm/ttm: allow reserving more than one shared slot v3
Let's support simultaneous submissions to multiple engines. v2: rename the field to num_shared and fix up all users v3: rebased Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:

committed by
Alex Deucher

parent
c50fe0c5b1
commit
a9f34c70fd
@@ -126,10 +126,11 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket,
|
||||
}
|
||||
|
||||
if (!ret) {
|
||||
if (!entry->shared)
|
||||
if (!entry->num_shared)
|
||||
continue;
|
||||
|
||||
ret = reservation_object_reserve_shared(bo->resv, 1);
|
||||
ret = reservation_object_reserve_shared(bo->resv,
|
||||
entry->num_shared);
|
||||
if (!ret)
|
||||
continue;
|
||||
}
|
||||
@@ -150,8 +151,9 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket,
|
||||
}
|
||||
}
|
||||
|
||||
if (!ret && entry->shared)
|
||||
ret = reservation_object_reserve_shared(bo->resv, 1);
|
||||
if (!ret && entry->num_shared)
|
||||
ret = reservation_object_reserve_shared(bo->resv,
|
||||
entry->num_shared);
|
||||
|
||||
if (unlikely(ret != 0)) {
|
||||
if (ret == -EINTR)
|
||||
@@ -199,7 +201,7 @@ void ttm_eu_fence_buffer_objects(struct ww_acquire_ctx *ticket,
|
||||
|
||||
list_for_each_entry(entry, list, head) {
|
||||
bo = entry->bo;
|
||||
if (entry->shared)
|
||||
if (entry->num_shared)
|
||||
reservation_object_add_shared_fence(bo->resv, fence);
|
||||
else
|
||||
reservation_object_add_excl_fence(bo->resv, fence);
|
||||
|
Reference in New Issue
Block a user