drm/v3d: Add gpu_gem_info node via debugfs 77/281477/3 accepted/tizen_7.0_unified_hotfix old/tizen_20221209 tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.055811 accepted/tizen/7.0/unified/hotfix/20221116.110504 accepted/tizen/unified/20220920.160556 tizen_7.0_m2_release
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 19 Sep 2022 10:35:14 +0000 (19:35 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 20 Sep 2022 04:20:33 +0000 (04:20 +0000)
commitdc9aad9594b2c8a18b15f6315b2d3ff1ff3dbe50
tree3f394ca083454514f6fb97e6de1bb2938fac1f8b
parent7931260bb33638d115602e243d4cc0dc570ef377
drm/v3d: Add gpu_gem_info node via debugfs

Add gpu_gem_info node via debugfs of dri debug sysfs for each
process with pid/tgid and its gem objects. Same gem object can be
opened from multiple processes, so from the gpu_gem_info node,
it can print same gem in multiple lines.

Ported from the commit dea4ace78ec7 ("drm/vc4: Add gem_info node
via debugfs") to v3d.

NOTE: From Raspberry Pi 4 board, v3d gpu is card0 and also render node
in dri card128, so accessing can be from both nodes. For render fixed
node, it is /sys/kernel/debug/dri/128/gpu_gem_info.
Also, Raspberry Pi 4 board gives entire gem count and total size with
/sys/kernel/debug/dri/128/bo_stats.

Change-Id: Ica09a3b92010e15dddc0a7ca117d4544106757f7
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/gpu/drm/v3d/v3d_bo.c
drivers/gpu/drm/v3d/v3d_debugfs.c
drivers/gpu/drm/v3d/v3d_drv.c
drivers/gpu/drm/v3d/v3d_drv.h