@@ -1671,7 +1671,7 @@ static void acquire_dsc(struct resource_context *res_ctx,
1671
1671
}
1672
1672
}
1673
1673
1674
- static void release_dsc (struct resource_context * res_ctx ,
1674
+ void dcn20_release_dsc (struct resource_context * res_ctx ,
1675
1675
const struct resource_pool * pool ,
1676
1676
struct display_stream_compressor * * dsc )
1677
1677
{
@@ -1731,7 +1731,7 @@ static enum dc_status remove_dsc_from_stream_resource(struct dc *dc,
1731
1731
pipe_ctx = & new_ctx -> res_ctx .pipe_ctx [i ];
1732
1732
1733
1733
if (pipe_ctx -> stream_res .dsc )
1734
- release_dsc (& new_ctx -> res_ctx , dc -> res_pool , & pipe_ctx -> stream_res .dsc );
1734
+ dcn20_release_dsc (& new_ctx -> res_ctx , dc -> res_pool , & pipe_ctx -> stream_res .dsc );
1735
1735
}
1736
1736
}
1737
1737
@@ -2502,7 +2502,7 @@ struct pipe_ctx *dcn20_find_secondary_pipe(struct dc *dc,
2502
2502
return secondary_pipe ;
2503
2503
}
2504
2504
2505
- void dcn20_merge_pipes_for_validate (
2505
+ static void dcn20_merge_pipes_for_validate (
2506
2506
struct dc * dc ,
2507
2507
struct dc_state * context )
2508
2508
{
@@ -2527,7 +2527,7 @@ void dcn20_merge_pipes_for_validate(
2527
2527
odm_pipe -> prev_odm_pipe = NULL ;
2528
2528
odm_pipe -> next_odm_pipe = NULL ;
2529
2529
if (odm_pipe -> stream_res .dsc )
2530
- release_dsc (& context -> res_ctx , dc -> res_pool , & odm_pipe -> stream_res .dsc );
2530
+ dcn20_release_dsc (& context -> res_ctx , dc -> res_pool , & odm_pipe -> stream_res .dsc );
2531
2531
/* Clear plane_res and stream_res */
2532
2532
memset (& odm_pipe -> plane_res , 0 , sizeof (odm_pipe -> plane_res ));
2533
2533
memset (& odm_pipe -> stream_res , 0 , sizeof (odm_pipe -> stream_res ));
@@ -2565,7 +2565,8 @@ int dcn20_validate_apply_pipe_split_flags(
2565
2565
struct dc * dc ,
2566
2566
struct dc_state * context ,
2567
2567
int vlevel ,
2568
- bool * split )
2568
+ bool * split ,
2569
+ bool * merge )
2569
2570
{
2570
2571
int i , pipe_idx , vlevel_split ;
2571
2572
int plane_count = 0 ;
@@ -2609,11 +2610,12 @@ int dcn20_validate_apply_pipe_split_flags(
2609
2610
/* Split loop sets which pipe should be split based on dml outputs and dc flags */
2610
2611
for (i = 0 , pipe_idx = 0 ; i < dc -> res_pool -> pipe_count ; i ++ ) {
2611
2612
struct pipe_ctx * pipe = & context -> res_ctx .pipe_ctx [i ];
2613
+ int pipe_plane = context -> bw_ctx .dml .vba .pipe_plane [pipe_idx ];
2612
2614
2613
2615
if (!context -> res_ctx .pipe_ctx [i ].stream )
2614
2616
continue ;
2615
2617
2616
- if (force_split || context -> bw_ctx .dml .vba .NoOfDPP [vlevel ][context -> bw_ctx .dml .vba .maxMpcComb ][pipe_idx ] > 1 )
2618
+ if (force_split || context -> bw_ctx .dml .vba .NoOfDPP [vlevel ][context -> bw_ctx .dml .vba .maxMpcComb ][pipe_plane ] > 1 )
2617
2619
split [i ] = true;
2618
2620
if ((pipe -> stream -> view_format ==
2619
2621
VIEW_3D_FORMAT_SIDE_BY_SIDE ||
@@ -2626,10 +2628,44 @@ int dcn20_validate_apply_pipe_split_flags(
2626
2628
split [i ] = true;
2627
2629
if (dc -> debug .force_odm_combine & (1 << pipe -> stream_res .tg -> inst )) {
2628
2630
split [i ] = true;
2629
- context -> bw_ctx .dml .vba .ODMCombineEnablePerState [vlevel ][pipe_idx ] = dm_odm_combine_mode_2to1 ;
2631
+ context -> bw_ctx .dml .vba .ODMCombineEnablePerState [vlevel ][pipe_plane ] = dm_odm_combine_mode_2to1 ;
2630
2632
}
2631
- context -> bw_ctx .dml .vba .ODMCombineEnabled [pipe_idx ] =
2632
- context -> bw_ctx .dml .vba .ODMCombineEnablePerState [vlevel ][pipe_idx ];
2633
+ context -> bw_ctx .dml .vba .ODMCombineEnabled [pipe_plane ] =
2634
+ context -> bw_ctx .dml .vba .ODMCombineEnablePerState [vlevel ][pipe_plane ];
2635
+
2636
+ if (pipe -> prev_odm_pipe && context -> bw_ctx .dml .vba .ODMCombineEnabled [pipe_plane ] != dm_odm_combine_mode_disabled ) {
2637
+ /*Already split odm pipe tree, don't try to split again*/
2638
+ split [i ] = false;
2639
+ split [pipe -> prev_odm_pipe -> pipe_idx ] = false;
2640
+ } else if (pipe -> top_pipe && pipe -> plane_state == pipe -> top_pipe -> plane_state
2641
+ && context -> bw_ctx .dml .vba .ODMCombineEnabled [pipe_plane ] == dm_odm_combine_mode_disabled ) {
2642
+ /*Already split mpc tree, don't try to split again, assumes only 2x mpc combine*/
2643
+ split [i ] = false;
2644
+ split [pipe -> top_pipe -> pipe_idx ] = false;
2645
+ } else if (pipe -> prev_odm_pipe || (pipe -> top_pipe && pipe -> plane_state == pipe -> top_pipe -> plane_state )) {
2646
+ if (split [i ] == false) {
2647
+ /*Exiting mpc/odm combine*/
2648
+ merge [i ] = true;
2649
+ if (pipe -> prev_odm_pipe ) {
2650
+ ASSERT (0 ); /*should not actually happen yet*/
2651
+ merge [pipe -> prev_odm_pipe -> pipe_idx ] = true;
2652
+ } else
2653
+ merge [pipe -> top_pipe -> pipe_idx ] = true;
2654
+ } else {
2655
+ /*Transition from mpc combine to odm combine or vice versa*/
2656
+ ASSERT (0 ); /*should not actually happen yet*/
2657
+ split [i ] = true;
2658
+ merge [i ] = true;
2659
+ if (pipe -> prev_odm_pipe ) {
2660
+ split [pipe -> prev_odm_pipe -> pipe_idx ] = true;
2661
+ merge [pipe -> prev_odm_pipe -> pipe_idx ] = true;
2662
+ } else {
2663
+ split [pipe -> top_pipe -> pipe_idx ] = true;
2664
+ merge [pipe -> top_pipe -> pipe_idx ] = true;
2665
+ }
2666
+ }
2667
+ }
2668
+
2633
2669
/* Adjust dppclk when split is forced, do not bother with dispclk */
2634
2670
if (split [i ] && context -> bw_ctx .dml .vba .NoOfDPP [vlevel ][context -> bw_ctx .dml .vba .maxMpcComb ][pipe_idx ] == 1 )
2635
2671
context -> bw_ctx .dml .vba .RequiredDPPCLK [vlevel ][context -> bw_ctx .dml .vba .maxMpcComb ][pipe_idx ] /= 2 ;
@@ -2671,7 +2707,7 @@ bool dcn20_fast_validate_bw(
2671
2707
if (vlevel > context -> bw_ctx .dml .soc .num_states )
2672
2708
goto validate_fail ;
2673
2709
2674
- vlevel = dcn20_validate_apply_pipe_split_flags (dc , context , vlevel , split );
2710
+ vlevel = dcn20_validate_apply_pipe_split_flags (dc , context , vlevel , split , NULL );
2675
2711
2676
2712
/*initialize pipe_just_split_from to invalid idx*/
2677
2713
for (i = 0 ; i < MAX_PIPES ; i ++ )
0 commit comments