From: Relja Vojvodic <relja.vojvodic@xxxxxxx> [Why] Found while hotplugging MST daisy chain displays. Changing dispclk during this sequence caused SMU hang due to DIG fifo not being disabled correctly (caused by missing functions). [How] Adding disable/enable DIG fifo functions for dcn401 Reviewed-by: Wenjing Liu <wenjing.liu@xxxxxxx> Acked-by: Hamza Mahfooz <hamza.mahfooz@xxxxxxx> Signed-off-by: Relja Vojvodic <relja.vojvodic@xxxxxxx> --- .../gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c | 4 ++-- .../gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.h | 6 ++++++ .../drm/amd/display/dc/dcn401/dcn401_dio_stream_encoder.c | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c index 1325db3a4ed0..6a179e5ab417 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c +++ b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c @@ -392,7 +392,7 @@ static void enc35_reset_fifo(struct stream_encoder *enc, bool reset) udelay(10); } -static void enc35_disable_fifo(struct stream_encoder *enc) +void enc35_disable_fifo(struct stream_encoder *enc) { struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc); @@ -401,7 +401,7 @@ static void enc35_disable_fifo(struct stream_encoder *enc) REG_UPDATE(DIG_FE_CLK_CNTL, DIG_FE_CLK_EN, 0); } -static void enc35_enable_fifo(struct stream_encoder *enc) +void enc35_enable_fifo(struct stream_encoder *enc) { struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc); diff --git a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.h b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.h index 1212fcee38f2..ddb33fdfb4ee 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.h +++ b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.h @@ -322,5 +322,11 @@ void enc3_dp_set_dsc_pps_info_packet( uint8_t *dsc_packed_pps, bool immediate_update); +void enc35_disable_fifo( + struct stream_encoder *enc); + +void enc35_enable_fifo( + struct stream_encoder *enc); + #endif /* __DC_DIO_STREAM_ENCODER_DCN35_H__ */ diff --git a/drivers/gpu/drm/amd/display/dc/dcn401/dcn401_dio_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dcn401/dcn401_dio_stream_encoder.c index 2ebfca4769aa..0a27e0942a12 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn401/dcn401_dio_stream_encoder.c +++ b/drivers/gpu/drm/amd/display/dc/dcn401/dcn401_dio_stream_encoder.c @@ -27,6 +27,7 @@ #include "dc_bios_types.h" #include "dcn30/dcn30_dio_stream_encoder.h" #include "dcn32/dcn32_dio_stream_encoder.h" +#include "dcn35/dcn35_dio_stream_encoder.h" #include "dcn401_dio_stream_encoder.h" #include "reg_helper.h" @@ -764,7 +765,8 @@ static const struct stream_encoder_funcs dcn401_str_enc_funcs = { .enable_stream = enc401_stream_encoder_enable, .set_input_mode = enc401_set_dig_input_mode, - .enable_fifo = enc32_enable_fifo, + .enable_fifo = enc35_enable_fifo, + .disable_fifo = enc35_disable_fifo, .map_stream_to_link = enc401_stream_encoder_map_to_link, }; -- 2.45.1