diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2018-05-16 08:18:22 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-24 11:07:52 -0400 |
commit | 22cc6c5e1958e5a08b4c44203d1810ab07ce5a16 (patch) | |
tree | c7d8453d77bece8c1e8425f18bd256718653f27a /drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | |
parent | 61c8e90d965ba944d8b56c29c2c7bb9ec34f45d5 (diff) |
drm/amdgpu: Add runtime VCN PG support
Enable support for dynamically powering up/down VCN on demand.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c index 60468385e6b4..8851bcdfc260 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | |||
@@ -212,11 +212,11 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work) | |||
212 | } | 212 | } |
213 | 213 | ||
214 | if (fences == 0) { | 214 | if (fences == 0) { |
215 | if (adev->pm.dpm_enabled) { | 215 | if (adev->pm.dpm_enabled) |
216 | /* might be used when with pg/cg | ||
217 | amdgpu_dpm_enable_uvd(adev, false); | 216 | amdgpu_dpm_enable_uvd(adev, false); |
218 | */ | 217 | else |
219 | } | 218 | amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN, |
219 | AMD_PG_STATE_GATE); | ||
220 | } else { | 220 | } else { |
221 | schedule_delayed_work(&adev->vcn.idle_work, VCN_IDLE_TIMEOUT); | 221 | schedule_delayed_work(&adev->vcn.idle_work, VCN_IDLE_TIMEOUT); |
222 | } | 222 | } |
@@ -228,9 +228,11 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring) | |||
228 | bool set_clocks = !cancel_delayed_work_sync(&adev->vcn.idle_work); | 228 | bool set_clocks = !cancel_delayed_work_sync(&adev->vcn.idle_work); |
229 | 229 | ||
230 | if (set_clocks && adev->pm.dpm_enabled) { | 230 | if (set_clocks && adev->pm.dpm_enabled) { |
231 | /* might be used when with pg/cg | 231 | if (adev->pm.dpm_enabled) |
232 | amdgpu_dpm_enable_uvd(adev, true); | 232 | amdgpu_dpm_enable_uvd(adev, true); |
233 | */ | 233 | else |
234 | amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN, | ||
235 | AMD_PG_STATE_UNGATE); | ||
234 | } | 236 | } |
235 | } | 237 | } |
236 | 238 | ||