Re: [PATCH v11 5/6] drm/panthor: Support sparse mappings
From: Boris Brezillon
Date: Wed May 13 2026 - 12:27:02 EST
On Wed, 13 May 2026 16:46:17 +0100
Steven Price <steven.price@xxxxxxx> wrote:
> On 07/05/2026 22:49, Adrián Larumbe wrote:
> > Allow UM to bind sparsely populated memory regions by cyclically mapping
> > virtual ranges over a kernel-allocated dummy BO. This alternative is
> > preferable to the old method of handling sparseness in the UMD, because it
> > relied on the creation of a buffer object to the same end, despite the fact
> > Vulkan sparse resources don't need to be backed by a driver BO.
> >
> > The choice of backing sparsely-bound regions with a Panthor BO was made so
> > as to profit from the existing shrinker reclaim code. That way no special
> > treatment must be given to the dummy sparse BOs when reclaiming memory, as
> > would be the case if we had chosen a raw kernel page implementation.
>
> Do you need to fix up the remap_evicted_vma() path though? At the moment
> that will go through panthor_vm_map_pages() without doing the
> panthor_fix_sparse_map_offset() dance. Also I suspect it won't map the
> whole region (just the first 2MB in the sgtable).
>
> Maybe I'm missing something?
Nope, you're right, we definitely need to special-case sparse-mappings
in the remap_evicted_vma() path.