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 6DB35C982FA for ; Tue, 22 Sep 2026 14:50:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C2C9910E4DA; Tue, 22 Sep 2026 14:50:17 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.b="IkDWOytE"; dkim-atps=neutral Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E7C010E4DA for ; Tue, 22 Sep 2026 14:50:16 +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 0FC471576 for ; Tue, 22 Sep 2026 07:50:12 -0700 (PDT) Received: from [10.2.11.34] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5A25E3F632 for ; Tue, 22 Sep 2026 07:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1790088615; bh=psyvy7+izG3d0GE/Mm0MZMY+HAxJkalnhHOIOMRhjJA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IkDWOytEv+aodJiRa14SOMnCyWFVrR2zt7EcPvWxvLDzF19GPoSc+TxFoATS+qirQ wr4ON1ui+LmazSmA58+fj6mIYsbwOlFIfEMqA0eyAlC4iEEzFXH0yLaglIMQCTOobv +ubCsH6ADfUUBYJkRWMbpCya6FZwNhcEVvYtlJZs= Date: Tue, 22 Sep 2026 15:50:12 +0100 From: Liviu Dudau To: Akash Goel Cc: boris.brezillon@collabora.com, steven.price@arm.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, nd@arm.com Subject: Re: [PATCH] drm/panthor: Fix handling of NO_MMAP BOs Message-ID: References: <20260922100743.447700-1-akash.goel@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260922100743.447700-1-akash.goel@arm.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 Tue, Sep 22, 2026 at 11:07:43AM +0100, Akash Goel wrote: > The BOs created with DRM_PANTHOR_BO_NO_MMAP flag are not supposed to be > mmappable by the Userspace. But after the rework to support shrinker, > it became possible to mmap NO_MMAP BOs. Userspace could second guess > the file offset range, allocated unconditionally at the BO creation > time, and create a CPU mapping. There may not be any adverse effect of > such a CPU mapping though. > This commit removes the unconditional allocation of file offset range > when a user/kernel BO is created. For user BOs, allocation of file > offset range would be done from BO_MMAP_OFFSET ioctl handler which has > a check for NO_MMAP flag. For kernel BOs, there is no need to allocate > file offset range. > > Fixes: 68cbf96b1e9b ("drm/panthor: Part ways with drm_gem_shmem_object") > Suggested-by: Boris Brezillon > Signed-off-by: Akash Goel Reviewed-by: Liviu Dudau Best regards, Liviu > --- > drivers/gpu/drm/panthor/panthor_gem.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c > index c07a44057e42..5cfe66537e87 100644 > --- a/drivers/gpu/drm/panthor/panthor_gem.c > +++ b/drivers/gpu/drm/panthor/panthor_gem.c > @@ -1021,10 +1021,6 @@ panthor_gem_create(struct drm_device *dev, size_t size, uint32_t flags, > mapping_set_gfp_mask(bo->base.filp->f_mapping, > GFP_HIGHUSER | __GFP_RETRY_MAYFAIL | __GFP_NOWARN); > > - ret = drm_gem_create_mmap_offset(&bo->base); > - if (ret) > - goto err_put; > - > if (exclusive_vm) { > bo->exclusive_vm_root_gem = panthor_vm_root_gem(exclusive_vm); > drm_gem_object_get(bo->exclusive_vm_root_gem); > -- > 2.25.1 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