public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Adrián Larumbe" <adrian.larumbe@collabora.com>
To: Dave Airlie <airlied@gmail.com>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	 Steven Price <steven.price@arm.com>,
	Boris Brezillon <boris.brezillon@collabora.com>,
	 Janne Grunau <j@jannau.net>,
	kernel@collabora.com
Subject: Re: [PATCH v5 00/11] Support repeated mappings in GPUVM and Panthor
Date: Wed, 25 Mar 2026 18:11:48 +0000	[thread overview]
Message-ID: <acQk5DFDM0I6609-@sobremesa> (raw)
In-Reply-To: <CAPM=9ty41ehnPCuiwHJGtRsnrdoOL0w=hpxnA_Fi3YDo+=6dfA@mail.gmail.com>

Hi Dave,

On 25.03.2026 06:51, Dave Airlie wrote:
> On Sat, 14 Mar 2026 at 01:19, Adrián Larumbe
> <adrian.larumbe@collabora.com> wrote:
> >
> > This patch series adds OP_MAP_REPEAT flag, which lets the user map a BO
> > region over an address range repeatedly with just one map operation.
> >
> > Sparse resources in the Vulkan API let the user leave regions of a
> > resource unmapped (from the API perspective.) Accesses to such regions
> > must not result in program termination, but loads produce undefined
> > values.
> >
> > To implement this feature on Mali hardware, Vulkan sparse unmap is
> > implemented by mapping the specified region to a "dummy bo" so that the
> > accesses do not fault. A newly created sparse resource starts off
> > unmapped, and therefore also has to be mapped to the "dummy bo".  This
> > "dummy bo" is small (a page size) in comparison to the sizes of va
> > ranges that we might want to map to it, and a large number of vm_bind
> > ops can be necessary. For example, if the user were to create a
> > 100e6-byte sparse resident resource, we'd have to poke VM_BIND with
> > ceil(100e6/0x1000)=24415 map operations.
>
> So other drivers pass a NULL (xe) operation to their VM BIND which
> then goes into the kernel and is handled in the backend to write the
> special sparse PT entry.
>
> Can't you just do the same thing in the driver backend, have a dummy
> bo allocated in the kernel and map the pages to it when you see a NULL
> mapping,

We could. There's been some ongoing talk among Collaborans about whether to move
all this functionality into the driver backend. We decided to keep it part of the
gpuvm core because we thought other drivers might profit from it, but if there's
no such interest, I think it's best to leave the DRM core untouched and handle
repeated mappings the way you suggested.

> or does this mess up some accounting or refcounts?
>
> Dave.

Adrian Larumbe

  reply	other threads:[~2026-03-25 18:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13 15:09 [PATCH v5 00/11] Support repeated mappings in GPUVM and Panthor Adrián Larumbe
2026-03-13 15:09 ` [PATCH v5 01/11] drm/panthor: Expose GPU page sizes to UM Adrián Larumbe
2026-03-13 15:09 ` [PATCH v5 02/11] drm/gpuvm: Remove dead code Adrián Larumbe
2026-03-26 22:10   ` Danilo Krummrich
2026-03-13 15:09 ` [PATCH v5 03/11] drm/gpuvm: Fix comment to reflect remap operation operand status Adrián Larumbe
2026-03-13 15:09 ` [PATCH v5 04/11] drm/gpuvm: Add a helper to check if two VA can be merged Adrián Larumbe
2026-03-26 22:44   ` Danilo Krummrich
2026-03-27  9:31   ` Alice Ryhl
2026-03-13 15:09 ` [PATCH v5 05/11] drm/gpuvm: Add a flags field to drm_gpuva_op_map Adrián Larumbe
2026-03-26 23:01   ` Danilo Krummrich
2026-03-13 15:09 ` [PATCH v5 06/11] drm/gpuvm: Add DRM_GPUVA_REPEAT flag and logic Adrián Larumbe
2026-03-26 23:18   ` Danilo Krummrich
2026-03-13 15:09 ` [PATCH v5 07/11] drm/gpuvm: Ensure correctness of unmap/remaps of repeated regions Adrián Larumbe
2026-03-26 23:39   ` Danilo Krummrich
2026-03-13 15:09 ` [PATCH v5 08/11] drm/panthor: Add support for repeated mappings Adrián Larumbe
2026-03-13 15:09 ` [PATCH v5 09/11] drm/panthor: Handle remap case " Adrián Larumbe
2026-03-13 15:09 ` [PATCH v5 10/11] drm/panthor: Pass vm_bind_op to vm_prepare_map_op_ctx Adrián Larumbe
2026-03-13 15:09 ` [PATCH v5 11/11] drm/panthor: Bump the driver version to 1.8 Adrián Larumbe
2026-03-24 20:51 ` [PATCH v5 00/11] Support repeated mappings in GPUVM and Panthor Dave Airlie
2026-03-25 18:11   ` Adrián Larumbe [this message]
2026-03-25 18:17     ` Rob Clark
2026-03-25 19:25   ` Janne Grunau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=acQk5DFDM0I6609-@sobremesa \
    --to=adrian.larumbe@collabora.com \
    --cc=airlied@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=j@jannau.net \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=steven.price@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox