[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <41515a2d-75c0-4537-888a-8d27c2050a80@arm.com>
Date: Wed, 21 May 2025 16:52:36 +0100
From: Steven Price <steven.price@....com>
To: Adrián Larumbe <adrian.larumbe@...labora.com>,
linux-kernel@...r.kernel.org
Cc: dri-devel@...ts.freedesktop.org,
Boris Brezillon <boris.brezillon@...labora.com>, kernel@...labora.com,
Rob Herring <robh@...nel.org>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>
Subject: Re: [PATCH v3 2/5] drm/panfrost: Internally label some BOs
On 20/05/2025 18:43, Adrián Larumbe wrote:
> Perfcnt samples buffer is not exposed to UM, but we would like to keep
> a tag on it as a potential debug aid.
>
> PRIME imported GEM buffers are UM exposed, but since the usual Panfrost
> UM driver code path is not followed in their creation, they might remain
> unlabelled for their entire lifetime, so a generic tag was deemed
> preferable. The tag is assigned before a UM handle is created so it
> doesn't contradict the logic about labelling internal BOs.
>
> Signed-off-by: Adrián Larumbe <adrian.larumbe@...labora.com>
Reviewed-by: Steven Price <steven.price@....com>
> ---
> drivers/gpu/drm/panfrost/panfrost_gem.c | 10 ++++++++++
> drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 2 ++
> 2 files changed, 12 insertions(+)
>
> diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c
> index 4c5be7ccc9cc..04483d5fb45d 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_gem.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c
> @@ -305,6 +305,16 @@ panfrost_gem_prime_import_sg_table(struct drm_device *dev,
> bo = to_panfrost_bo(obj);
> bo->noexec = true;
>
> + /*
> + * We assign this generic label because this function cannot
> + * be reached through any of the Panfrost UM driver-specific
> + * code paths, unless one is given by explicitly calling the
> + * SET_LABEL_BO ioctl. It is therefore preferable to have a
> + * blanket BO tag that tells us the object was imported from
> + * another driver than nothing at all.
> + */
> + panfrost_gem_internal_set_label(obj, "GEM PRIME buffer");
> +
> return obj;
> }
>
> diff --git a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
> index 52befead08c6..563f16bae543 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
> @@ -111,6 +111,8 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev,
> goto err_put_mapping;
> perfcnt->buf = map.vaddr;
>
> + panfrost_gem_internal_set_label(&bo->base, "Perfcnt sample buffer");
> +
> /*
> * Invalidate the cache and clear the counters to start from a fresh
> * state.
Powered by blists - more mailing lists