@@ -99,20 +99,25 @@ static int dcn316_get_active_display_cnt_wa(
99
99
return display_count ;
100
100
}
101
101
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 )
103
104
{
104
105
struct dc * dc = clk_mgr_base -> ctx -> dc ;
105
106
int i ;
106
107
107
108
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 ];
109
112
110
113
if (pipe -> top_pipe || pipe -> prev_odm_pipe )
111
114
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 )) {
114
117
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
+
116
121
reset_sync_context_for_pipe (dc , context , i );
117
122
} else
118
123
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,
207
212
}
208
213
209
214
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);
211
216
212
217
clk_mgr_base -> clks .dispclk_khz = new_clocks -> dispclk_khz ;
213
218
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);
215
220
216
221
update_dispclk = true;
217
222
}
0 commit comments