On Fri, 13 Feb 2026 18:01:03 +0000
Adrián Larumbe <[email protected]> wrote:
> > +static struct sg_table *
> > +panthor_gem_dev_map_get_sgt_locked(struct panthor_gem_object *bo)
> > +{
> > + struct sg_table *sgt;
> > + int ret;
> > +
> > + dma_resv_assert_held(bo->base.resv);
> > +
> > + if (bo->dmap.sgt)
> > + return bo->dmap.sgt;
> > +
> > + if (drm_WARN_ON_ONCE(bo->base.dev, !bo->backing.pages))
> > + return ERR_PTR(-EINVAL);
>
> If we know bo->backing.pages is available by now, then the next call to
> panthor_gem_backing_get_pages_locked() would be unnecessary, since it only
> fetches the pages but doesn't change their reference count.
I think I'll drop the `if (!pages) return EINVAL;` so we can use
panthor_gem_dev_map_get_sgt_locked() without force a get_pages() first.