@@ -887,18 +887,20 @@ static void populate_dml21_plane_config_from_plane_state(struct dml2_context *dm
887
887
}
888
888
889
889
//TODO : Could be possibly moved to a common helper layer.
890
- static bool dml21_wrapper_get_plane_id (const struct dc_state * context , const struct dc_plane_state * plane , unsigned int * plane_id )
890
+ 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 )
891
891
{
892
892
int i , j ;
893
893
894
894
if (!plane_id )
895
895
return false;
896
896
897
897
for (i = 0 ; i < context -> stream_count ; i ++ ) {
898
- for (j = 0 ; j < context -> stream_status [i ].plane_count ; j ++ ) {
899
- if (context -> stream_status [i ].plane_states [j ] == plane ) {
900
- * plane_id = (i << 16 ) | j ;
901
- return true;
898
+ if (context -> streams [i ]-> stream_id == stream_id ) {
899
+ for (j = 0 ; j < context -> stream_status [i ].plane_count ; j ++ ) {
900
+ if (context -> stream_status [i ].plane_states [j ] == plane ) {
901
+ * plane_id = (i << 16 ) | j ;
902
+ return true;
903
+ }
902
904
}
903
905
}
904
906
}
@@ -921,14 +923,14 @@ static unsigned int map_stream_to_dml21_display_cfg(const struct dml2_context *d
921
923
return location ;
922
924
}
923
925
924
- static unsigned int map_plane_to_dml21_display_cfg (const struct dml2_context * dml_ctx ,
926
+ static unsigned int map_plane_to_dml21_display_cfg (const struct dml2_context * dml_ctx , unsigned int stream_id ,
925
927
const struct dc_plane_state * plane , const struct dc_state * context )
926
928
{
927
929
unsigned int plane_id ;
928
930
int i = 0 ;
929
931
int location = -1 ;
930
932
931
- if (!dml21_wrapper_get_plane_id (context , plane , & plane_id )) {
933
+ if (!dml21_wrapper_get_plane_id (context , stream_id , plane , & plane_id )) {
932
934
ASSERT (false);
933
935
return -1 ;
934
936
}
@@ -1013,7 +1015,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
1013
1015
dml_dispcfg -> plane_descriptors [disp_cfg_plane_location ].stream_index = disp_cfg_stream_location ;
1014
1016
} else {
1015
1017
for (plane_index = 0 ; plane_index < context -> stream_status [stream_index ].plane_count ; plane_index ++ ) {
1016
- disp_cfg_plane_location = map_plane_to_dml21_display_cfg (dml_ctx , context -> stream_status [stream_index ].plane_states [plane_index ], context );
1018
+ 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 );
1017
1019
1018
1020
if (disp_cfg_plane_location < 0 )
1019
1021
disp_cfg_plane_location = dml_dispcfg -> num_planes ++ ;
@@ -1024,7 +1026,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
1024
1026
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 );
1025
1027
dml_dispcfg -> plane_descriptors [disp_cfg_plane_location ].stream_index = disp_cfg_stream_location ;
1026
1028
1027
- 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 ]))
1029
+ 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 ]))
1028
1030
dml_ctx -> v21 .dml_to_dc_pipe_mapping .disp_cfg_to_plane_id_valid [disp_cfg_plane_location ] = true;
1029
1031
1030
1032
/* apply forced pstate policy */
0 commit comments