Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Adrián Larumbe and committed by
Steven Price
ca8b3216 e0e33f9b

+12
+10
drivers/gpu/drm/panfrost/panfrost_gem.c
··· 305 305 bo = to_panfrost_bo(obj); 306 306 bo->noexec = true; 307 307 308 + /* 309 + * We assign this generic label because this function cannot 310 + * be reached through any of the Panfrost UM driver-specific 311 + * code paths, unless one is given by explicitly calling the 312 + * SET_LABEL_BO ioctl. It is therefore preferable to have a 313 + * blanket BO tag that tells us the object was imported from 314 + * another driver than nothing at all. 315 + */ 316 + panfrost_gem_internal_set_label(obj, "GEM PRIME buffer"); 317 + 308 318 return obj; 309 319 } 310 320
+2
drivers/gpu/drm/panfrost/panfrost_perfcnt.c
··· 111 111 goto err_put_mapping; 112 112 perfcnt->buf = map.vaddr; 113 113 114 + panfrost_gem_internal_set_label(&bo->base, "Perfcnt sample buffer"); 115 + 114 116 /* 115 117 * Invalidate the cache and clear the counters to start from a fresh 116 118 * state.