aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/0949-drm-amdgpu-vcn-Scan-enc-jpeg-fences-to-init-dpg-paus.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/0949-drm-amdgpu-vcn-Scan-enc-jpeg-fences-to-init-dpg-paus.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/0949-drm-amdgpu-vcn-Scan-enc-jpeg-fences-to-init-dpg-paus.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/0949-drm-amdgpu-vcn-Scan-enc-jpeg-fences-to-init-dpg-paus.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/0949-drm-amdgpu-vcn-Scan-enc-jpeg-fences-to-init-dpg-paus.patch
new file mode 100644
index 00000000..0b78d3cf
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/0949-drm-amdgpu-vcn-Scan-enc-jpeg-fences-to-init-dpg-paus.patch
@@ -0,0 +1,54 @@
+From 9ce867d05cb1f4f318771b4b290571b1e881781c Mon Sep 17 00:00:00 2001
+From: James Zhu <James.Zhu@amd.com>
+Date: Wed, 12 Dec 2018 14:53:12 -0500
+Subject: [PATCH 0949/2940] drm/amdgpu/vcn:Scan enc/jpeg fences to init dpg
+ pause new state
+
+Scan enc/jpeg fences to init dpg pause new state in begin use.
+It will help set dpg mode to desire state actively.
+
+Signed-off-by: James Zhu <James.Zhu@amd.com>
+Acked-by: Leo Liu <leo.liu@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 18 ++++++++++++++----
+ 1 file changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+index e2e42e3fbcf3..dde7bcdede4f 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+@@ -396,16 +396,26 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
+
+ if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) {
+ struct dpg_pause_state new_state;
++ unsigned int fences = 0;
++ unsigned int i;
+
+- if (ring->funcs->type == AMDGPU_RING_TYPE_VCN_ENC)
++ for (i = 0; i < adev->vcn.num_enc_rings; ++i) {
++ fences += amdgpu_fence_count_emitted(&adev->vcn.ring_enc[i]);
++ }
++ if (fences)
+ new_state.fw_based = VCN_DPG_STATE__PAUSE;
+ else
+- new_state.fw_based = adev->vcn.pause_state.fw_based;
++ new_state.fw_based = VCN_DPG_STATE__UNPAUSE;
+
+- if (ring->funcs->type == AMDGPU_RING_TYPE_VCN_JPEG)
++ if (amdgpu_fence_count_emitted(&adev->vcn.ring_jpeg))
+ new_state.jpeg = VCN_DPG_STATE__PAUSE;
+ else
+- new_state.jpeg = adev->vcn.pause_state.jpeg;
++ new_state.jpeg = VCN_DPG_STATE__UNPAUSE;
++
++ if (ring->funcs->type == AMDGPU_RING_TYPE_VCN_ENC)
++ new_state.fw_based = VCN_DPG_STATE__PAUSE;
++ else if (ring->funcs->type == AMDGPU_RING_TYPE_VCN_JPEG)
++ new_state.jpeg = VCN_DPG_STATE__PAUSE;
+
+ amdgpu_vcn_pause_dpg_mode(adev, &new_state);
+ }
+--
+2.17.1
+