drm/amd/amdgpu: add query GFX cu info in CGS query system info
authorEric Huang <JinHuiEric.Huang@amd.com>
Thu, 17 Mar 2016 22:29:08 +0000 (18:29 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 May 2016 00:26:55 +0000 (20:26 -0400)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
drivers/gpu/drm/amd/include/cgs_common.h

index 594159c7525b6d1a69bc9b721d428a6a3da42cde..e0668173fc1ab0ea1f26cea15922ed12b57681fd 100644 (file)
@@ -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;
        }
index 7a3714b8b45cb5f40e94ef2f5e892cbc90194cbc..a461e155a160240f7f127c156b902b56651c523b 100644 (file)
@@ -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,
 };