Skip to content

Commit fd7cedc

Browse files
Taimur Hassanalexdeucher
authored andcommitted
drm/amd/display: Fix OTG disable workaround logic
[Why] DENTIST was hanging when performing DISPCLK update with OTG enabled, as OTG disable workaround was not executing. [How] Workaround was checking against current_state before running, but when called from optimize_bandwidth (safe_to_lower), we should be checking against context instead. Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Acked-by: Hersen Wu <hersenxs.wu@amd.com> Signed-off-by: Taimur Hassan <syed.hassan@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent ce3b32e commit fd7cedc

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,16 @@ static int dcn35_get_active_display_cnt_wa(
111111
return display_count;
112112
}
113113

114-
static void dcn35_disable_otg_wa(struct clk_mgr *clk_mgr_base, struct dc_state *context, bool disable)
114+
static void dcn35_disable_otg_wa(struct clk_mgr *clk_mgr_base, struct dc_state *context,
115+
bool safe_to_lower, bool disable)
115116
{
116117
struct dc *dc = clk_mgr_base->ctx->dc;
117118
int i;
118119

119120
for (i = 0; i < dc->res_pool->pipe_count; ++i) {
120-
struct pipe_ctx *pipe = &dc->current_state->res_ctx.pipe_ctx[i];
121+
struct pipe_ctx *pipe = safe_to_lower
122+
? &context->res_ctx.pipe_ctx[i]
123+
: &dc->current_state->res_ctx.pipe_ctx[i];
121124

122125
if (pipe->top_pipe || pipe->prev_odm_pipe)
123126
continue;
@@ -301,11 +304,11 @@ void dcn35_update_clocks(struct clk_mgr *clk_mgr_base,
301304
}
302305

303306
if (should_set_clock(safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) {
304-
dcn35_disable_otg_wa(clk_mgr_base, context, true);
307+
dcn35_disable_otg_wa(clk_mgr_base, context, safe_to_lower, true);
305308

306309
clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;
307310
dcn35_smu_set_dispclk(clk_mgr, clk_mgr_base->clks.dispclk_khz);
308-
dcn35_disable_otg_wa(clk_mgr_base, context, false);
311+
dcn35_disable_otg_wa(clk_mgr_base, context, safe_to_lower, false);
309312

310313
update_dispclk = true;
311314
}

0 commit comments

Comments
 (0)