Commit d3069fee authored by Zhikai Zhai's avatar Zhikai Zhai Committed by Alex Deucher
Browse files

drm/amd/display: calculate the remain segments for all pipes



[WHY]
In some cases the remain de-tile buffer segments will be greater
than zero if we don't add the non-top pipe to calculate, at
this time the override de-tile buffer size will be valid and used.
But it makes the de-tile buffer segments used finally for all of pipes
exceed the maximum.

[HOW]
Add the non-top pipe to calculate the remain de-tile buffer segments.
Don't set override size to use the average according to pipe count
if the value exceed the maximum.

Reviewed-by: default avatarCharlene Liu <charlene.liu@amd.com>
Signed-off-by: default avatarZhikai Zhai <zhikai.zhai@amd.com>
Signed-off-by: default avatarTom Chung <chiahsuan.chung@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent dd60bfd5
Loading
Loading
Loading
Loading
+20 −22
Original line number Diff line number Diff line
@@ -1698,7 +1698,7 @@ static int dcn315_populate_dml_pipes_from_context(
		pipes[pipe_cnt].dout.dsc_input_bpc = 0;
		DC_FP_START();
		dcn31_zero_pipe_dcc_fraction(pipes, pipe_cnt);
		if (pixel_rate_crb && !pipe->top_pipe && !pipe->prev_odm_pipe) {
		if (pixel_rate_crb) {
			int bpp = source_format_to_bpp(pipes[pipe_cnt].pipe.src.source_format);
			/* Ceil to crb segment size */
			int approx_det_segs_required_for_pstate = dcn_get_approx_det_segs_required_for_pstate(
@@ -1755,7 +1755,6 @@ static int dcn315_populate_dml_pipes_from_context(
				continue;
			}

			if (!pipe->top_pipe && !pipe->prev_odm_pipe) {
			bool split_required = pipe->stream->timing.pix_clk_100hz >= dcn_get_max_non_odm_pix_rate_100hz(&dc->dml.soc)
					|| (pipe->plane_state && pipe->plane_state->src_rect.width > 5120);

@@ -1776,7 +1775,6 @@ static int dcn315_populate_dml_pipes_from_context(
			pipes[pipe_cnt].pipe.src.det_size_override *= DCN3_15_CRB_SEGMENT_SIZE_KB;

			crb_idx++;
			}
			pipe_cnt++;
		}
	}