Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5004EB5979 for ; Wed, 11 Feb 2026 08:04:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 27C7810E1E0; Wed, 11 Feb 2026 08:04:09 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="O7a5+yp7"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id 427D710E1F5 for ; Wed, 11 Feb 2026 08:03:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1770797037; bh=Xfk1xXq/o7IYZanpliudex1w8/eGInBCltTyKPeYvuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O7a5+yp7SSjCaC5fLQcOk8IxQoqiD5Egu5sFOahWrTUqjvqazw223gL4nLgVOKhTN K8HKntMB2xtD5pfi0bcL8v3GNm2TEKjzYheBrn5mVYhCkl9xzaCwPFN9JqE2NSO3du OUo/p+j+awYeMWfmWwP3bpC4fvrrYuIVPYv54VCoZy2QJULslDW3wfJXaMbEQxmi/y brRK3ZaQPnqx3f/WUG5B0Tk/zo76/9rgbcoj1TF8AtdbqzcT5wmgzBO2w4eWYNGIbZ Bt5b5phwcHETVF9FDk+USuXI4x4spu0ErH/SVRreP0OFyO9Em6uMUgjcxEdPMGUYBq ahYKzNeAshQEQ== Received: from fedora (unknown [IPv6:2a01:e0a:2c:6930:a2a7:f53:ebb0:945e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id 4CDF917E35C4; Wed, 11 Feb 2026 09:03:56 +0100 (CET) From: Boris Brezillon To: Boris Brezillon , Steven Price , Liviu Dudau , =?UTF-8?q?Adri=C3=A1n=20Larumbe?= Cc: dri-devel@lists.freedesktop.org, David Airlie , Simona Vetter , Akash Goel , Rob Clark , Sean Paul , Konrad Dybcio , Akhil P Oommen , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Dmitry Osipenko , Chris Diamand , Danilo Krummrich , Matthew Brost , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Alice Ryhl , kernel@collabora.com Subject: [PATCH v3 4/9] drm/panthor: Don't call drm_gpuvm_bo_extobj_add() if the object is private Date: Wed, 11 Feb 2026 09:03:38 +0100 Message-ID: <20260211080343.1887134-5-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260211080343.1887134-1-boris.brezillon@collabora.com> References: <20260211080343.1887134-1-boris.brezillon@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- 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