Skip to content

Commit 4b56f7d

Browse files
Nicholas Kazlauskasalexdeucher
authored andcommitted
drm/amd/display: Port DENTIST hang and TDR fixes to OTG disable W/A
[Why] We can experience DENTIST hangs during optimize_bandwidth or TDRs if FIFO is toggled and hangs. [How] Port the DCN35 fixes to DCN314. Cc: Mario Limonciello <mario.limonciello@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Reviewed-by: Charlene Liu <charlene.liu@amd.com> Acked-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 8a51cc0 commit 4b56f7d

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -145,30 +145,27 @@ static int dcn314_get_active_display_cnt_wa(
145145
return display_count;
146146
}
147147

148-
static void dcn314_disable_otg_wa(struct clk_mgr *clk_mgr_base, struct dc_state *context, bool disable)
148+
static void dcn314_disable_otg_wa(struct clk_mgr *clk_mgr_base, struct dc_state *context,
149+
bool safe_to_lower, bool disable)
149150
{
150151
struct dc *dc = clk_mgr_base->ctx->dc;
151152
int i;
152153

153154
for (i = 0; i < dc->res_pool->pipe_count; ++i) {
154-
struct pipe_ctx *pipe = &dc->current_state->res_ctx.pipe_ctx[i];
155+
struct pipe_ctx *pipe = safe_to_lower
156+
? &context->res_ctx.pipe_ctx[i]
157+
: &dc->current_state->res_ctx.pipe_ctx[i];
155158

156159
if (pipe->top_pipe || pipe->prev_odm_pipe)
157160
continue;
158161
if (pipe->stream && (pipe->stream->dpms_off || dc_is_virtual_signal(pipe->stream->signal))) {
159-
struct stream_encoder *stream_enc = pipe->stream_res.stream_enc;
160-
161162
if (disable) {
162-
if (stream_enc && stream_enc->funcs->disable_fifo)
163-
pipe->stream_res.stream_enc->funcs->disable_fifo(stream_enc);
163+
if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->immediate_disable_crtc)
164+
pipe->stream_res.tg->funcs->immediate_disable_crtc(pipe->stream_res.tg);
164165

165-
pipe->stream_res.tg->funcs->immediate_disable_crtc(pipe->stream_res.tg);
166166
reset_sync_context_for_pipe(dc, context, i);
167167
} else {
168168
pipe->stream_res.tg->funcs->enable_crtc(pipe->stream_res.tg);
169-
170-
if (stream_enc && stream_enc->funcs->enable_fifo)
171-
pipe->stream_res.stream_enc->funcs->enable_fifo(stream_enc);
172169
}
173170
}
174171
}
@@ -297,11 +294,11 @@ void dcn314_update_clocks(struct clk_mgr *clk_mgr_base,
297294
}
298295

299296
if (should_set_clock(safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) {
300-
dcn314_disable_otg_wa(clk_mgr_base, context, true);
297+
dcn314_disable_otg_wa(clk_mgr_base, context, safe_to_lower, true);
301298

302299
clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;
303300
dcn314_smu_set_dispclk(clk_mgr, clk_mgr_base->clks.dispclk_khz);
304-
dcn314_disable_otg_wa(clk_mgr_base, context, false);
301+
dcn314_disable_otg_wa(clk_mgr_base, context, safe_to_lower, false);
305302

306303
update_dispclk = true;
307304
}

0 commit comments

Comments
 (0)