Skip to content

Commit 4bdc5b5

Browse files
Zhikai Zhaialexdeucher
authored andcommitted
drm/amd/display: Skip to enable dsc if it has been off
[WHY] It makes DSC enable when we commit the stream which need keep power off, and then it will skip to disable DSC if pipe reset at this situation as power has been off. It may cause the DSC unexpected enable on the pipe with the next new stream which doesn't support DSC. [HOW] Check the DSC used on current pipe status when update stream. Skip to enable if it has been off. The operation enable DSC should happen when set power on. Cc: Mario Limonciello <mario.limonciello@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Reviewed-by: Wenjing Liu <wenjing.liu@amd.com> Signed-off-by: Zhikai Zhai <zhikai.zhai@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent f510dd5 commit 4bdc5b5

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,20 @@ void dcn32_update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)
10321032
struct dsc_config dsc_cfg;
10331033
struct dsc_optc_config dsc_optc_cfg = {0};
10341034
enum optc_dsc_mode optc_dsc_mode;
1035+
struct dcn_dsc_state dsc_state = {0};
1036+
1037+
if (!dsc) {
1038+
DC_LOG_DSC("DSC is NULL for tg instance %d:", pipe_ctx->stream_res.tg->inst);
1039+
return;
1040+
}
1041+
1042+
if (dsc->funcs->dsc_read_state) {
1043+
dsc->funcs->dsc_read_state(dsc, &dsc_state);
1044+
if (!dsc_state.dsc_fw_en) {
1045+
DC_LOG_DSC("DSC has been disabled for tg instance %d:", pipe_ctx->stream_res.tg->inst);
1046+
return;
1047+
}
1048+
}
10351049

10361050
/* Enable DSC hw block */
10371051
dsc_cfg.pic_width = (stream->timing.h_addressable + stream->timing.h_border_left + stream->timing.h_border_right) / opp_cnt;

drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,20 @@ static void update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)
334334
struct dsc_config dsc_cfg;
335335
struct dsc_optc_config dsc_optc_cfg = {0};
336336
enum optc_dsc_mode optc_dsc_mode;
337+
struct dcn_dsc_state dsc_state = {0};
337338

339+
if (!dsc) {
340+
DC_LOG_DSC("DSC is NULL for tg instance %d:", pipe_ctx->stream_res.tg->inst);
341+
return;
342+
}
343+
344+
if (dsc->funcs->dsc_read_state) {
345+
dsc->funcs->dsc_read_state(dsc, &dsc_state);
346+
if (!dsc_state.dsc_fw_en) {
347+
DC_LOG_DSC("DSC has been disabled for tg instance %d:", pipe_ctx->stream_res.tg->inst);
348+
return;
349+
}
350+
}
338351
/* Enable DSC hw block */
339352
dsc_cfg.pic_width = (stream->timing.h_addressable + stream->timing.h_border_left + stream->timing.h_border_right) / opp_cnt;
340353
dsc_cfg.pic_height = stream->timing.v_addressable + stream->timing.v_border_top + stream->timing.v_border_bottom;

0 commit comments

Comments
 (0)