From: Eric Huang Date: Thu, 17 Mar 2016 22:29:08 +0000 (-0400) Subject: drm/amd/amdgpu: add query GFX cu info in CGS query system info X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bacec8985f596a6c6fadb63966f52501d2ed2367;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm/amd/amdgpu: add query GFX cu info in CGS query system info Needed for per CU powergating. Reviewed-by: Alex Deucher Acked-by: Christian König Signed-off-by: Eric Huang Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c index 594159c7525b..e0668173fc1a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c @@ -791,6 +791,7 @@ static int amdgpu_cgs_query_system_info(struct cgs_device *cgs_device, 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 @@ static int amdgpu_cgs_query_system_info(struct cgs_device *cgs_device, 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; } diff --git a/drivers/gpu/drm/amd/include/cgs_common.h b/drivers/gpu/drm/amd/include/cgs_common.h index 7a3714b8b45c..a461e155a160 100644 --- a/drivers/gpu/drm/amd/include/cgs_common.h +++ b/drivers/gpu/drm/amd/include/cgs_common.h @@ -114,6 +114,7 @@ enum cgs_system_info_id { CGS_SYSTEM_INFO_PCIE_MLW, CGS_SYSTEM_INFO_CG_FLAGS, CGS_SYSTEM_INFO_PG_FLAGS, + CGS_SYSTEM_INFO_GFX_CU_INFO, CGS_SYSTEM_INFO_ID_MAXIMUM, };