diff options
| author | Christian König <[email protected]> | 2021-11-16 14:20:45 +0000 |
|---|---|---|
| committer | Christian König <[email protected]> | 2022-04-06 15:38:25 +0000 |
| commit | c8d4c18bfbc4ab467188dbe45cc8155759f49d9e (patch) | |
| tree | c0ecbde97d8d89bed2d7f87a93788bc86d5e56ea /drivers/gpu/drm/virtio/virtgpu_gem.c | |
| parent | drm/drm_modeset_helper_vtables.h: fix a typo (diff) | |
| download | kernel-c8d4c18bfbc4ab467188dbe45cc8155759f49d9e.tar.gz kernel-c8d4c18bfbc4ab467188dbe45cc8155759f49d9e.zip | |
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 <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_gem.c')
| -rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_gem.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index 48d3c9955f0d..1820ca6cf673 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -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; } |
