From: Boris Brezillon Date: Wed, 1 Apr 2026 13:48:49 +0000 (+0200) Subject: drm/panthor: Don't call drm_gpuvm_bo_extobj_add() if the object is private X-Git-Tag: v7.2-rc1~141^2~26^2~167 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=2b207c47c9cfcdfbaff1be61d09c71b1edc3f0ce;p=thirdparty%2Flinux.git drm/panthor: Don't call drm_gpuvm_bo_extobj_add() if the object is private 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 v4: - Collect R-bs v5: - No changes v6: - No changes v7: - No changes Reviewed-by: Steven Price Reviewed-by: Liviu Dudau Link: https://patch.msgid.link/20260401134854.2275433-6-boris.brezillon@collabora.com Signed-off-by: Boris Brezillon --- diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c index ab67286e3a6e2..ac11c8c6a8631 100644 --- a/drivers/gpu/drm/panthor/panthor_mmu.c +++ b/drivers/gpu/drm/panthor/panthor_mmu.c @@ -1278,9 +1278,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;