Commit 1290183d authored by Wenjing Liu's avatar Wenjing Liu Committed by Alex Deucher

drm/amd/display: always use mpc factor of 2 for stereo timings

[why]
In the new pipe resource management logic, the special handling for
stereo timings is missing.
This commit implements the same stereo timings handling as old
pipe resource management code.
Reviewed-by: default avatarChaitanya Dhere <chaitanya.dhere@amd.com>
Acked-by: default avatarHamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent cfab8038
...@@ -772,18 +772,29 @@ static unsigned int get_mpc_factor(struct dml2_context *ctx, ...@@ -772,18 +772,29 @@ static unsigned int get_mpc_factor(struct dml2_context *ctx,
const struct dc_state *state, const struct dc_state *state,
const struct dml_display_cfg_st *disp_cfg, const struct dml_display_cfg_st *disp_cfg,
struct dml2_dml_to_dc_pipe_mapping *mapping, struct dml2_dml_to_dc_pipe_mapping *mapping,
const struct dc_stream_status *status, unsigned int stream_id, const struct dc_stream_status *status,
const struct dc_stream_state *stream,
int plane_idx) int plane_idx)
{ {
unsigned int plane_id; unsigned int plane_id;
unsigned int cfg_idx; unsigned int cfg_idx;
unsigned int mpc_factor;
get_plane_id(ctx, state, status->plane_states[plane_idx], stream_id, plane_idx, &plane_id); get_plane_id(ctx, state, status->plane_states[plane_idx],
stream->stream_id, plane_idx, &plane_id);
cfg_idx = find_disp_cfg_idx_by_plane_id(mapping, plane_id); cfg_idx = find_disp_cfg_idx_by_plane_id(mapping, plane_id);
if (ctx->architecture == dml2_architecture_20) if (ctx->architecture == dml2_architecture_20) {
return (unsigned int)disp_cfg->hw.DPPPerSurface[cfg_idx]; mpc_factor = (unsigned int)disp_cfg->hw.DPPPerSurface[cfg_idx];
ASSERT(false); } else {
return 1; mpc_factor = 1;
ASSERT(false);
}
/* For stereo timings, we need to pipe split */
if (dml2_is_stereo_timing(stream))
mpc_factor = 2;
return mpc_factor;
} }
static unsigned int get_odm_factor( static unsigned int get_odm_factor(
...@@ -820,14 +831,13 @@ static void populate_mpc_factors_for_stream( ...@@ -820,14 +831,13 @@ static void populate_mpc_factors_for_stream(
unsigned int mpc_factors[MAX_PIPES]) unsigned int mpc_factors[MAX_PIPES])
{ {
const struct dc_stream_status *status = &state->stream_status[stream_idx]; const struct dc_stream_status *status = &state->stream_status[stream_idx];
unsigned int stream_id = state->streams[stream_idx]->stream_id;
int i; int i;
for (i = 0; i < status->plane_count; i++) for (i = 0; i < status->plane_count; i++)
if (odm_factor == 1) if (odm_factor == 1)
mpc_factors[i] = get_mpc_factor( mpc_factors[i] = get_mpc_factor(
ctx, state, disp_cfg, mapping, status, ctx, state, disp_cfg, mapping, status,
stream_id, i); state->streams[stream_idx], i);
else else
mpc_factors[i] = 1; mpc_factors[i] = 1;
} }
......
...@@ -468,7 +468,7 @@ bool dml2_verify_det_buffer_configuration(struct dml2_context *in_ctx, struct dc ...@@ -468,7 +468,7 @@ bool dml2_verify_det_buffer_configuration(struct dml2_context *in_ctx, struct dc
return need_recalculation; return need_recalculation;
} }
bool dml2_is_stereo_timing(struct dc_stream_state *stream) bool dml2_is_stereo_timing(const struct dc_stream_state *stream)
{ {
bool is_stereo = false; bool is_stereo = false;
......
...@@ -42,7 +42,7 @@ void dml2_copy_clocks_to_dc_state(struct dml2_dcn_clocks *out_clks, struct dc_st ...@@ -42,7 +42,7 @@ void dml2_copy_clocks_to_dc_state(struct dml2_dcn_clocks *out_clks, struct dc_st
void dml2_extract_watermark_set(struct dcn_watermarks *watermark, struct display_mode_lib_st *dml_core_ctx); void dml2_extract_watermark_set(struct dcn_watermarks *watermark, struct display_mode_lib_st *dml_core_ctx);
int dml2_helper_find_dml_pipe_idx_by_stream_id(struct dml2_context *ctx, unsigned int stream_id); int dml2_helper_find_dml_pipe_idx_by_stream_id(struct dml2_context *ctx, unsigned int stream_id);
bool is_dtbclk_required(const struct dc *dc, struct dc_state *context); bool is_dtbclk_required(const struct dc *dc, struct dc_state *context);
bool dml2_is_stereo_timing(struct dc_stream_state *stream); bool dml2_is_stereo_timing(const struct dc_stream_state *stream);
/* /*
* dml2_dc_construct_pipes - This function will determine if we need additional pipes based * dml2_dc_construct_pipes - This function will determine if we need additional pipes based
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment