public inbox for dri-devel@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: "Adrián Larumbe" <adrian.larumbe@collabora.com>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Steven Price <steven.price@arm.com>,
	kernel@collabora.com, Liviu Dudau <liviu.dudau@arm.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Daniel Almeida <daniel.almeida@collabora.com>,
	Alice Ryhl <aliceryhl@google.com>
Subject: Re: [PATCH v7 5/6] drm/panthor: Support sparse mappings
Date: Thu, 16 Apr 2026 08:55:37 +0200	[thread overview]
Message-ID: <20260416085537.6af9e2c8@fedora> (raw)
In-Reply-To: <aeAMgA7XCHXc3Hch@sobremesa>

On Wed, 15 Apr 2026 23:09:17 +0100
Adrián Larumbe <adrian.larumbe@collabora.com> wrote:

> > > @@ -2251,14 +2383,17 @@ static int panthor_gpuva_sm_step_remap(struct drm_gpuva_op *op,
> > >  	}
> > >
> > >  	if (op->remap.prev) {
> > > -		struct panthor_gem_object *bo = to_panthor_bo(op->remap.prev->gem.obj);
> > > -		u64 offset = op->remap.prev->gem.offset + unmap_start - op->remap.prev->va.addr;
> > > -		u64 size = op->remap.prev->va.addr + op->remap.prev->va.range - unmap_start;
> > > +		const struct drm_gpuva_op_map map_op = {
> > > +			.va.addr = unmap_start,
> > > +			.va.range =
> > > +			op->remap.prev->va.addr + op->remap.prev->va.range - unmap_start,
> > > +			.gem.obj = op->remap.prev->gem.obj,
> > > +			.gem.offset =
> > > +			op->remap.prev->gem.offset + unmap_start - op->remap.prev->va.addr,  
> >
> > I believe it should be forced to zero if this is a sparse
> > mapping, no? This makes me think we probably want this to be
> > NULL, in the case of a sparse mapping. It shouldn't prevent
> > reclaim from happening on the dummy BO, because the drm_gpuva
> > has a separate vm_bo field. Yes it forces us to add bunch of
> > is_sparse checks in a few other places, but I find it cleaner
> > than pretending this is a regular BO.  
> 
> The .gem.offset field is assigned here unconditionally, but discarded in cases it's a sparse mapping
> when calling panthor_vm_map_sparse() (which takes no offset argument). I assume what you mean is that
> in panthor_vm_exec_op(), I should abstain from assining .map.gem.obj and .map.gem.offset. However,
> if I do that, the 'va->vm_bo = drm_gpuvm_bo_get(vm_bo);' will never happen inside drm_gpuva_link().

Ah, crap! I thought drm_gpuva_link() was only considering vm_bo. Okay,
let's keep it the way you did it then, and just add a comment
explaining unmap_op.keep can't be trusted when the mapping is sparse.

  reply	other threads:[~2026-04-16  6:55 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15 11:28 [PATCH v7 0/6] Support sparse mappings in Panthor Adrián Larumbe
2026-04-15 11:28 ` [PATCH v7 1/6] drm/panthor: Expose GPU page sizes to UM Adrián Larumbe
2026-04-15 13:10   ` Boris Brezillon
2026-04-15 15:19   ` Steven Price
2026-04-15 11:28 ` [PATCH v7 2/6] drm/panthor: Pass vm_bind_op to vm_prepare_map_op_ctx Adrián Larumbe
2026-04-15 13:11   ` Boris Brezillon
2026-04-15 15:19   ` Steven Price
2026-04-15 11:28 ` [PATCH v7 3/6] drm/panthor: Delete spurious whitespace from uAPI header Adrián Larumbe
2026-04-15 13:41   ` Boris Brezillon
2026-04-15 15:19   ` Steven Price
2026-04-15 11:28 ` [PATCH v7 4/6] drm/panthor: Remove unused operation context field Adrián Larumbe
2026-04-15 13:41   ` Boris Brezillon
2026-04-15 15:20   ` Steven Price
2026-04-15 11:28 ` [PATCH v7 5/6] drm/panthor: Support sparse mappings Adrián Larumbe
2026-04-15 15:12   ` Boris Brezillon
2026-04-15 22:09     ` Adrián Larumbe
2026-04-16  6:55       ` Boris Brezillon [this message]
2026-04-16  7:03       ` Boris Brezillon
2026-04-15 23:15     ` Adrián Larumbe
2026-04-15 11:28 ` [PATCH v7 6/6] drm/panthor: Bump the driver version to 1.9 Adrián Larumbe
2026-04-15 13:54   ` Jani Nikula
2026-04-15 14:01     ` Adrián Larumbe
2026-04-15 16:20       ` Jani Nikula
2026-04-15 15:26     ` Boris Brezillon
2026-04-15 15:22   ` Boris Brezillon
2026-04-15 15:27     ` Boris Brezillon

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=20260416085537.6af9e2c8@fedora \
    --to=boris.brezillon@collabora.com \
    --cc=adrian.larumbe@collabora.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=daniel.almeida@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=steven.price@arm.com \
    --cc=tzimmermann@suse.de \
    /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