Skip to content

Commit 53cc70f

Browse files
Timur Kristófalexdeucher
authored andcommitted
drm/amd/pm/si: Hook up VCE1 to SI DPM
On SI GPUs, the SMC needs to be aware of whether or not the VCE1 is used. The VCE1 is enabled/disabled through the DPM code. Also print VCE clocks in amdgpu_pm_info. Users can inspect the current power state using: cat /sys/kernel/debug/dri/<card>/amdgpu_pm_info Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 221cadb commit 53cc70f

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

  • drivers/gpu/drm/amd/pm/legacy-dpm

drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7046,13 +7046,20 @@ static void si_set_vce_clock(struct amdgpu_device *adev,
70467046
if ((old_rps->evclk != new_rps->evclk) ||
70477047
(old_rps->ecclk != new_rps->ecclk)) {
70487048
/* Turn the clocks on when encoding, off otherwise */
7049+
dev_dbg(adev->dev, "set VCE clocks: %u, %u\n", new_rps->evclk, new_rps->ecclk);
7050+
70497051
if (new_rps->evclk || new_rps->ecclk) {
7050-
/* Place holder for future VCE1.0 porting to amdgpu
7051-
vce_v1_0_enable_mgcg(adev, false, false);*/
7052+
amdgpu_asic_set_vce_clocks(adev, new_rps->evclk, new_rps->ecclk);
7053+
amdgpu_device_ip_set_clockgating_state(
7054+
adev, AMD_IP_BLOCK_TYPE_VCE, AMD_CG_STATE_UNGATE);
7055+
amdgpu_device_ip_set_powergating_state(
7056+
adev, AMD_IP_BLOCK_TYPE_VCE, AMD_PG_STATE_UNGATE);
70527057
} else {
7053-
/* Place holder for future VCE1.0 porting to amdgpu
7054-
vce_v1_0_enable_mgcg(adev, true, false);
7055-
amdgpu_asic_set_vce_clocks(adev, new_rps->evclk, new_rps->ecclk);*/
7058+
amdgpu_device_ip_set_powergating_state(
7059+
adev, AMD_IP_BLOCK_TYPE_VCE, AMD_PG_STATE_GATE);
7060+
amdgpu_device_ip_set_clockgating_state(
7061+
adev, AMD_IP_BLOCK_TYPE_VCE, AMD_CG_STATE_GATE);
7062+
amdgpu_asic_set_vce_clocks(adev, 0, 0);
70567063
}
70577064
}
70587065
}
@@ -7574,6 +7581,7 @@ static void si_dpm_debugfs_print_current_performance_level(void *handle,
75747581
} else {
75757582
pl = &ps->performance_levels[current_index];
75767583
seq_printf(m, "uvd vclk: %d dclk: %d\n", rps->vclk, rps->dclk);
7584+
seq_printf(m, "vce evclk: %d ecclk: %d\n", rps->evclk, rps->ecclk);
75777585
seq_printf(m, "power level %d sclk: %u mclk: %u vddc: %u vddci: %u pcie gen: %u\n",
75787586
current_index, pl->sclk, pl->mclk, pl->vddc, pl->vddci, pl->pcie_gen + 1);
75797587
}

0 commit comments

Comments
 (0)