diff options
author | Huang Rui <ray.huang@amd.com> | 2017-01-05 07:03:27 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-01-27 11:13:08 -0500 |
commit | 8bcab092f8635002fa8fca0e14deb9ff46bdeeb8 (patch) | |
tree | 361cfc4d748041f21dfefce68c4dba5a6dbbb08b /drivers/gpu | |
parent | ebd843d6ee915394094777c72f01fe55356c8eae (diff) |
drm/amdgpu: add get clockgating_state method for gmc v8
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c index 476bc9f1954b..684a5f34d60d 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | |||
@@ -1439,6 +1439,21 @@ static int gmc_v8_0_set_powergating_state(void *handle, | |||
1439 | return 0; | 1439 | return 0; |
1440 | } | 1440 | } |
1441 | 1441 | ||
1442 | static void gmc_v8_0_get_clockgating_state(void *handle, u32 *flags) | ||
1443 | { | ||
1444 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | ||
1445 | int data; | ||
1446 | |||
1447 | /* AMD_CG_SUPPORT_MC_MGCG */ | ||
1448 | data = RREG32(mmMC_HUB_MISC_HUB_CG); | ||
1449 | if (data & MC_HUB_MISC_HUB_CG__ENABLE_MASK) | ||
1450 | *flags |= AMD_CG_SUPPORT_MC_MGCG; | ||
1451 | |||
1452 | /* AMD_CG_SUPPORT_MC_LS */ | ||
1453 | if (data & MC_HUB_MISC_HUB_CG__MEM_LS_ENABLE_MASK) | ||
1454 | *flags |= AMD_CG_SUPPORT_MC_LS; | ||
1455 | } | ||
1456 | |||
1442 | static const struct amd_ip_funcs gmc_v8_0_ip_funcs = { | 1457 | static const struct amd_ip_funcs gmc_v8_0_ip_funcs = { |
1443 | .name = "gmc_v8_0", | 1458 | .name = "gmc_v8_0", |
1444 | .early_init = gmc_v8_0_early_init, | 1459 | .early_init = gmc_v8_0_early_init, |
@@ -1457,6 +1472,7 @@ static const struct amd_ip_funcs gmc_v8_0_ip_funcs = { | |||
1457 | .post_soft_reset = gmc_v8_0_post_soft_reset, | 1472 | .post_soft_reset = gmc_v8_0_post_soft_reset, |
1458 | .set_clockgating_state = gmc_v8_0_set_clockgating_state, | 1473 | .set_clockgating_state = gmc_v8_0_set_clockgating_state, |
1459 | .set_powergating_state = gmc_v8_0_set_powergating_state, | 1474 | .set_powergating_state = gmc_v8_0_set_powergating_state, |
1475 | .get_clockgating_state = gmc_v8_0_get_clockgating_state, | ||
1460 | }; | 1476 | }; |
1461 | 1477 | ||
1462 | static const struct amdgpu_gart_funcs gmc_v8_0_gart_funcs = { | 1478 | static const struct amdgpu_gart_funcs gmc_v8_0_gart_funcs = { |