@@ -910,18 +910,20 @@ static void populate_dml21_plane_config_from_plane_state(struct dml2_context *dm
910
910
}
911
911
912
912
//TODO : Could be possibly moved to a common helper layer.
913
- static bool dml21_wrapper_get_plane_id(const struct dc_state *context, const struct dc_plane_state *plane, unsigned int *plane_id)
913
+ static bool dml21_wrapper_get_plane_id(const struct dc_state *context, unsigned int stream_id, const struct dc_plane_state *plane, unsigned int *plane_id)
914
914
{
915
915
int i, j;
916
916
917
917
if (!plane_id)
918
918
return false;
919
919
920
920
for (i = 0; i < context->stream_count; i++) {
921
- for (j = 0; j < context->stream_status[i].plane_count; j++) {
922
- if (context->stream_status[i].plane_states[j] == plane) {
923
- *plane_id = (i << 16) | j;
924
- return true;
921
+ if (context->streams[i]->stream_id == stream_id) {
922
+ for (j = 0; j < context->stream_status[i].plane_count; j++) {
923
+ if (context->stream_status[i].plane_states[j] == plane) {
924
+ *plane_id = (i << 16) | j;
925
+ return true;
926
+ }
925
927
}
926
928
}
927
929
}
@@ -944,14 +946,14 @@ static unsigned int map_stream_to_dml21_display_cfg(const struct dml2_context *d
944
946
return location;
945
947
}
946
948
947
- static unsigned int map_plane_to_dml21_display_cfg(const struct dml2_context *dml_ctx,
949
+ static unsigned int map_plane_to_dml21_display_cfg(const struct dml2_context *dml_ctx, unsigned int stream_id,
948
950
const struct dc_plane_state *plane, const struct dc_state *context)
949
951
{
950
952
unsigned int plane_id;
951
953
int i = 0;
952
954
int location = -1;
953
955
954
- if (!dml21_wrapper_get_plane_id(context, plane, &plane_id)) {
956
+ if (!dml21_wrapper_get_plane_id(context, stream_id, plane, &plane_id)) {
955
957
ASSERT(false);
956
958
return -1;
957
959
}
@@ -1037,7 +1039,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
1037
1039
dml_dispcfg->plane_descriptors[disp_cfg_plane_location].stream_index = disp_cfg_stream_location;
1038
1040
} else {
1039
1041
for (plane_index = 0; plane_index < context->stream_status[stream_index].plane_count; plane_index++) {
1040
- disp_cfg_plane_location = map_plane_to_dml21_display_cfg(dml_ctx, context->stream_status[stream_index].plane_states[plane_index], context);
1042
+ disp_cfg_plane_location = map_plane_to_dml21_display_cfg(dml_ctx, context->streams[stream_index]->stream_id, context-> stream_status[stream_index].plane_states[plane_index], context);
1041
1043
1042
1044
if (disp_cfg_plane_location < 0)
1043
1045
disp_cfg_plane_location = dml_dispcfg->num_planes++;
@@ -1048,7 +1050,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
1048
1050
populate_dml21_plane_config_from_plane_state(dml_ctx, &dml_dispcfg->plane_descriptors[disp_cfg_plane_location], context->stream_status[stream_index].plane_states[plane_index], context, stream_index);
1049
1051
dml_dispcfg->plane_descriptors[disp_cfg_plane_location].stream_index = disp_cfg_stream_location;
1050
1052
1051
- if (dml21_wrapper_get_plane_id(context, context->stream_status[stream_index].plane_states[plane_index], &dml_ctx->v21.dml_to_dc_pipe_mapping.disp_cfg_to_plane_id[disp_cfg_plane_location]))
1053
+ if (dml21_wrapper_get_plane_id(context, context->streams[stream_index]->stream_id, context-> stream_status[stream_index].plane_states[plane_index], &dml_ctx->v21.dml_to_dc_pipe_mapping.disp_cfg_to_plane_id[disp_cfg_plane_location]))
1052
1054
dml_ctx->v21.dml_to_dc_pipe_mapping.disp_cfg_to_plane_id_valid[disp_cfg_plane_location] = true;
1053
1055
1054
1056
/* apply forced pstate policy */
0 commit comments