From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 113F1338592 for ; Fri, 17 Apr 2026 08:19:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776413984; cv=none; b=sgeHCatBLFHGK9Z9RO/delqWvgTq/FMFQkGvbSB3ySn7hbWZe+PCL1ZZyB9uQazRgbXFjCELc0rpnO0MKMWdOwf95YeNkzM84LQO1y6eOlC2HmxPq99Bo3Zf1tfvAjzlMJf9SKH54O4FqOL9Vie77cJ4bT2RUFMLXAuFdQZ07mA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776413984; c=relaxed/simple; bh=p8Qg+u7FXG0U0+sR4wmac5rL1X0J1pM2yQmUYCZGfYc=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KkEIg2QJcafQAn9YQJrRoUOiAHK1G7t5SewmLIVFQvY8eivxu7fQ+pY/tIJaylax7T5T1Yf8loLTTVZEGPbpJy/QzAy5Xw8rQIeff/0ChkouphqbmbZDfCyYiyeW8EUEYbLd8X8pue52LFy/sikuwD8eee5gxbS4WQ5ho3cv0VI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=oIwRTj+C; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="oIwRTj+C" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1776413981; bh=p8Qg+u7FXG0U0+sR4wmac5rL1X0J1pM2yQmUYCZGfYc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oIwRTj+C05g60wAK4lGlTo4FwzwqBL34l9tikxRCCS5tpctXHj4t81l98lxQUTEyb LcqhkMJA7eIozkBfVICmdmwqjBD2Kj2+0ajvuBBJpp0VflT/BVBj5KeQHS1S+ekY2g qAXy6ot59t/g5GPtS9EKYgsZUEU857PDpALn+wRBp7qm34qMmczGXyPMG8y33NwQwT +ZNypPuJkpD9sTjEkWfaalUYaFirg0H8idsimai9IUp8n9BrvU/aTrHkTli2+3LuyE 28knU9zOihbSidn7goZk7HY7AnvRbHMchFlR7iEVz/FgfbfEBZuvHn42EsOeEDKuf1 DSHjozriGX2eg== Received: from fedora (unknown [100.64.0.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id 9AE0117E10A4; Fri, 17 Apr 2026 10:19:40 +0200 (CEST) Date: Fri, 17 Apr 2026 10:19:34 +0200 From: Boris Brezillon To: =?UTF-8?B?QWRyacOhbg==?= Larumbe Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Steven Price , kernel@collabora.com, Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Daniel Almeida , Alice Ryhl Subject: Re: [PATCH v7 5/6] drm/panthor: Support sparse mappings Message-ID: <20260417101934.7320f562@fedora> In-Reply-To: References: <20260415112900.681834-1-adrian.larumbe@collabora.com> <20260415112900.681834-6-adrian.larumbe@collabora.com> <20260415171247.3701e116@fedora> Organization: Collabora X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, 16 Apr 2026 19:25:01 +0100 Adri=C3=A1n Larumbe wrote: > > > +/** > > > + * panthor_dummy_bo_create() - Create a Panthor BO meant to back spa= rse bindings. > > > + * @ptdev: Device. > > > + * > > > + * Return: A valid pointer in case of success, an ERR_PTR() otherwis= e. > > > + */ > > > +struct panthor_gem_object * > > > +panthor_dummy_bo_create(struct panthor_device *ptdev) > > > +{ > > > + u32 dummy_flags =3D DRM_PANTHOR_BO_NO_MMAP; > > > + struct panthor_gem_object *bo; > > > + struct page **pages; > > > + > > > + bo =3D panthor_gem_create(&ptdev->base, SZ_2M, dummy_flags, NULL, 0= ); > > > + if (IS_ERR_OR_NULL(bo)) > > > + return bo; > > > + > > > + pages =3D drm_gem_get_pages(&bo->base); =20 > > > > Why not use panthor_gem_backing_get_pages_locked() here? Also, > > drm_gem_get_pages() doesn't give any guarantee that you'll get a huge > > page, nor can you guarantee that the 2M won't be reclaimed and later > > on be re-allocated as 4k chunks. I'd probably keep things simple for > > now, and > > > > - keep it a 2M GEM object > > - force the page allocation at map time, just like we do for regular BO= s =20 >=20 > On a second thought, if I force page allocation at map time, then there's= no need to wait > until a sparse vm_bind operation to create the dummy BO. I can just do it= at VM creation time > and then let the vm_bind ioctl path allocate the pages. Yep, you can do that, indeed.