Skip to contentSkip to conversation

Revert "drm/amd/display: revert wait in pipelock"

PATCH In review Alex Deucher 2 participants 2 messages Nov 15, 2019 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "drm/amd/display: revert wait in pipelock"

This reverts commit 617089d5837a3aa4167a9c4afb34929e0d52805d.

This causes hangs in some games.

---
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +11 -0
index 0046a099c9e9..9b4488ef27d1 100644
@@ -1033,6 +1033,17 @@ void dcn20_pipe_control_lock(
 	if (pipe->plane_state != NULL)
 		flip_immediate = pipe->plane_state->flip_immediate;
 
+	if (flip_immediate && lock) {
+		while (pipe->plane_res.hubp->funcs->hubp_is_flip_pending(pipe->plane_res.hubp))	{
+			udelay(1);
+		}
+
+		if (pipe->bottom_pipe != NULL)
+			while (pipe->bottom_pipe->plane_res.hubp->funcs->hubp_is_flip_pending(pipe->bottom_pipe->plane_res.hubp))	{
+				udelay(1);
+			}
+	}
+
 	/* In flip immediate and pipe splitting case, we need to use GSL
 	 * for synchronization. Only do setup on locking and on flip type change.
 	 */
Signature · 6 lines
2.23.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20191115151308.578774-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#2 lore raw
Quoted 8 lines · Alex Deucher

This reverts commit 617089d5837a3aa4167a9c4afb34929e0d52805d.

This causes hangs in some games.

I think this will also just hang the system in some cases.

I know that if we're waiting for flip pending == 0 on plane enable we've hit cases where it's hung infinitely on dcn20.

Since this code is in pipe lock itself (where this timeout code was contained) this means that we'd similarly see a similar hang - but only in the case where we'd switching flip types.

This probably needs to have a timeout of 100ms or so like the plane enable:

	if (flip_immediate && lock) {
		const int TIMEOUT_FOR_FLIP_PENDING = 100000;
		int i;

		for (i = 0; i < TIMEOUT_FOR_FLIP_PENDING; ++i) {
			if (pipe->plane_res.hubp->funcs->hubp_is_flip_pending(
				    pipe->plane_res.hubp))
				break;

			udelay(1);
		}

		if (pipe->bottom_pipe != NULL) {
			for (i = 0; i < TIMEOUT_FOR_FLIP_PENDING; ++i) {
				if (pipe->bottom_pipe->plane_res.hubp->funcs
					    ->hubp_is_flip_pending(
						    pipe->bottom_pipe->plane_res
							    .hubp))
					break;

				udelay(1);
			}
		}
	}

Nicholas Kazlauskas

Quoted 17 lines
---
  drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 11 +++++++++++
  1 file changed, 11 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +4 -0
index 0046a099c9e9..9b4488ef27d1 100644
@@ -1033,6 +1033,17 @@ void dcn20_pipe_control_lock(
  	if (pipe->plane_state != NULL)
  		flip_immediate = pipe->plane_state->flip_immediate;
 
+	if (flip_immediate && lock) {
+		while (pipe->plane_res.hubp->funcs->hubp_is_flip_pending(pipe->plane_res.hubp))	{
+			udelay(1);
+		}

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c void dcn20_pipe_control_lock( · line 1049

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +7 -0
+
+		if (pipe->bottom_pipe != NULL)
+			while (pipe->bottom_pipe->plane_res.hubp->funcs->hubp_is_flip_pending(pipe->bottom_pipe->plane_res.hubp))	{
+				udelay(1);
+			}
+	}
+
  	/* In flip immediate and pipe splitting case, we need to use GSL
  	 * for synchronization. Only do setup on locking and on flip type change.
  	 */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx