Am 18.03.25 um 20:22 schrieb Daniel Almeida:
> From: Asahi Lina <l...@asahilina.net>
>
> Since commit 21aa27ddc582 ("drm/shmem-helper: Switch to reservation
> lock"), the drm_gem_shmem_vmap and drm_gem_shmem_vunmap functions
> require that the caller holds the DMA reservation lock for the object.
> Add lockdep assertions to help validate this.
>
> Signed-off-by: Asahi Lina <l...@asahilina.net>
> Signed-off-by: Daniel Almeida <daniel.alme...@collabora.com>

Oh, yeah that is certainly a good idea.

Reviewed-by: Christian König <christian.koe...@amd.com>

> ---
>  drivers/gpu/drm/drm_gem_shmem_helper.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c 
> b/drivers/gpu/drm/drm_gem_shmem_helper.c
> index 
> 5ab351409312b5a0de542df2b636278d6186cb7b..ec89e9499f5f02a2a35713669bf649dd2abb9938
>  100644
> --- a/drivers/gpu/drm/drm_gem_shmem_helper.c
> +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
> @@ -338,6 +338,8 @@ int drm_gem_shmem_vmap(struct drm_gem_shmem_object *shmem,
>       struct drm_gem_object *obj = &shmem->base;
>       int ret = 0;
>  
> +     dma_resv_assert_held(obj->resv);
> +
>       if (obj->import_attach) {
>               ret = dma_buf_vmap(obj->import_attach->dmabuf, map);
>               if (!ret) {
> @@ -404,6 +406,8 @@ void drm_gem_shmem_vunmap(struct drm_gem_shmem_object 
> *shmem,
>  {
>       struct drm_gem_object *obj = &shmem->base;
>  
> +     dma_resv_assert_held(obj->resv);
> +
>       if (obj->import_attach) {
>               dma_buf_vunmap(obj->import_attach->dmabuf, map);
>       } else {
>

Reply via email to