@@ -916,18 +916,20 @@ static void populate_dml21_plane_config_from_plane_state(struct dml2_context *dm
916
916
}
917
917
918
918
//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 )
920
920
{
921
921
int i , j ;
922
922
923
923
if (!plane_id )
924
924
return false;
925
925
926
926
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
+ }
931
933
}
932
934
}
933
935
}
@@ -950,14 +952,14 @@ static unsigned int map_stream_to_dml21_display_cfg(const struct dml2_context *d
950
952
return location ;
951
953
}
952
954
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 ,
954
956
const struct dc_plane_state * plane , const struct dc_state * context )
955
957
{
956
958
unsigned int plane_id ;
957
959
int i = 0 ;
958
960
int location = -1 ;
959
961
960
- if (!dml21_wrapper_get_plane_id (context , plane , & plane_id )) {
962
+ if (!dml21_wrapper_get_plane_id (context , stream_id , plane , & plane_id )) {
961
963
ASSERT (false);
962
964
return -1 ;
963
965
}
@@ -1043,7 +1045,7 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
1043
1045
dml_dispcfg -> plane_descriptors [disp_cfg_plane_location ].stream_index = disp_cfg_stream_location ;
1044
1046
} else {
1045
1047
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 );
1047
1049
1048
1050
if (disp_cfg_plane_location < 0 )
1049
1051
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
1054
1056
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 );
1055
1057
dml_dispcfg -> plane_descriptors [disp_cfg_plane_location ].stream_index = disp_cfg_stream_location ;
1056
1058
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 ]))
1058
1060
dml_ctx -> v21 .dml_to_dc_pipe_mapping .disp_cfg_to_plane_id_valid [disp_cfg_plane_location ] = true;
1059
1061
1060
1062
/* apply forced pstate policy */
0 commit comments