Skip to contentSkip to conversation

drm/amd/display: re-enable wait in pipelock, but add timeout

PATCH In review Alex Deucher 3 participants 5 messages Nov 15, 2019 – Nov 26, 2019 3 messages not in the archive

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

PATCH 1/1 drm/amd/display: re-enable wait in pipelock, but add timeout

Removing this causes hangs in some games, so re-add it, but add a timeout so we don't hang while switching flip types.

---
 .../drm/amd/display/dc/dcn20/dcn20_hwseq.c    | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +19 -0
index 0046a099c9e9..120e62c5193c 100644
@@ -1033,6 +1033,25 @@ void dcn20_pipe_control_lock(
 	if (pipe->plane_state != NULL)
 		flip_immediate = pipe->plane_state->flip_immediate;
 
+	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);
+			}
+		}
+	}
+
 	/* 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): 20191115160119.658620-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Ping?

Quoted 43 lines · Alex Deucher

Removing this causes hangs in some games, so re-add it, but add a timeout so we don't hang while switching flip types.

---
 .../drm/amd/display/dc/dcn20/dcn20_hwseq.c    | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +19 -1
index 0046a099c9e9..120e62c5193c 100644
@@ -1033,6 +1033,25 @@ void dcn20_pipe_control_lock(
        if (pipe->plane_state != NULL)
                flip_immediate = pipe->plane_state->flip_immediate;
 
+       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);
+                       }
+               }
+       }
+
        /* In flip immediate and pipe splitting case, we need to use GSL
         * for synchronization. Only do setup on locking and on flip type change.
         */
--
Quoted 2 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): CADnq5_P5m-eWDy5Xb5qs2HpcZbh3FxLTAxhxsXRZGDbkYrTZnA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw

The same bug is listed twice. Did you mean a third bug?

Den tors 21 nov. 2019 kl 00:25 skrev Alex Deucher <[email protected]>:

Quoted 45 lines

Ping?

Quoted 41 lines · Alex Deucher

Removing this causes hangs in some games, so re-add it, but add a timeout so we don't hang while switching flip types.

---
 .../drm/amd/display/dc/dcn20/dcn20_hwseq.c    | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +19 -0
index 0046a099c9e9..120e62c5193c 100644
@@ -1033,6 +1033,25 @@ void dcn20_pipe_control_lock(
        if (pipe->plane_state != NULL)
                flip_immediate = pipe->plane_state->flip_immediate;
 
+       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);
+                       }
+               }
+       }
+
        /* In flip immediate and pipe splitting case, we need to use GSL
         * for synchronization. Only do setup on locking and on flip type change.
Quoted 8 lines
Quoted 4 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +0 -1
         */
--

2.23.0

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

_______________________________________________
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): CAD=4a=UAKO9Y+6fwy8QTBsemUuGe6yhwB8eVgkGHZzYWa_nDpQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#6 lore raw
Quoted 2 lines · Ernst Sjöstrand

The same bug is listed twice. Did you mean a third bug?

No just a typo. Already fixed up locally.

Alex

Quoted 56 lines

Den tors 21 nov. 2019 kl 00:25 skrev Alex Deucher <[email protected]>:

Quoted 53 lines

Ping?

Quoted 43 lines · Alex Deucher

Removing this causes hangs in some games, so re-add it, but add a timeout so we don't hang while switching flip types.

---
 .../drm/amd/display/dc/dcn20/dcn20_hwseq.c    | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +19 -1
index 0046a099c9e9..120e62c5193c 100644
@@ -1033,6 +1033,25 @@ void dcn20_pipe_control_lock(
        if (pipe->plane_state != NULL)
                flip_immediate = pipe->plane_state->flip_immediate;
 
+       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);
+                       }
+               }
+       }
+
        /* In flip immediate and pipe splitting case, we need to use GSL
         * for synchronization. Only do setup on locking and on flip type change.
         */
--
Quoted 2 lines

2.23.0

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

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

Reviewed-by
#7 lore raw
In reply to a message not in the archive
Quoted 7 lines · Alex Deucher

Removing this causes hangs in some games, so re-add it, but add a timeout so we don't hang while switching flip types.

Patch is

Harry

Quoted 25 lines
---
 .../drm/amd/display/dc/dcn20/dcn20_hwseq.c    | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +12 -0
index 0046a099c9e9..120e62c5193c 100644
@@ -1033,6 +1033,25 @@ void dcn20_pipe_control_lock(
 	if (pipe->plane_state != NULL)
 		flip_immediate = pipe->plane_state->flip_immediate;
 
+	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) {

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

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +7 -0
+				if (!pipe->bottom_pipe->plane_res.hubp->funcs->hubp_is_flip_pending(pipe->bottom_pipe->plane_res.hubp))
+					break;
+				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