@@ -916,18 +916,20 @@ static void populate_dml21_plane_config_from_plane_state(struct dml2_context *dm
916916}
917917
918918//TODO : Could be possibly moved to a common helper layer.
919- static bool dml21_wrapper_get_plane_id (const struct dc_state * context , const struct dc_plane_state * plane , unsigned int * plane_id )
919+ 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 )
920920{
921921 int i , j ;
922922
923923 if (!plane_id )
924924 return false;
925925
926926 for (i = 0 ; i < context -> stream_count ; i ++ ) {
927- for (j = 0 ; j < context -> stream_status [i ].plane_count ; j ++ ) {
928- if (context -> stream_status [i ].plane_states [j ] == plane ) {
929- * plane_id = (i << 16 ) | j ;
930- return true;
927+ if (context -> streams [i ]-> stream_id == stream_id ) {
928+ for (j = 0 ; j < context -> stream_status [i ].plane_count ; j ++ ) {
929+ if (context -> stream_status [i ].plane_states [j ] == plane ) {
930+ * plane_id = (i << 16 ) | j ;
931+ return true;
932+ }
931933 }
932934 }
933935 }
@@ -950,14 +952,14 @@ static unsigned int map_stream_to_dml21_display_cfg(const struct dml2_context *d
950952 return location ;
951953}
952954
953- static unsigned int map_plane_to_dml21_display_cfg (const struct dml2_context * dml_ctx ,
955+ static unsigned int map_plane_to_dml21_display_cfg (const struct dml2_context * dml_ctx , unsigned int stream_id ,
954956 const struct dc_plane_state * plane , const struct dc_state * context )
955957{
956958 unsigned int plane_id ;
957959 int i = 0 ;
958960 int location = -1 ;
959961
960- if (!dml21_wrapper_get_plane_id (context , plane , & plane_id )) {
962+ if (!dml21_wrapper_get_plane_id (context , stream_id , plane , & plane_id )) {
961963 ASSERT (false);
962964 return -1 ;
963965 }
@@ -1043,7 +1045,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
10431045 dml_dispcfg -> plane_descriptors [disp_cfg_plane_location ].stream_index = disp_cfg_stream_location ;
10441046 } else {
10451047 for (plane_index = 0 ; plane_index < context -> stream_status [stream_index ].plane_count ; plane_index ++ ) {
1046- disp_cfg_plane_location = map_plane_to_dml21_display_cfg (dml_ctx , context -> stream_status [stream_index ].plane_states [plane_index ], context );
1048+ 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 );
10471049
10481050 if (disp_cfg_plane_location < 0 )
10491051 disp_cfg_plane_location = dml_dispcfg -> num_planes ++ ;
@@ -1054,7 +1056,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
10541056 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 );
10551057 dml_dispcfg -> plane_descriptors [disp_cfg_plane_location ].stream_index = disp_cfg_stream_location ;
10561058
1057- 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 ]))
1059+ 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 ]))
10581060 dml_ctx -> v21 .dml_to_dc_pipe_mapping .disp_cfg_to_plane_id_valid [disp_cfg_plane_location ] = true;
10591061
10601062 /* apply forced pstate policy */
0 commit comments