diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2016-04-29 11:44:32 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-05-04 20:30:57 -0400 |
commit | a0cdef9e8234cd501d1ad1ea8517136087b3e60f (patch) | |
tree | 0e2d7cb7af198d8c7ec8e48ac0afcd27b387fc88 | |
parent | bdf1ecea3c656acab45976ff7a6ba53b37cd7a1d (diff) |
drm/amdgpu/uvd6: add bypass support for fiji (v3)
Handle uvd clock bypass settings as part of clockgating
setup.
v2: fix gate logic
v3: fix header include
Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c index 5665a4fd09ce..d015cb0c9eb5 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include "uvd/uvd_6_0_sh_mask.h" | 31 | #include "uvd/uvd_6_0_sh_mask.h" |
32 | #include "oss/oss_2_0_d.h" | 32 | #include "oss/oss_2_0_d.h" |
33 | #include "oss/oss_2_0_sh_mask.h" | 33 | #include "oss/oss_2_0_sh_mask.h" |
34 | #include "smu/smu_7_1_3_d.h" | ||
35 | #include "smu/smu_7_1_3_sh_mask.h" | ||
34 | #include "vi.h" | 36 | #include "vi.h" |
35 | 37 | ||
36 | static void uvd_v6_0_set_ring_funcs(struct amdgpu_device *adev); | 38 | static void uvd_v6_0_set_ring_funcs(struct amdgpu_device *adev); |
@@ -823,6 +825,20 @@ static void uvd_v6_0_set_hw_clock_gating(struct amdgpu_device *adev) | |||
823 | } | 825 | } |
824 | #endif | 826 | #endif |
825 | 827 | ||
828 | static void uvd_v6_set_bypass_mode(struct amdgpu_device *adev, bool enable) | ||
829 | { | ||
830 | u32 tmp = RREG32_SMC(ixGCK_DFS_BYPASS_CNTL); | ||
831 | |||
832 | if (enable) | ||
833 | tmp |= (GCK_DFS_BYPASS_CNTL__BYPASSDCLK_MASK | | ||
834 | GCK_DFS_BYPASS_CNTL__BYPASSVCLK_MASK); | ||
835 | else | ||
836 | tmp &= ~(GCK_DFS_BYPASS_CNTL__BYPASSDCLK_MASK | | ||
837 | GCK_DFS_BYPASS_CNTL__BYPASSVCLK_MASK); | ||
838 | |||
839 | WREG32_SMC(ixGCK_DFS_BYPASS_CNTL, tmp); | ||
840 | } | ||
841 | |||
826 | static int uvd_v6_0_set_clockgating_state(void *handle, | 842 | static int uvd_v6_0_set_clockgating_state(void *handle, |
827 | enum amd_clockgating_state state) | 843 | enum amd_clockgating_state state) |
828 | { | 844 | { |
@@ -830,6 +846,9 @@ static int uvd_v6_0_set_clockgating_state(void *handle, | |||
830 | bool enable = (state == AMD_CG_STATE_GATE) ? true : false; | 846 | bool enable = (state == AMD_CG_STATE_GATE) ? true : false; |
831 | static int curstate = -1; | 847 | static int curstate = -1; |
832 | 848 | ||
849 | if (adev->asic_type == CHIP_FIJI) | ||
850 | uvd_v6_set_bypass_mode(adev, enable); | ||
851 | |||
833 | if (!(adev->cg_flags & AMD_CG_SUPPORT_UVD_MGCG)) | 852 | if (!(adev->cg_flags & AMD_CG_SUPPORT_UVD_MGCG)) |
834 | return 0; | 853 | return 0; |
835 | 854 | ||