drm/amd/amdgpu: add query GFX cu info in CGS query system info
Needed for per CU powergating.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index 594159c..e066817 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -791,6 +791,7 @@
struct cgs_system_info *sys_info)
{
CGS_FUNC_ADEV;
+ struct amdgpu_cu_info cu_info;
if (NULL == sys_info)
return -ENODEV;
@@ -814,6 +815,10 @@
case CGS_SYSTEM_INFO_PG_FLAGS:
sys_info->value = adev->pg_flags;
break;
+ case CGS_SYSTEM_INFO_GFX_CU_INFO:
+ amdgpu_asic_get_cu_info(adev, &cu_info);
+ sys_info->value = cu_info.number;
+ break;
default:
return -ENODEV;
}