diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2015-05-11 23:01:50 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-05-26 17:31:21 +0300 |
commit | 0fda42ac40ac7edf62ebb750be41a34902d2fdfb (patch) | |
tree | 4bff5393a59f5841726936c6b99daf16cb4e6074 /drivers/gpu/drm/radeon/ni.c | |
parent | b7af630c13adc4be3bd8725f3a6e22fd89cb2938 (diff) | |
download | linux-0fda42ac40ac7edf62ebb750be41a34902d2fdfb.tar.xz |
drm/radeon: implement tn_set_vce_clocks
This implements the function to set the vce clocks
on TN hardware.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/ni.c')
-rw-r--r-- | drivers/gpu/drm/radeon/ni.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index aba2f428c0a8..a6d940fc44e8 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c @@ -2554,3 +2554,34 @@ void cayman_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0)); radeon_ring_write(ring, 0x0); } + +int tn_set_vce_clocks(struct radeon_device *rdev, u32 evclk, u32 ecclk) +{ + struct atom_clock_dividers dividers; + int r, i; + + r = radeon_atom_get_clock_dividers(rdev, COMPUTE_ENGINE_PLL_PARAM, + ecclk, false, ÷rs); + if (r) + return r; + + for (i = 0; i < 100; i++) { + if (RREG32(CG_ECLK_STATUS) & ECLK_STATUS) + break; + mdelay(10); + } + if (i == 100) + return -ETIMEDOUT; + + WREG32_P(CG_ECLK_CNTL, dividers.post_div, ~(ECLK_DIR_CNTL_EN|ECLK_DIVIDER_MASK)); + + for (i = 0; i < 100; i++) { + if (RREG32(CG_ECLK_STATUS) & ECLK_STATUS) + break; + mdelay(10); + } + if (i == 100) + return -ETIMEDOUT; + + return 0; +} |