[PATCH 05/77] drm/amd/display: Add comment explaining context free

Harry Wentland harry.wentland at amd.com
Thu Aug 31 18:08:00 UTC 2017


From: Corbin McElhanney <corbin.mcelhanney at amd.com>

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 at amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at 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 477024c467e6..33c3d88b1c86 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.11.0



More information about the amd-gfx mailing list