@@ -99,20 +99,25 @@ static int dcn316_get_active_display_cnt_wa(
9999 return display_count ;
100100}
101101
102- static void dcn316_disable_otg_wa (struct clk_mgr * clk_mgr_base , struct dc_state * context , bool disable )
102+ static void dcn316_disable_otg_wa (struct clk_mgr * clk_mgr_base , struct dc_state * context ,
103+ bool safe_to_lower , bool disable )
103104{
104105 struct dc * dc = clk_mgr_base -> ctx -> dc ;
105106 int i ;
106107
107108 for (i = 0 ; i < dc -> res_pool -> pipe_count ; ++ i ) {
108- struct pipe_ctx * pipe = & dc -> current_state -> res_ctx .pipe_ctx [i ];
109+ struct pipe_ctx * pipe = safe_to_lower
110+ ? & context -> res_ctx .pipe_ctx [i ]
111+ : & dc -> current_state -> res_ctx .pipe_ctx [i ];
109112
110113 if (pipe -> top_pipe || pipe -> prev_odm_pipe )
111114 continue ;
112- if (pipe -> stream && (pipe -> stream -> dpms_off || pipe -> plane_state == NULL ||
113- dc_is_virtual_signal ( pipe -> stream -> signal ) )) {
115+ if (pipe -> stream && (pipe -> stream -> dpms_off || dc_is_virtual_signal ( pipe -> stream -> signal ) ||
116+ ! pipe -> stream -> link_enc )) {
114117 if (disable ) {
115- pipe -> stream_res .tg -> funcs -> immediate_disable_crtc (pipe -> stream_res .tg );
118+ if (pipe -> stream_res .tg && pipe -> stream_res .tg -> funcs -> immediate_disable_crtc )
119+ pipe -> stream_res .tg -> funcs -> immediate_disable_crtc (pipe -> stream_res .tg );
120+
116121 reset_sync_context_for_pipe (dc , context , i );
117122 } else
118123 pipe -> stream_res .tg -> funcs -> enable_crtc (pipe -> stream_res .tg );
@@ -207,11 +212,11 @@ static void dcn316_update_clocks(struct clk_mgr *clk_mgr_base,
207212 }
208213
209214 if (should_set_clock (safe_to_lower , new_clocks -> dispclk_khz , clk_mgr_base -> clks .dispclk_khz )) {
210- dcn316_disable_otg_wa (clk_mgr_base , context , true);
215+ dcn316_disable_otg_wa (clk_mgr_base , context , safe_to_lower , true);
211216
212217 clk_mgr_base -> clks .dispclk_khz = new_clocks -> dispclk_khz ;
213218 dcn316_smu_set_dispclk (clk_mgr , clk_mgr_base -> clks .dispclk_khz );
214- dcn316_disable_otg_wa (clk_mgr_base , context , false);
219+ dcn316_disable_otg_wa (clk_mgr_base , context , safe_to_lower , false);
215220
216221 update_dispclk = true;
217222 }
0 commit comments