@@ -910,18 +910,20 @@ static void populate_dml21_plane_config_from_plane_state(struct dml2_context *dm
910910}
911911
912912//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 )
914914{
915915	int  i , j ;
916916
917917	if  (!plane_id )
918918		return  false;
919919
920920	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+ 				}
925927			}
926928		}
927929	}
@@ -944,14 +946,14 @@ static unsigned int map_stream_to_dml21_display_cfg(const struct dml2_context *d
944946	return  location ;
945947}
946948
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 , 
948950		const  struct  dc_plane_state  * plane , const  struct  dc_state  * context )
949951{
950952	unsigned int   plane_id ;
951953	int  i  =  0 ;
952954	int  location  =  -1 ;
953955
954- 	if  (!dml21_wrapper_get_plane_id (context , plane , & plane_id )) {
956+ 	if  (!dml21_wrapper_get_plane_id (context , stream_id ,  plane , & plane_id )) {
955957		ASSERT (false);
956958		return  -1 ;
957959	}
@@ -1037,7 +1039,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
10371039			dml_dispcfg -> plane_descriptors [disp_cfg_plane_location ].stream_index  =  disp_cfg_stream_location ;
10381040		} else  {
10391041			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 );
10411043
10421044				if  (disp_cfg_plane_location  <  0 )
10431045					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
10481050				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 );
10491051				dml_dispcfg -> plane_descriptors [disp_cfg_plane_location ].stream_index  =  disp_cfg_stream_location ;
10501052
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 ]))
10521054					dml_ctx -> v21 .dml_to_dc_pipe_mapping .disp_cfg_to_plane_id_valid [disp_cfg_plane_location ] =  true;
10531055
10541056				/* apply forced pstate policy */ 
0 commit comments