drm/radeon: fix audio dto programming on DCE4+

We need to set the dto source before setting the
dividers otherwise we may get stability problems
with the dto leading to audio playback problems.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
drm/radeon/dpm: fix display gap programming on SI

Need to set the DISP*_GAP fields as well as the
DISP*_GAP_MCHG fields.  Same as on previous asics.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm/radeon/dpm: fix si_calculate_memory_refresh_rate()

Update alogorithm as per internal advice.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm/radeon/dpm: fix powertune handling for pci id 0x6835

0x6835 should be treated as a cape verde pro.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm/radeon: properly handle cg on asics without UVD

Don't try and enable clockgating if the asic doesn't have
UVD.  Use rdev->has_uvd rather than using local checks.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm/radeon/atom: fix fb when fetching engine params

For correctness.  The fb divider isn't actually used
in any of the relevant dpm code.  It's calculated
from the other parameters.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm/radeon/dpm: fix forcing performance state to low on cayman

Need to program EnabledLevels to 1 to force the low state.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm/radeon/si: disable cgcg and pg for now

Coarse grain clockgating causes problems with reclocking on
some cards and powergating (verde only) causes problems with
ring initialization.  The proper fix (restructuring the init
sequences) is too invasive for 3.11 so just disable them for
now.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm/radeon/dpm: disable cac setup on SI

Disable cac setup on SI for now since it causes
strange performance level restrictions on certain
cards.  I suspect there may be issues with some of
the 64 bit fixed point double emulation that is used
to set up those parameters.  I need to double check
the math before this can be re-enabled.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm/radeon/dpm: fix and enable reclocking on SI

The SMC interface changed compared to Cayman and
previous asics.  Set the enabled levels properly
and enable reclocking by default when dpm is enabled.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>