mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
dma-buf/drivers: make reserving a shared slot mandatory v4
Audit all the users of dma_resv_add_excl_fence() and make sure they reserve a shared slot also when only trying to add an exclusive fence. This is the next step towards handling the exclusive fence like a shared one. v2: fix missed case in amdgpu v3: and two more radeon, rename function v4: add one more case to TTM, fix i915 after rebase Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20220406075132.3263-2-christian.koenig@amd.com
This commit is contained in:
@@ -214,6 +214,7 @@ void virtio_gpu_array_add_obj(struct virtio_gpu_object_array *objs,
|
||||
|
||||
int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs)
|
||||
{
|
||||
unsigned int i;
|
||||
int ret;
|
||||
|
||||
if (objs->nents == 1) {
|
||||
@@ -222,6 +223,14 @@ int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs)
|
||||
ret = drm_gem_lock_reservations(objs->objs, objs->nents,
|
||||
&objs->ticket);
|
||||
}
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < objs->nents; ++i) {
|
||||
ret = dma_resv_reserve_fences(objs->objs[i]->resv, 1);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user