diff options
author | Ken Wang <Qingqing.Wang@amd.com> | 2015-06-03 09:02:01 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-06-03 21:04:04 -0400 |
commit | 81c59f54125f9ff84546b6ba26c321662562703d (patch) | |
tree | 5155dcf6e4f917f073d401342b412691e9757383 /drivers/gpu/drm/amd/amdgpu/ci_dpm.c | |
parent | 71062f435eaf0ff7867a1188e5c7887b0a5871ff (diff) |
drm/amdgpu: add vram_type and vram_bit_width for interface query (v2)
Track the type of vram on the board and provide a query for it.
User mode drivers and tools want this information for determining
bandwidth information and form informational purposes.
v2: fix build when CI support is not enabled
Signed-off-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/ci_dpm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c index b1a4fbc22e69..82e8d0730517 100644 --- a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c +++ b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c | |||
@@ -891,7 +891,7 @@ static void ci_dpm_powergate_uvd(struct amdgpu_device *adev, bool gate) | |||
891 | static bool ci_dpm_vblank_too_short(struct amdgpu_device *adev) | 891 | static bool ci_dpm_vblank_too_short(struct amdgpu_device *adev) |
892 | { | 892 | { |
893 | u32 vblank_time = amdgpu_dpm_get_vblank_time(adev); | 893 | u32 vblank_time = amdgpu_dpm_get_vblank_time(adev); |
894 | u32 switch_limit = adev->mc.is_gddr5 ? 450 : 300; | 894 | u32 switch_limit = adev->mc.vram_type == AMDGPU_VRAM_TYPE_GDDR5 ? 450 : 300; |
895 | 895 | ||
896 | if (vblank_time < switch_limit) | 896 | if (vblank_time < switch_limit) |
897 | return true; | 897 | return true; |
@@ -2920,7 +2920,7 @@ static int ci_calculate_mclk_params(struct amdgpu_device *adev, | |||
2920 | mpll_ad_func_cntl &= ~MPLL_AD_FUNC_CNTL__YCLK_POST_DIV_MASK; | 2920 | mpll_ad_func_cntl &= ~MPLL_AD_FUNC_CNTL__YCLK_POST_DIV_MASK; |
2921 | mpll_ad_func_cntl |= (mpll_param.post_div << MPLL_AD_FUNC_CNTL__YCLK_POST_DIV__SHIFT); | 2921 | mpll_ad_func_cntl |= (mpll_param.post_div << MPLL_AD_FUNC_CNTL__YCLK_POST_DIV__SHIFT); |
2922 | 2922 | ||
2923 | if (adev->mc.is_gddr5) { | 2923 | if (adev->mc.vram_type == AMDGPU_VRAM_TYPE_GDDR5) { |
2924 | mpll_dq_func_cntl &= ~(MPLL_DQ_FUNC_CNTL__YCLK_SEL_MASK | | 2924 | mpll_dq_func_cntl &= ~(MPLL_DQ_FUNC_CNTL__YCLK_SEL_MASK | |
2925 | MPLL_AD_FUNC_CNTL__YCLK_POST_DIV_MASK); | 2925 | MPLL_AD_FUNC_CNTL__YCLK_POST_DIV_MASK); |
2926 | mpll_dq_func_cntl |= (mpll_param.yclk_sel << MPLL_DQ_FUNC_CNTL__YCLK_SEL__SHIFT) | | 2926 | mpll_dq_func_cntl |= (mpll_param.yclk_sel << MPLL_DQ_FUNC_CNTL__YCLK_SEL__SHIFT) | |
@@ -3043,7 +3043,7 @@ static int ci_populate_single_memory_level(struct amdgpu_device *adev, | |||
3043 | (memory_clock <= pi->mclk_strobe_mode_threshold)) | 3043 | (memory_clock <= pi->mclk_strobe_mode_threshold)) |
3044 | memory_level->StrobeEnable = 1; | 3044 | memory_level->StrobeEnable = 1; |
3045 | 3045 | ||
3046 | if (adev->mc.is_gddr5) { | 3046 | if (adev->mc.vram_type == AMDGPU_VRAM_TYPE_GDDR5) { |
3047 | memory_level->StrobeRatio = | 3047 | memory_level->StrobeRatio = |
3048 | ci_get_mclk_frequency_ratio(memory_clock, memory_level->StrobeEnable); | 3048 | ci_get_mclk_frequency_ratio(memory_clock, memory_level->StrobeEnable); |
3049 | if (pi->mclk_edc_enable_threshold && | 3049 | if (pi->mclk_edc_enable_threshold && |
@@ -3681,7 +3681,7 @@ static int ci_init_smc_table(struct amdgpu_device *adev) | |||
3681 | if (adev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_STEPVDDC) | 3681 | if (adev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_STEPVDDC) |
3682 | table->SystemFlags |= PPSMC_SYSTEMFLAG_STEPVDDC; | 3682 | table->SystemFlags |= PPSMC_SYSTEMFLAG_STEPVDDC; |
3683 | 3683 | ||
3684 | if (adev->mc.is_gddr5) | 3684 | if (adev->mc.vram_type == AMDGPU_VRAM_TYPE_GDDR5) |
3685 | table->SystemFlags |= PPSMC_SYSTEMFLAG_GDDR5; | 3685 | table->SystemFlags |= PPSMC_SYSTEMFLAG_GDDR5; |
3686 | 3686 | ||
3687 | if (ulv->supported) { | 3687 | if (ulv->supported) { |
@@ -4498,14 +4498,14 @@ static int ci_set_mc_special_registers(struct amdgpu_device *adev, | |||
4498 | for (k = 0; k < table->num_entries; k++) { | 4498 | for (k = 0; k < table->num_entries; k++) { |
4499 | table->mc_reg_table_entry[k].mc_data[j] = | 4499 | table->mc_reg_table_entry[k].mc_data[j] = |
4500 | (temp_reg & 0xffff0000) | (table->mc_reg_table_entry[k].mc_data[i] & 0x0000ffff); | 4500 | (temp_reg & 0xffff0000) | (table->mc_reg_table_entry[k].mc_data[i] & 0x0000ffff); |
4501 | if (!adev->mc.is_gddr5) | 4501 | if (adev->mc.vram_type != AMDGPU_VRAM_TYPE_GDDR5) |
4502 | table->mc_reg_table_entry[k].mc_data[j] |= 0x100; | 4502 | table->mc_reg_table_entry[k].mc_data[j] |= 0x100; |
4503 | } | 4503 | } |
4504 | j++; | 4504 | j++; |
4505 | if (j > SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE) | 4505 | if (j > SMU7_DISCRETE_MC_REGISTER_ARRAY_SIZE) |
4506 | return -EINVAL; | 4506 | return -EINVAL; |
4507 | 4507 | ||
4508 | if (!adev->mc.is_gddr5) { | 4508 | if (adev->mc.vram_type != AMDGPU_VRAM_TYPE_GDDR5) { |
4509 | table->mc_reg_address[j].s1 = mmMC_PMG_AUTO_CMD; | 4509 | table->mc_reg_address[j].s1 = mmMC_PMG_AUTO_CMD; |
4510 | table->mc_reg_address[j].s0 = mmMC_PMG_AUTO_CMD; | 4510 | table->mc_reg_address[j].s0 = mmMC_PMG_AUTO_CMD; |
4511 | for (k = 0; k < table->num_entries; k++) { | 4511 | for (k = 0; k < table->num_entries; k++) { |