On Fri, May 18, 2018 at 5:33 AM, Rex Zhu <Rex.Zhu at amd.com> wrote: Add a commit message. Something like: Switch to the VIDEO power profiles when VCN is active which is the power profile optimized for video playback. With that fixed: Reviewed-by: Alex Deucher <alexander.deucher at amd.com> Want to take a stab at doing similar patches for UVD and VCE? Also, does the smu/driver properly handle profile arbitration. E.g., if VR profile is active and the user runs VCN which switches to the VIDEO profile, we should stay in VR profile. I think vg10 and RV do the right thing because the SMU handles it, but on older parts we probably need to double check. Alex > Signed-off-by: Rex Zhu <Rex.Zhu at amd.com> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c > index 3549481..94b221f 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c > @@ -207,11 +207,13 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work) > unsigned fences = amdgpu_fence_count_emitted(&adev->vcn.ring_dec); > > if (fences == 0) { > - if (adev->pm.dpm_enabled) > + if (adev->pm.dpm_enabled) { > + amdgpu_dpm_switch_power_profile(adev, PP_SMC_POWER_PROFILE_VIDEO, false); > amdgpu_dpm_enable_uvd(adev, false); > - else > + } else { > amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN, > AMD_PG_STATE_GATE); > + } > } else { > schedule_delayed_work(&adev->vcn.idle_work, VCN_IDLE_TIMEOUT); > } > @@ -223,11 +225,13 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring) > bool set_clocks = !cancel_delayed_work_sync(&adev->vcn.idle_work); > > if (set_clocks && adev->pm.dpm_enabled) { > - if (adev->pm.dpm_enabled) > + if (adev->pm.dpm_enabled) { > amdgpu_dpm_enable_uvd(adev, true); > - else > + amdgpu_dpm_switch_power_profile(adev, PP_SMC_POWER_PROFILE_VIDEO, true); > + } else { > amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN, > AMD_PG_STATE_UNGATE); > + } > } > } > > -- > 1.9.1 > > _______________________________________________ > amd-gfx mailing list > amd-gfx at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx