Blob Blame History Raw
From: Tony Cheng <tony.cheng@amd.com>
Date: Tue, 7 Nov 2017 23:37:49 -0500
Subject: drm/amd/display: fix plane update prior to stream enablement
Git-commit: 949785b5d113af61d40999b2841d1a99de6f9075
Patch-mainline: v4.16-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166

plane update prior to stream enablement is there to recombine pipe
in case we need free pipe for new display.  need to pass in new state
or we will just re-applyingwhat we already have

Signed-off-by: Tony Cheng <tony.cheng@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>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -887,12 +887,14 @@ static enum dc_status dc_commit_state_no
 	if (!dcb->funcs->is_accelerated_mode(dcb))
 		dc->hwss.enable_accelerated_mode(dc);
 
-	/* Combine planes if required, in case of pipe split disable */
+	/* re-program planes for existing stream, in case we need to
+	 * free up plane resource for later use
+	 */
 	for (i = 0; i < dc->current_state->stream_count; i++) {
 		dc->hwss.apply_ctx_for_surface(
 			dc, dc->current_state->streams[i],
 			dc->current_state->stream_status[i].plane_count,
-			dc->current_state);
+			context); /* use new pipe config in new context */
 	}
 
 	/* Program hardware */