Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Timur Kristóf and committed by
Alex Deucher
53cc70f8 221cadb9

+13 -5
+13 -5
drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
··· 7046 7046 if ((old_rps->evclk != new_rps->evclk) || 7047 7047 (old_rps->ecclk != new_rps->ecclk)) { 7048 7048 /* 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 + 7049 7051 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); 7052 7057 } 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); 7056 7063 } 7057 7064 } 7058 7065 } ··· 7581 7574 } else { 7582 7575 pl = &ps->performance_levels[current_index]; 7583 7576 seq_printf(m, "uvd vclk: %d dclk: %d\n", rps->vclk, rps->dclk); 7577 + seq_printf(m, "vce evclk: %d ecclk: %d\n", rps->evclk, rps->ecclk); 7584 7578 seq_printf(m, "power level %d sclk: %u mclk: %u vddc: %u vddci: %u pcie gen: %u\n", 7585 7579 current_index, pl->sclk, pl->mclk, pl->vddc, pl->vddci, pl->pcie_gen + 1); 7586 7580 }