drm/amdgpu: Add reg_state sysfs attribute
authorLijo Lazar <lijo.lazar@amd.com>
Fri, 6 Oct 2023 08:19:03 +0000 (13:49 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 29 Nov 2023 21:49:35 +0000 (16:49 -0500)
commitaf39e6f4d8032b101907cc2ac12a21a778da568d
treecf7fe41d446c07b43f162d2c8b04cb4d0c3c88f1
parent9a5095e785c38ab8d9f3d91f4ee76f4f73ec4adc
drm/amdgpu: Add reg_state sysfs attribute

Add reg_state attribute to fetch the register snapshot of different
IPs like XGMI, WAFL,PCIE and USR. To get a snapshot for a particular IP
1) Open the sysfs file
2) Seek to the offset as defined in amdgpu_sysfs_reg_offset
3) Read

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/include/amdgpu_reg_state.h