Skip to contentSkip to conversation

drm/amd/display: Fix surface optimization regression on Carrizo

PATCH In review Nicholas Kazlauskas 4 participants 4 messages Oct 12, 2021

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

PATCH 1/1 drm/amd/display: Fix surface optimization regression on Carrizo

[Why]
DCE legacy optimization path isn't well tested under new DC optimization flow which can result in underflow occuring when initializing X11 on Carrizo.

[How]
Retain the legacy optimization flow for DCE and keep the new one for DCN to satisfy optimizations being correctly applied for ASIC that can support it.

Fixes ab37c6527bb1 ("drm/amd/display: Optimize bandwidth on following fast update")
Cc Bhawanpreet Lakha <[email protected]>
Cc Mikita Lipski <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +13 -2
index da942e9f5142..f9876e429f26 100644
@@ -3118,8 +3118,13 @@ void dc_commit_updates_for_stream(struct dc *dc,
 			if (new_pipe->plane_state && new_pipe->plane_state != old_pipe->plane_state)
 				new_pipe->plane_state->force_full_update = true;
 		}
-	} else if (update_type == UPDATE_TYPE_FAST) {
-		/* Previous frame finished and HW is ready for optimization. */
+	} else if (update_type == UPDATE_TYPE_FAST && dc_ctx->dce_version >= DCE_VERSION_MAX) {
+		/*
+		 * Previous frame finished and HW is ready for optimization.
+		 *
+		 * Only relevant for DCN behavior where we can guarantee the optimization
+		 * is safe to apply - retain the legacy behavior for DCE.
+		 */
 		dc_post_update_surfaces_to_stream(dc);
 	}
 
@@ -3178,6 +3183,12 @@ void dc_commit_updates_for_stream(struct dc *dc,
 		}
 	}
 
+	/* Legacy optimization path for DCE. */
+	if (update_type >= UPDATE_TYPE_FULL && dc_ctx->dce_version < DCE_VERSION_MAX) {
+		dc_post_update_surfaces_to_stream(dc);
+		TRACE_DCE_CLOCK_STATE(&context->bw_ctx.bw.dce);
+	}
+
 	return;
 
 }
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Nicholas Kazlauskas

[Why]
DCE legacy optimization path isn't well tested under new DC optimization flow which can result in underflow occuring when initializing X11 on Carrizo.

[How]
Retain the legacy optimization flow for DCE and keep the new one for DCN to satisfy optimizations being correctly applied for ASIC that can support it.

Quoted 5 lines
Fixes ab37c6527bb1 ("drm/amd/display: Optimize bandwidth on following fast update")
Cc Bhawanpreet Lakha <[email protected]>
Cc Mikita Lipski <[email protected]>
Quoted 40 lines
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +13 -3
index da942e9f5142..f9876e429f26 100644
@@ -3118,8 +3118,13 @@ void dc_commit_updates_for_stream(struct dc *dc,
                        if (new_pipe->plane_state && new_pipe->plane_state != old_pipe->plane_state)
                                new_pipe->plane_state->force_full_update = true;
                }
-       } else if (update_type == UPDATE_TYPE_FAST) {
-               /* Previous frame finished and HW is ready for optimization. */
+       } else if (update_type == UPDATE_TYPE_FAST && dc_ctx->dce_version >= DCE_VERSION_MAX) {
+               /*
+                * Previous frame finished and HW is ready for optimization.
+                *
+                * Only relevant for DCN behavior where we can guarantee the optimization
+                * is safe to apply - retain the legacy behavior for DCE.
+                */
                dc_post_update_surfaces_to_stream(dc);
        }
 
@@ -3178,6 +3183,12 @@ void dc_commit_updates_for_stream(struct dc *dc,
                }
        }
 
+       /* Legacy optimization path for DCE. */
+       if (update_type >= UPDATE_TYPE_FULL && dc_ctx->dce_version < DCE_VERSION_MAX) {
+               dc_post_update_surfaces_to_stream(dc);
+               TRACE_DCE_CLOCK_STATE(&context->bw_ctx.bw.dce);
+       }
+
        return;
 
 }
--

2.25.1

Tested-by Acked-by Alex Deucher
#2 lore raw

[AMD Official Use Only]

Thanks.

