On Wed, Feb 11, 2026 at 09:03:38AM +0100, Boris Brezillon wrote:
> drm_gpuvm_bo_extobj_add() is a NOP if the object is private, but it
> forces us to take/release the VM resv lock, so let's do that only when
> we know the object can be shared.
> 
> v3:
> - New commit
> 
> Signed-off-by: Boris Brezillon <[email protected]>

Reviewed-by: Liviu Dudau <[email protected]>

Best regards,
Liviu

> ---
>  drivers/gpu/drm/panthor/panthor_mmu.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c 
> b/drivers/gpu/drm/panthor/panthor_mmu.c
> index ba3b7c93303c..99c794c429ca 100644
> --- a/drivers/gpu/drm/panthor/panthor_mmu.c
> +++ b/drivers/gpu/drm/panthor/panthor_mmu.c
> @@ -1284,9 +1284,11 @@ static int panthor_vm_prepare_map_op_ctx(struct 
> panthor_vm_op_ctx *op_ctx,
>       }
>  
>       /* Insert BO into the extobj list last, when we know nothing can fail. 
> */
> -     dma_resv_lock(panthor_vm_resv(vm), NULL);
> -     drm_gpuvm_bo_extobj_add(op_ctx->map.vm_bo);
> -     dma_resv_unlock(panthor_vm_resv(vm));
> +     if (bo->base.base.resv != panthor_vm_resv(vm)) {
> +             dma_resv_lock(panthor_vm_resv(vm), NULL);
> +             drm_gpuvm_bo_extobj_add(op_ctx->map.vm_bo);
> +             dma_resv_unlock(panthor_vm_resv(vm));
> +     }
>  
>       return 0;
>  
> -- 
> 2.52.0
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

Reply via email to