AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: SivapiriyanKumarasamy
	<sivapiriyan.kumarasamy-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 08/24] drm/amd/display: Synchronize update plane addr for freesync
Date: Thu, 18 Jan 2018 16:03:37 -0500	[thread overview]
Message-ID: <20180118210353.18842-9-harry.wentland@amd.com> (raw)
In-Reply-To: <20180118210353.18842-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>

From: SivapiriyanKumarasamy <sivapiriyan.kumarasamy@amd.com>

Lock top_pipe when doing update plane addr for split pipe freesync case

Signed-off-by: SivapiriyanKumarasamy <sivapiriyan.kumarasamy@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 47 +++++++++++++++++++++-----------
 1 file changed, 31 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index eddfc4396367..67e3d00eecd2 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1278,6 +1278,7 @@ static void commit_planes_for_stream(struct dc *dc,
 		struct dc_state *context)
 {
 	int i, j;
+	struct pipe_ctx *top_pipe_to_program = NULL;
 
 	if (update_type == UPDATE_TYPE_FULL) {
 		dc->hwss.set_bandwidth(dc, context, false);
@@ -1297,13 +1298,17 @@ static void commit_planes_for_stream(struct dc *dc,
 	for (j = 0; j < dc->res_pool->pipe_count; j++) {
 		struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
 
-		if (update_type == UPDATE_TYPE_FAST || !pipe_ctx->plane_state)
-			continue;
-
 		if (!pipe_ctx->top_pipe &&
-		    pipe_ctx->stream &&
-		    pipe_ctx->stream == stream) {
-			struct dc_stream_status *stream_status =
+			pipe_ctx->stream &&
+			pipe_ctx->stream == stream) {
+			struct dc_stream_status *stream_status = NULL;
+
+			top_pipe_to_program = pipe_ctx;
+
+			if (update_type == UPDATE_TYPE_FAST || !pipe_ctx->plane_state)
+				continue;
+
+			stream_status =
 					stream_get_status(context, pipe_ctx->stream);
 
 			dc->hwss.apply_ctx_for_surface(
@@ -1314,22 +1319,32 @@ static void commit_planes_for_stream(struct dc *dc,
 	if (update_type == UPDATE_TYPE_FULL)
 		context_timing_trace(dc, &context->res_ctx);
 
-	/* Perform requested Updates */
-	for (i = 0; i < surface_count; i++) {
-		struct dc_plane_state *plane_state = srf_updates[i].surface;
+	/* Lock the top pipe while updating plane addrs, since freesync requires
+	 *  plane addr update event triggers to be synchronized.
+	 *  top_pipe_to_program is expected to never be NULL
+	 */
+	if (update_type == UPDATE_TYPE_FAST) {
+		dc->hwss.pipe_control_lock(dc, top_pipe_to_program, true);
 
-		for (j = 0; j < dc->res_pool->pipe_count; j++) {
-			struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
+		/* Perform requested Updates */
+		for (i = 0; i < surface_count; i++) {
+			struct dc_plane_state *plane_state = srf_updates[i].surface;
 
-			if (pipe_ctx->stream != stream)
-				continue;
+			for (j = 0; j < dc->res_pool->pipe_count; j++) {
+				struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
 
-			if (pipe_ctx->plane_state != plane_state)
-				continue;
+				if (pipe_ctx->stream != stream)
+					continue;
 
-			if (update_type == UPDATE_TYPE_FAST && srf_updates[i].flip_addr)
+				if (pipe_ctx->plane_state != plane_state)
+					continue;
+
+				if (srf_updates[i].flip_addr)
 					dc->hwss.update_plane_addr(dc, pipe_ctx);
+			}
 		}
+
+		dc->hwss.pipe_control_lock(dc, top_pipe_to_program, false);
 	}
 
 	if (stream && stream_update && update_type > UPDATE_TYPE_FAST)
-- 
2.14.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-01-18 21:03 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 21:03 [PATCH 00/24] DC Patches Jan 18, 2018 Harry Wentland
     [not found] ` <20180118210353.18842-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>
2018-01-18 21:03   ` [PATCH 01/24] drm/amd/display: dc: Remove unused display_mode_vba.c Harry Wentland
     [not found]     ` <20180118210353.18842-2-harry.wentland-5C7GfCeVMHo@public.gmane.org>
2018-01-22 20:26       ` Andrey Grodzovsky
2018-01-22 21:27       ` [PATCH v2] " Harry Wentland
     [not found]         ` <20180122212733.18899-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>
2018-01-22 21:29           ` Deucher, Alexander
2018-01-18 21:03   ` [PATCH 02/24] drm/amd/display: Update the register GRPH_SWAP_CNTL if surface pixel format changed Harry Wentland
2018-01-18 21:03   ` [PATCH 03/24] drm/amd/display: Remove unused param in DML Harry Wentland
2018-01-18 21:03   ` [PATCH 04/24] drm/amd/display: Move output_tf to stream_state/update Harry Wentland
2018-01-18 21:03   ` [PATCH 05/24] drm/amd/display: Early return on crc get Harry Wentland
2018-01-18 21:03   ` [PATCH 06/24] drm/amd/display: Call update_stream_signal directly from amdgpu_dm Harry Wentland
2018-01-18 21:03   ` [PATCH 07/24] drm/amd/display: Demote error print to debug print when ATOM impl missing Harry Wentland
2018-01-18 21:03   ` Harry Wentland [this message]
2018-01-18 21:03   ` [PATCH 09/24] drm/amd/display: Add timing generator count to resource pool Harry Wentland
2018-01-18 21:03   ` [PATCH 10/24] drm/amd/display: fix backlight not off at resume from S4 Harry Wentland
2018-01-18 21:03   ` [PATCH 11/24] drm/amd/display: Define dpp1_set_cursor_position in header Harry Wentland
2018-01-18 21:03   ` [PATCH 12/24] drm/amd/display: disable az_clock_gating for endpoint register access only Harry Wentland
2018-01-18 21:03   ` [PATCH 13/24] drm/amd/display: revert to hacking bounding box for pipe split Harry Wentland
2018-01-18 21:03   ` [PATCH 14/24] drm/amd/display: dpms off mute az audio endpoint only Harry Wentland
2018-01-18 21:03   ` [PATCH 15/24] drm/amd/display: Fix deadlock when flushing irq Harry Wentland
     [not found]     ` <20180118210353.18842-16-harry.wentland-5C7GfCeVMHo@public.gmane.org>
2018-01-19 18:33       ` Andrey Grodzovsky
     [not found]         ` <2996fec0-814d-ec58-788b-883df20d2651-5C7GfCeVMHo@public.gmane.org>
2018-01-22 14:38           ` Lipski, Mikita
     [not found]             ` <BN6PR1201MB0100D9415FC07D00CBE859CCE4EF0-6iU6OBHu2P8MZuswy4CCPGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2018-01-22 14:57               ` Andrey Grodzovsky
     [not found]                 ` <a5d20d38-760e-a4ef-5f79-8774e70f3a4c-5C7GfCeVMHo@public.gmane.org>
2018-01-22 15:53                   ` Harry Wentland
     [not found]                     ` <fd132165-4c3e-09e4-ec1c-d583263a2917-5C7GfCeVMHo@public.gmane.org>
2018-01-22 16:01                       ` Andrey Grodzovsky
     [not found]                         ` <98d53b0d-855f-1702-3c10-2b11ec416cc3-5C7GfCeVMHo@public.gmane.org>
2018-01-22 17:23                           ` Deucher, Alexander
2018-01-18 21:03   ` [PATCH 16/24] drm/amd/display: dal 3.1.29 Harry Wentland
2018-01-18 21:03   ` [PATCH 17/24] drm/amd/display: Force full update on pixel_format_change Harry Wentland
2018-01-18 21:03   ` [PATCH 18/24] drm/amd/display: Add debug flag for p010_mpo_support Harry Wentland
2018-01-18 21:03   ` [PATCH 19/24] drm/amd/display: eDP sequence BL off first then DP blank Harry Wentland
2018-01-18 21:03   ` [PATCH 20/24] drm/amd/display: Fix unused variable compilation error Harry Wentland
2018-01-18 21:03   ` [PATCH 21/24] drm/amd/display: Add temporary delay on disconnect patch Harry Wentland
2018-01-18 21:03   ` [PATCH 22/24] drm/amd/display: Remove unnecessary register programming Harry Wentland
2018-01-18 21:03   ` [PATCH 23/24] drm/amd/display: Add temporary delay on disconnect patch Harry Wentland
2018-01-18 21:03   ` [PATCH 24/24] drm/amd/display: Fix warning about misaligned code Harry Wentland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180118210353.18842-9-harry.wentland@amd.com \
    --to=harry.wentland-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=sivapiriyan.kumarasamy-5C7GfCeVMHo@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox