Skip to content

Commit 0ee057e

Browse files
nsusantoalexdeucher
authored andcommitted
drm/amd/display: Fix encoder disable logic
[WHY] DENTIST hangs when OTG is off and encoder is on. We were not disabling the encoder properly when switching from extended mode to external monitor only. [HOW] Disable the encoder using an existing enable/disable fifo helper instead of enc35_stream_encoder_enable. Cc: Mario Limonciello <mario.limonciello@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Acked-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Nicholas Susanto <nicholas.susanto@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 5911d02 commit 0ee057e

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,6 @@ static void enc35_stream_encoder_enable(
261261
/* invalid mode ! */
262262
ASSERT_CRITICAL(false);
263263
}
264-
265-
REG_UPDATE(DIG_FE_CLK_CNTL, DIG_FE_CLK_EN, 1);
266-
REG_UPDATE(DIG_FE_EN_CNTL, DIG_FE_ENABLE, 1);
267-
} else {
268-
REG_UPDATE(DIG_FE_EN_CNTL, DIG_FE_ENABLE, 0);
269-
REG_UPDATE(DIG_FE_CLK_CNTL, DIG_FE_CLK_EN, 0);
270264
}
271265
}
272266

@@ -436,13 +430,17 @@ static void enc35_disable_fifo(struct stream_encoder *enc)
436430
struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);
437431

438432
REG_UPDATE(DIG_FIFO_CTRL0, DIG_FIFO_ENABLE, 0);
433+
REG_UPDATE(DIG_FE_EN_CNTL, DIG_FE_ENABLE, 0);
434+
REG_UPDATE(DIG_FE_CLK_CNTL, DIG_FE_CLK_EN, 0);
439435
}
440436

441437
static void enc35_enable_fifo(struct stream_encoder *enc)
442438
{
443439
struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);
444440

445441
REG_UPDATE(DIG_FIFO_CTRL0, DIG_FIFO_READ_START_LEVEL, 0x7);
442+
REG_UPDATE(DIG_FE_CLK_CNTL, DIG_FE_CLK_EN, 1);
443+
REG_UPDATE(DIG_FE_EN_CNTL, DIG_FE_ENABLE, 1);
446444

447445
enc35_reset_fifo(enc, true);
448446
enc35_reset_fifo(enc, false);

0 commit comments

Comments
 (0)