drm/amd: Add detailed GFXOFF stats to debugfs
authorAndré Almeida <andrealmeid@igalia.com>
Wed, 10 Aug 2022 23:28:55 +0000 (20:28 -0300)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Aug 2022 22:17:31 +0000 (18:17 -0400)
commit0ad7347a64ac4baec1786810709eebedc5f823d5
tree3a01d9b4e40ba1aa6163454f10174f53f1bb721f
parent30f2d2e49e826c2dda35153d2e108d06f6d7d9dc
drm/amd: Add detailed GFXOFF stats to debugfs

Add debugfs interface to log GFXOFF statistics:

- Read amdgpu_gfxoff_count to get the total GFXOFF entry count at the
  time of query since system power-up

- Write 1 to amdgpu_gfxoff_residency to start logging, and 0 to stop.
  Read it to get average GFXOFF residency % multiplied by 100
  during the last logging interval.

Both features are designed to be keep the values persistent between
suspends.

Signed-off-by: André Almeida <andrealmeid@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
drivers/gpu/drm/amd/pm/amdgpu_dpm.c
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
drivers/gpu/drm/amd/pm/swsmu/smu_internal.h