Commit 339126b5 authored by Wenjing Liu's avatar Wenjing Liu Committed by Alex Deucher

drm/amd/display: fix an incorrect ODM policy assigned for subvp

[why]
When Subvp pipe's index is smaller than main pipe's index, the main
pipe's ODM policy is not yet assigned. If we assign subvp pipe's ODM
policy based on main pipe, we will assign uninitialized ODM policy.

[how]
Instead of copying main pipe's policy we copy the main pipe ODM policy
logic. So it doesn't matter whether if main pipe's ODM policy is set,
phantom pipe will always have the same policy because it running the
same calcualtion to derive ODM policy.

Cc: stable@vger.kernel.org
Reviewed-by: default avatarAlvin Lee <alvin.lee2@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 4a5b1712
......@@ -1824,6 +1824,7 @@ int dcn32_populate_dml_pipes_from_context(
int num_subvp_main = 0;
int num_subvp_phantom = 0;
int num_subvp_none = 0;
int odm_slice_count;
dcn20_populate_dml_pipes_from_context(dc, context, pipes, fast_validate);
......@@ -1852,7 +1853,7 @@ int dcn32_populate_dml_pipes_from_context(
mall_type = dc_state_get_pipe_subvp_type(context, pipe);
if (mall_type == SUBVP_MAIN) {
if (resource_is_pipe_type(pipe, OTG_MASTER))
subvp_main_pipe_index = pipe_cnt;
subvp_main_pipe_index = i;
}
pipe_cnt++;
}
......@@ -1878,22 +1879,23 @@ int dcn32_populate_dml_pipes_from_context(
mall_type = dc_state_get_pipe_subvp_type(context, pipe);
if (single_display_subvp && (mall_type == SUBVP_PHANTOM)) {
if (subvp_main_pipe_index < 0) {
odm_slice_count = -1;
ASSERT(0);
} else {
pipes[pipe_cnt].pipe.dest.odm_combine_policy =
pipes[subvp_main_pipe_index].pipe.dest.odm_combine_policy;
odm_slice_count = resource_get_odm_slice_count(&res_ctx->pipe_ctx[subvp_main_pipe_index]);
}
} else {
switch (resource_get_odm_slice_count(pipe)) {
case 2:
pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_2to1;
break;
case 4:
pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_4to1;
break;
default:
pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_dal;
}
odm_slice_count = resource_get_odm_slice_count(pipe);
}
switch (odm_slice_count) {
case 2:
pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_2to1;
break;
case 4:
pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_4to1;
break;
default:
pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_dal;
}
} else {
pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_dal;
......
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