diff mbox series

[2/3] accel/ivpu: s/drm_gem_shmem_v[un]map/drm_gem_shmem_v[un]map_locked/

Message ID 20250327104300.1982058-2-boris.brezillon@collabora.com (mailing list archive)
State New
Headers show
Series [1/3] accel/ivpu: pages_use_count is now a refcount_t | expand

Commit Message

Boris Brezillon March 27, 2025, 10:42 a.m. UTC
Commit 954907f7147d ("drm/shmem-helper: Refactor locked/unlocked
functions") suffixed drm_gem_shmem_v[un]map with _locked to reflect
the fact these functions must be called with the GEM resv lock held,
but accel drivers were left behind.

Fixes: 954907f7147d ("drm/shmem-helper: Refactor locked/unlocked functions")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Cc: Maciej Falkowski <maciej.falkowski@linux.intel.com>
Cc: Oded Gabbay <ogabbay@kernel.org>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/accel/ivpu/ivpu_gem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Dmitry Osipenko March 27, 2025, 10:47 a.m. UTC | #1
On 3/27/25 13:42, Boris Brezillon wrote:
> Commit 954907f7147d ("drm/shmem-helper: Refactor locked/unlocked
> functions") suffixed drm_gem_shmem_v[un]map with _locked to reflect
> the fact these functions must be called with the GEM resv lock held,
> but accel drivers were left behind.
> 
> Fixes: 954907f7147d ("drm/shmem-helper: Refactor locked/unlocked functions")
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>
> Cc: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> Cc: Maciej Falkowski <maciej.falkowski@linux.intel.com>
> Cc: Oded Gabbay <ogabbay@kernel.org>
> Cc: dri-devel@lists.freedesktop.org
> ---
>  drivers/accel/ivpu/ivpu_gem.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/accel/ivpu/ivpu_gem.c b/drivers/accel/ivpu/ivpu_gem.c
> index 09c9c5256af5..212d21ad2bbd 100644
> --- a/drivers/accel/ivpu/ivpu_gem.c
> +++ b/drivers/accel/ivpu/ivpu_gem.c
> @@ -362,7 +362,7 @@ ivpu_bo_create(struct ivpu_device *vdev, struct ivpu_mmu_context *ctx,
>  
>  	if (flags & DRM_IVPU_BO_MAPPABLE) {
>  		dma_resv_lock(bo->base.base.resv, NULL);
> -		ret = drm_gem_shmem_vmap(&bo->base, &map);
> +		ret = drm_gem_shmem_vmap_locked(&bo->base, &map);
>  		dma_resv_unlock(bo->base.base.resv);
>  
>  		if (ret)
> @@ -387,7 +387,7 @@ void ivpu_bo_free(struct ivpu_bo *bo)
>  
>  	if (bo->flags & DRM_IVPU_BO_MAPPABLE) {
>  		dma_resv_lock(bo->base.base.resv, NULL);
> -		drm_gem_shmem_vunmap(&bo->base, &map);
> +		drm_gem_shmem_vunmap_locked(&bo->base, &map);
>  		dma_resv_unlock(bo->base.base.resv);
>  	}
>  

Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
diff mbox series

Patch

diff --git a/drivers/accel/ivpu/ivpu_gem.c b/drivers/accel/ivpu/ivpu_gem.c
index 09c9c5256af5..212d21ad2bbd 100644
--- a/drivers/accel/ivpu/ivpu_gem.c
+++ b/drivers/accel/ivpu/ivpu_gem.c
@@ -362,7 +362,7 @@  ivpu_bo_create(struct ivpu_device *vdev, struct ivpu_mmu_context *ctx,
 
 	if (flags & DRM_IVPU_BO_MAPPABLE) {
 		dma_resv_lock(bo->base.base.resv, NULL);
-		ret = drm_gem_shmem_vmap(&bo->base, &map);
+		ret = drm_gem_shmem_vmap_locked(&bo->base, &map);
 		dma_resv_unlock(bo->base.base.resv);
 
 		if (ret)
@@ -387,7 +387,7 @@  void ivpu_bo_free(struct ivpu_bo *bo)
 
 	if (bo->flags & DRM_IVPU_BO_MAPPABLE) {
 		dma_resv_lock(bo->base.base.resv, NULL);
-		drm_gem_shmem_vunmap(&bo->base, &map);
+		drm_gem_shmem_vunmap_locked(&bo->base, &map);
 		dma_resv_unlock(bo->base.base.resv);
 	}