aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWenjing Liu <[email protected]>2024-03-22 15:29:56 -0400
committerAlex Deucher <[email protected]>2024-04-09 22:15:10 -0400
commit339126b5294468409bfb4cd49ec4745d1b7bf3bf (patch)
tree5db046d64e4771344a20c9aa2543be6ae2fb7799
parent4a5b171299e59d51322f4c6bd376c5acbeca0a4a (diff)
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: [email protected] Reviewed-by: Alvin Lee <[email protected]> Acked-by: Hamza Mahfooz <[email protected]> Signed-off-by: Wenjing Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
index e2bff9b9d55a..9aa39bd25be9 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
@@ -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;