aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1826-drm-amd-display-Fix-CRC-vblank-refs-when-changing-in.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1826-drm-amd-display-Fix-CRC-vblank-refs-when-changing-in.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1826-drm-amd-display-Fix-CRC-vblank-refs-when-changing-in.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1826-drm-amd-display-Fix-CRC-vblank-refs-when-changing-in.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1826-drm-amd-display-Fix-CRC-vblank-refs-when-changing-in.patch
new file mode 100644
index 00000000..f5d514a6
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1826-drm-amd-display-Fix-CRC-vblank-refs-when-changing-in.patch
@@ -0,0 +1,55 @@
+From 7a7896f3e0805dfc0f8b4d54004945fea602efa4 Mon Sep 17 00:00:00 2001
+From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Date: Mon, 8 Apr 2019 12:31:25 -0400
+Subject: [PATCH 1826/2940] drm/amd/display: Fix CRC vblank refs when changing
+ interrupts
+
+[Why]
+We only currently drop the vblank reference when the stream is
+being removed from the context. We should be dropping it whenever we
+disable interrupts and reaquiring it after we re-enable them.
+
+We also never get the extra reference correctly when re-enabling
+interrupts, since grabbing the reference has the following condition:
+
+if (!crtc_state->crc_enabled && enable)
+ drm_crtc_vblank_get(crtc);
+
+This means that crc_enabled must be *false* in order to grab the extra
+reference.
+
+[How]
+Always drop the ref whenever we're disabling interrupts.
+
+Only disable CRC capture when the stream is being removed.
+
+Always grab the ref by setting dm_new_crtc_state->crc_enabled = false
+before the call to re-enable CRC capture.
+
+Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
+Reviewed-by: David Francis <David.Francis@amd.com>
+Acked-by: Leo Li <sunpeng.li@amd.com>
+Signed-off-by: Chaudhary Amit Kumar <Chaudharyamit.Kumar@amd.com>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+index b2f602cfdd30..b50626847602 100644
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -5859,8 +5859,10 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
+
+ #ifdef CONFIG_DEBUG_FS
+ /* The stream has changed so CRC capture needs to re-enabled. */
+- if (dm_new_crtc_state->crc_enabled)
++ if (dm_new_crtc_state->crc_enabled) {
++ dm_new_crtc_state->crc_enabled = false;
+ amdgpu_dm_crtc_set_crc_source(crtc, "auto");
++ }
+ #endif
+ }
+
+--
+2.17.1
+