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 C98D7F30956 for ; Thu, 5 Mar 2026 12:43:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B643510EB0A; Thu, 5 Mar 2026 12:43:34 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="ZUEZC9Yb"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id 54BA210EAED for ; Thu, 5 Mar 2026 12:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1772714612; bh=RE685jWgv/mcDFFFSRHnwV3LUzghRv3vy+oPxcMPdbk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZUEZC9YbldWwsf/wWNtPfGqEozQPDu+v7SA3OXVWWDsS4v8hc4m9Sxkecy8ffzw/K kbJDSVLoS4qiFF0VUxS1YHzI2y0w43ATeBewQ2hU33IWBf5ki5sj72AGP5RPBM2ZMc qOaz0UJw3v8jwDZpXLK4LKKfLf3ck0cxqxFv3DDIL3HCHIp3rCUEWonndR/Etd8EuU uWj6M5Mwr8kVD1UKLVJqXJ+UlXxdoZUuUrk4ab/9CavgoNv/priSgENAFjcNHPG50I khDdWII/iGzQPn7hgeNJu6tDMWgOqT/pRteRkWR8zS61O/GgnzsAXIS/vv2Y0ItdqV FsToqwiCpkoAg== 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 627B617E12A9; Thu, 5 Mar 2026 13:43:31 +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 , Chia-I Wu , kernel@collabora.com Subject: [PATCH v4 4/9] drm/panthor: Don't call drm_gpuvm_bo_extobj_add() if the object is private Date: Thu, 5 Mar 2026 13:43:15 +0100 Message-ID: <20260305124320.156606-5-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260305124320.156606-1-boris.brezillon@collabora.com> References: <20260305124320.156606-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 v4: - Collect R-bs Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Liviu Dudau --- 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 f8c41e36afa4..f490e0bf6cac 100644 --- a/drivers/gpu/drm/panthor/panthor_mmu.c +++ b/drivers/gpu/drm/panthor/panthor_mmu.c @@ -1283,9 +1283,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.53.0