@@ -887,18 +887,20 @@ static void populate_dml21_plane_config_from_plane_state(struct dml2_context *dm
887887}
888888
889889//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 )
891891{
892892 int i , j ;
893893
894894 if (!plane_id )
895895 return false;
896896
897897 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+ }
902904 }
903905 }
904906 }
@@ -921,14 +923,14 @@ static unsigned int map_stream_to_dml21_display_cfg(const struct dml2_context *d
921923 return location ;
922924}
923925
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 ,
925927 const struct dc_plane_state * plane , const struct dc_state * context )
926928{
927929 unsigned int plane_id ;
928930 int i = 0 ;
929931 int location = -1 ;
930932
931- if (!dml21_wrapper_get_plane_id (context , plane , & plane_id )) {
933+ if (!dml21_wrapper_get_plane_id (context , stream_id , plane , & plane_id )) {
932934 ASSERT (false);
933935 return -1 ;
934936 }
@@ -1013,7 +1015,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
10131015 dml_dispcfg -> plane_descriptors [disp_cfg_plane_location ].stream_index = disp_cfg_stream_location ;
10141016 } else {
10151017 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 );
10171019
10181020 if (disp_cfg_plane_location < 0 )
10191021 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
10241026 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 );
10251027 dml_dispcfg -> plane_descriptors [disp_cfg_plane_location ].stream_index = disp_cfg_stream_location ;
10261028
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 ]))
10281030 dml_ctx -> v21 .dml_to_dc_pipe_mapping .disp_cfg_to_plane_id_valid [disp_cfg_plane_location ] = true;
10291031
10301032 /* apply forced pstate policy */
0 commit comments