From mboxrd@z Thu Jan 1 00:00:00 1970 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 ED98AEB48FC for ; Thu, 12 Feb 2026 11:06:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E49110E722; Thu, 12 Feb 2026 11:06:41 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 80A9610E722 for ; Thu, 12 Feb 2026 11:06:40 +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 6B77B497 for ; Thu, 12 Feb 2026 03:06:33 -0800 (PST) Received: from [192.168.0.1] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 88AF03F632 for ; Thu, 12 Feb 2026 03:06:39 -0800 (PST) Date: Thu, 12 Feb 2026 11:04:39 +0000 From: Liviu Dudau To: Boris Brezillon Cc: Steven Price , =?utf-8?Q?Adri=C3=A1n?= Larumbe , 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 , Thomas =?utf-8?Q?Hellstr=C3=B6m?= , Alice Ryhl , kernel@collabora.com Subject: Re: [PATCH v3 4/9] drm/panthor: Don't call drm_gpuvm_bo_extobj_add() if the object is private Message-ID: References: <20260211080343.1887134-1-boris.brezillon@collabora.com> <20260211080343.1887134-5-boris.brezillon@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260211080343.1887134-5-boris.brezillon@collabora.com> 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 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 Reviewed-by: Liviu Dudau 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! / --------------- ¯\_(ツ)_/¯