Re: [PATCH v10 3/5] drm/gem/shmem: Export drm_gem_shmem_get_pages_sgt_locked()

Alexandre Courbot
2026-04-10T07:55:13Z

On Thu Apr 9, 2026 at 9:12 AM JST, Lyude Paul wrote:
> We will need this for implementing a set of SGTable bindings in Rust for
> gem shmem objects, so that we can use the dma_resv lock to protect
> additional resources in the shmem object.
>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> ---
> drivers/gpu/drm/drm_gem_shmem_helper.c | 16 +++++++++++++++-
> include/drm/drm_gem_shmem_helper.h | 1 +
> 2 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
> index addf8c1e5341e..15de7f6cc4981 100644
> --- a/drivers/gpu/drm/drm_gem_shmem_helper.c
> +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
> @@ -786,12 +786,25 @@ struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_shmem_object *shmem)
> }
> EXPORT_SYMBOL_GPL(drm_gem_shmem_get_sg_table);
>
> -static struct sg_table *drm_gem_shmem_get_pages_sgt_locked(struct drm_gem_shmem_object *shmem)
> +/**
> + * drm_gem_shmem_get_sg_table - Under dma_resv lock, provide a scatter/gather table of

The function name looks incorrect.

> + * pinned pages for an shmem GEM object.
> + * @shmem: shmem GEM object
> + *
> + * This function is the same as drm_gem_shmem_get_pages_sgt, except that the caller is expected to
> + * already hold the dma_resv lock for @shmem.
> + *
> + * Returns:
> + * A poitner to the scatter/gather table of pinned pages, or error pointer on failure.

nit: s/poitner/pointer.

Otherwise,

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>