aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2276-drm-amd-display-Add-comment-explaining-context-free.patch
blob: 37e1a0e2d13d03ec960704f09d831efd4a5bf53f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From c2c544078768c205713fcf155a16112dba2e55e0 Mon Sep 17 00:00:00 2001
From: Corbin McElhanney <corbin.mcelhanney@amd.com>
Date: Wed, 9 Aug 2017 10:30:28 -0400
Subject: [PATCH 2276/4131] drm/amd/display: Add comment explaining context
 free

This comment explains a previous change that adds some complexity
to the context free in dc:

commit 9ad58779a895 ("drm/amd/display: Fix accessing freed memory")

Signed-off-by: Corbin McElhanney <corbin.mcelhanney@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 03b89e5..d6bc66f 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1740,6 +1740,15 @@ void dc_update_planes_and_stream(struct dc *dc,
 	}
 
 	if (core_dc->current_context != context) {
+
+		/* Since memory free requires elevated IRQL, an interrupt
+		 * request is generated by mem free. If this happens
+		 * between freeing and reassigning the context, our vsync
+		 * interrupt will call into dc and cause a memory
+		 * corruption BSOD. Hence, we first reassign the context,
+		 * then free the old context.
+		 */
+
 		struct validate_context *old = core_dc->current_context;
 
 		core_dc->current_context = context;
-- 
2.7.4