drm/panfrost: Internally label some BOs

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@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://lore.kernel.org/r/20250520174634.353267-3-adrian.larumbe@collabora.com
This commit is contained in:
Adrián Larumbe 2025-05-20 18:43:59 +01:00 committed by Steven Price
parent e0e33f9bbb
commit ca8b3216dc
2 changed files with 12 additions and 0 deletions

View File

@ -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;
}

View File

@ -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.