diff options
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c index 3fcc33f9ae70..58af0da387b8 100644 --- a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | |||
@@ -30,10 +30,10 @@ | |||
30 | #include "amdgpu.h" | 30 | #include "amdgpu.h" |
31 | #include "amdgpu_vce.h" | 31 | #include "amdgpu_vce.h" |
32 | #include "cikd.h" | 32 | #include "cikd.h" |
33 | |||
34 | #include "vce/vce_2_0_d.h" | 33 | #include "vce/vce_2_0_d.h" |
35 | #include "vce/vce_2_0_sh_mask.h" | 34 | #include "vce/vce_2_0_sh_mask.h" |
36 | 35 | #include "smu/smu_7_0_1_d.h" | |
36 | #include "smu/smu_7_0_1_sh_mask.h" | ||
37 | #include "oss/oss_2_0_d.h" | 37 | #include "oss/oss_2_0_d.h" |
38 | #include "oss/oss_2_0_sh_mask.h" | 38 | #include "oss/oss_2_0_sh_mask.h" |
39 | 39 | ||
@@ -539,11 +539,28 @@ static int vce_v2_0_process_interrupt(struct amdgpu_device *adev, | |||
539 | return 0; | 539 | return 0; |
540 | } | 540 | } |
541 | 541 | ||
542 | static void vce_v2_0_set_bypass_mode(struct amdgpu_device *adev, bool enable) | ||
543 | { | ||
544 | u32 tmp = RREG32_SMC(ixGCK_DFS_BYPASS_CNTL); | ||
545 | |||
546 | if (enable) | ||
547 | tmp |= GCK_DFS_BYPASS_CNTL__BYPASSECLK_MASK; | ||
548 | else | ||
549 | tmp &= ~GCK_DFS_BYPASS_CNTL__BYPASSECLK_MASK; | ||
550 | |||
551 | WREG32_SMC(ixGCK_DFS_BYPASS_CNTL, tmp); | ||
552 | } | ||
553 | |||
554 | |||
542 | static int vce_v2_0_set_clockgating_state(void *handle, | 555 | static int vce_v2_0_set_clockgating_state(void *handle, |
543 | enum amd_clockgating_state state) | 556 | enum amd_clockgating_state state) |
544 | { | 557 | { |
545 | bool gate = false; | 558 | bool gate = false; |
546 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 559 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
560 | bool enable = (state == AMD_CG_STATE_GATE) ? true : false; | ||
561 | |||
562 | |||
563 | vce_v2_0_set_bypass_mode(adev, enable); | ||
547 | 564 | ||
548 | if (state == AMD_CG_STATE_GATE) | 565 | if (state == AMD_CG_STATE_GATE) |
549 | gate = true; | 566 | gate = true; |