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 30267EA3F27 for ; Wed, 11 Feb 2026 15:57:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 541C110E0EA; Wed, 11 Feb 2026 15:57:09 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 9CEA510E0EA for ; Wed, 11 Feb 2026 15:57:08 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ADBAE339; Wed, 11 Feb 2026 07:57:01 -0800 (PST) Received: from [10.57.54.250] (unknown [10.57.54.250]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6F3193F632; Wed, 11 Feb 2026 07:57:03 -0800 (PST) Message-ID: <6718246e-0a11-4dae-88b9-ce8192c9dc31@arm.com> Date: Wed, 11 Feb 2026 15:57:00 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 4/9] drm/panthor: Don't call drm_gpuvm_bo_extobj_add() if the object is private To: Boris Brezillon , Liviu Dudau , =?UTF-8?Q?Adri=C3=A1n_Larumbe?= 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_Hellstr=C3=B6m?= , Alice Ryhl , kernel@collabora.com References: <20260211080343.1887134-1-boris.brezillon@collabora.com> <20260211080343.1887134-5-boris.brezillon@collabora.com> From: Steven Price Content-Language: en-GB In-Reply-To: <20260211080343.1887134-5-boris.brezillon@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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" On 11/02/2026 08:03, 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 Reviewed-by: Steven Price > --- > 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; >