From: Mike Katsnelson <mike.katsnel...@amd.com>

[Why]
Transitioning from low to high resolutions at high refresh rates caused grey 
corruption.
During the transition state, there is a period where plane size is based on low 
resultion
state and ODM slices are based on high resoultion state, causing the entire 
plane to be
contained in one ODM slice. DML2 would turn off the pipe for the ODM slice with 
no plane,
causing an underflow since the pixel rate for the higher resolution cannot be 
supported on
one pipe. This change stops DML2 from turning off pipes that are mapped to an 
ODM slice
with no plane. This is possible to do without negative consequences because 
pipes can now
take the minimum viewport and draw with zero recout size, removing the need to 
have the
pipe turned off.

[How]
In map_pipes_from_plane(), remove "check" that skips ODM slices that are not 
covered by
the plane. This prevents the pipes for those ODM slices from being freed.

Reviewed-by: Ovidiu Bunea <ovidiu.bu...@amd.com>
Signed-off-by: Mike Katsnelson <mike.katsnel...@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.moha...@amd.com>
---
 .../display/dc/dml2/dml2_dc_resource_mgmt.c   | 26 -------------------
 1 file changed, 26 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c 
b/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
index 1ed21c1b86a5..a966abd40788 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c
@@ -532,26 +532,6 @@ static void calculate_odm_slices(const struct 
dc_stream_state *stream, unsigned
        odm_slice_end_x[odm_factor - 1] = stream->src.width - 1;
 }
 
-static bool is_plane_in_odm_slice(const struct dc_plane_state *plane, unsigned 
int slice_index, unsigned int *odm_slice_end_x, unsigned int num_slices)
-{
-       unsigned int slice_start_x, slice_end_x;
-
-       if (slice_index == 0)
-               slice_start_x = 0;
-       else
-               slice_start_x = odm_slice_end_x[slice_index - 1] + 1;
-
-       slice_end_x = odm_slice_end_x[slice_index];
-
-       if (plane->clip_rect.x + plane->clip_rect.width < slice_start_x)
-               return false;
-
-       if (plane->clip_rect.x > slice_end_x)
-               return false;
-
-       return true;
-}
-
 static void add_odm_slice_to_odm_tree(struct dml2_context *ctx,
                struct dc_state *state,
                struct dc_pipe_mapping_scratch *scratch,
@@ -791,12 +771,6 @@ static void map_pipes_for_plane(struct dml2_context *ctx, 
struct dc_state *state
        sort_pipes_for_splitting(&scratch->pipe_pool);
 
        for (odm_slice_index = 0; odm_slice_index < 
scratch->odm_info.odm_factor; odm_slice_index++) {
-               // We build the tree for one ODM slice at a time.
-               // Each ODM slice shares a common OPP
-               if (!is_plane_in_odm_slice(plane, odm_slice_index, 
scratch->odm_info.odm_slice_end_x, scratch->odm_info.odm_factor)) {
-                       continue;
-               }
-
                // Now we have a list of all pipes to be used for this 
plane/stream, now setup the tree.
                
scratch->odm_info.next_higher_pipe_for_odm_slice[odm_slice_index] = 
add_plane_to_blend_tree(ctx, state,
                                plane,
-- 
2.34.1

Reply via email to