________________________________________
From: Alex Deucher <[email protected]>
Sent: Tuesday, October 12, 2021 10:15
To: Kazlauskas, Nicholas
Cc: amd-gfx list; Lakha, Bhawanpreet; Lipski, Mikita; StDenis, Tom
Subject: Re: [PATCH] drm/amd/display: Fix surface optimization regression on Carrizo

Quoted 11 lines · Nicholas Kazlauskas

[Why]
DCE legacy optimization path isn't well tested under new DC optimization flow which can result in underflow occuring when initializing X11 on Carrizo.

[How]
Retain the legacy optimization flow for DCE and keep the new one for DCN to satisfy optimizations being correctly applied for ASIC that can support it.

Quoted 5 lines
Fixes ab37c6527bb1 ("drm/amd/display: Optimize bandwidth on following fast update")
Cc Bhawanpreet Lakha <[email protected]>
Cc Mikita Lipski <[email protected]>
Quoted 40 lines
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +13 -3
index da942e9f5142..f9876e429f26 100644
@@ -3118,8 +3118,13 @@ void dc_commit_updates_for_stream(struct dc *dc,
                        if (new_pipe->plane_state && new_pipe->plane_state != old_pipe->plane_state)
                                new_pipe->plane_state->force_full_update = true;
                }
-       } else if (update_type == UPDATE_TYPE_FAST) {
-               /* Previous frame finished and HW is ready for optimization. */
+       } else if (update_type == UPDATE_TYPE_FAST && dc_ctx->dce_version >= DCE_VERSION_MAX) {
+               /*
+                * Previous frame finished and HW is ready for optimization.
+                *
+                * Only relevant for DCN behavior where we can guarantee the optimization
+                * is safe to apply - retain the legacy behavior for DCE.
+                */
                dc_post_update_surfaces_to_stream(dc);
        }
 
@@ -3178,6 +3183,12 @@ void dc_commit_updates_for_stream(struct dc *dc,
                }
        }
 
+       /* Legacy optimization path for DCE. */
+       if (update_type >= UPDATE_TYPE_FULL && dc_ctx->dce_version < DCE_VERSION_MAX) {
+               dc_post_update_surfaces_to_stream(dc);
+               TRACE_DCE_CLOCK_STATE(&context->bw_ctx.bw.dce);
+       }
+
        return;
 
 }
--

2.25.1

maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Nicholas Kazlauskas
Quoted 10 lines · Nicholas Kazlauskas

[Why]
DCE legacy optimization path isn't well tested under new DC optimization flow which can result in underflow occuring when initializing X11 on Carrizo.

[How]
Retain the legacy optimization flow for DCE and keep the new one for DCN to satisfy optimizations being correctly applied for ASIC that can support it.

Quoted 5 lines
Fixes ab37c6527bb1 ("drm/amd/display: Optimize bandwidth on following fast update")
Cc Bhawanpreet Lakha <[email protected]>
Cc Mikita Lipski <[email protected]>

Harry

Quoted 38 lines
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +13 -2
index da942e9f5142..f9876e429f26 100644
@@ -3118,8 +3118,13 @@ void dc_commit_updates_for_stream(struct dc *dc,
 			if (new_pipe->plane_state && new_pipe->plane_state != old_pipe->plane_state)
 				new_pipe->plane_state->force_full_update = true;
 		}
-	} else if (update_type == UPDATE_TYPE_FAST) {
-		/* Previous frame finished and HW is ready for optimization. */
+	} else if (update_type == UPDATE_TYPE_FAST && dc_ctx->dce_version >= DCE_VERSION_MAX) {
+		/*
+		 * Previous frame finished and HW is ready for optimization.
+		 *
+		 * Only relevant for DCN behavior where we can guarantee the optimization
+		 * is safe to apply - retain the legacy behavior for DCE.
+		 */
 		dc_post_update_surfaces_to_stream(dc);
 	}
 
@@ -3178,6 +3183,12 @@ void dc_commit_updates_for_stream(struct dc *dc,
 		}
 	}
 
+	/* Legacy optimization path for DCE. */
+	if (update_type >= UPDATE_TYPE_FULL && dc_ctx->dce_version < DCE_VERSION_MAX) {
+		dc_post_update_surfaces_to_stream(dc);
+		TRACE_DCE_CLOCK_STATE(&context->bw_ctx.bw.dce);
+	}
+
 	return;
 
 }