drm/amd/display: Do not commit pipe when updating DRR
[WHY] DRR and Pipe cannot be updated on the same frame, or else underflow will occur. Reviewed-by: Jun Lei <Jun.Lei@amd.com> Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com> Signed-off-by: Wesley Chalmers <Wesley.Chalmers@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
4f1b5e739d
commit
8f0d304d21
5 changed files with 29 additions and 1 deletions
|
@ -3350,6 +3350,21 @@ static void commit_planes_for_stream(struct dc *dc,
|
||||||
|
|
||||||
dc_z10_restore(dc);
|
dc_z10_restore(dc);
|
||||||
|
|
||||||
|
if (update_type == UPDATE_TYPE_FULL) {
|
||||||
|
/* wait for all double-buffer activity to clear on all pipes */
|
||||||
|
int pipe_idx;
|
||||||
|
|
||||||
|
for (pipe_idx = 0; pipe_idx < dc->res_pool->pipe_count; pipe_idx++) {
|
||||||
|
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[pipe_idx];
|
||||||
|
|
||||||
|
if (!pipe_ctx->stream)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (pipe_ctx->stream_res.tg->funcs->wait_drr_doublebuffer_pending_clear)
|
||||||
|
pipe_ctx->stream_res.tg->funcs->wait_drr_doublebuffer_pending_clear(pipe_ctx->stream_res.tg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (get_seamless_boot_stream_count(context) > 0 && surface_count > 0) {
|
if (get_seamless_boot_stream_count(context) > 0 && surface_count > 0) {
|
||||||
/* Optimize seamless boot flag keeps clocks and watermarks high until
|
/* Optimize seamless boot flag keeps clocks and watermarks high until
|
||||||
* first flip. After first flip, optimization is required to lower
|
* first flip. After first flip, optimization is required to lower
|
||||||
|
|
|
@ -519,7 +519,8 @@ struct dcn_optc_registers {
|
||||||
type OTG_CRC_DATA_STREAM_COMBINE_MODE;\
|
type OTG_CRC_DATA_STREAM_COMBINE_MODE;\
|
||||||
type OTG_CRC_DATA_STREAM_SPLIT_MODE;\
|
type OTG_CRC_DATA_STREAM_SPLIT_MODE;\
|
||||||
type OTG_CRC_DATA_FORMAT;\
|
type OTG_CRC_DATA_FORMAT;\
|
||||||
type OTG_V_TOTAL_LAST_USED_BY_DRR;
|
type OTG_V_TOTAL_LAST_USED_BY_DRR;\
|
||||||
|
type OTG_DRR_TIMING_DBUF_UPDATE_PENDING;
|
||||||
|
|
||||||
#define TG_REG_FIELD_LIST_DCN3_2(type) \
|
#define TG_REG_FIELD_LIST_DCN3_2(type) \
|
||||||
type OTG_H_TIMING_DIV_MODE_MANUAL;
|
type OTG_H_TIMING_DIV_MODE_MANUAL;
|
||||||
|
|
|
@ -291,6 +291,14 @@ static void optc3_set_timing_double_buffer(struct timing_generator *optc, bool e
|
||||||
OTG_DRR_TIMING_DBUF_UPDATE_MODE, mode);
|
OTG_DRR_TIMING_DBUF_UPDATE_MODE, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void optc3_wait_drr_doublebuffer_pending_clear(struct timing_generator *optc)
|
||||||
|
{
|
||||||
|
struct optc *optc1 = DCN10TG_FROM_TG(optc);
|
||||||
|
|
||||||
|
REG_WAIT(OTG_DOUBLE_BUFFER_CONTROL, OTG_DRR_TIMING_DBUF_UPDATE_PENDING, 0, 2, 100000); /* 1 vupdate at 5hz */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void optc3_set_vtotal_min_max(struct timing_generator *optc, int vtotal_min, int vtotal_max)
|
void optc3_set_vtotal_min_max(struct timing_generator *optc, int vtotal_min, int vtotal_max)
|
||||||
{
|
{
|
||||||
optc1_set_vtotal_min_max(optc, vtotal_min, vtotal_max);
|
optc1_set_vtotal_min_max(optc, vtotal_min, vtotal_max);
|
||||||
|
@ -360,6 +368,7 @@ static struct timing_generator_funcs dcn30_tg_funcs = {
|
||||||
.program_manual_trigger = optc2_program_manual_trigger,
|
.program_manual_trigger = optc2_program_manual_trigger,
|
||||||
.setup_manual_trigger = optc2_setup_manual_trigger,
|
.setup_manual_trigger = optc2_setup_manual_trigger,
|
||||||
.get_hw_timing = optc1_get_hw_timing,
|
.get_hw_timing = optc1_get_hw_timing,
|
||||||
|
.wait_drr_doublebuffer_pending_clear = optc3_wait_drr_doublebuffer_pending_clear,
|
||||||
};
|
};
|
||||||
|
|
||||||
void dcn30_timing_generator_init(struct optc *optc1)
|
void dcn30_timing_generator_init(struct optc *optc1)
|
||||||
|
|
|
@ -279,6 +279,7 @@
|
||||||
SF(OTG0_OTG_DRR_TRIGGER_WINDOW, OTG_DRR_TRIGGER_WINDOW_END_X, mask_sh),\
|
SF(OTG0_OTG_DRR_TRIGGER_WINDOW, OTG_DRR_TRIGGER_WINDOW_END_X, mask_sh),\
|
||||||
SF(OTG0_OTG_DRR_V_TOTAL_CHANGE, OTG_DRR_V_TOTAL_CHANGE_LIMIT, mask_sh),\
|
SF(OTG0_OTG_DRR_V_TOTAL_CHANGE, OTG_DRR_V_TOTAL_CHANGE_LIMIT, mask_sh),\
|
||||||
SF(OTG0_OTG_H_TIMING_CNTL, OTG_H_TIMING_DIV_BY2, mask_sh),\
|
SF(OTG0_OTG_H_TIMING_CNTL, OTG_H_TIMING_DIV_BY2, mask_sh),\
|
||||||
|
SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_DRR_TIMING_DBUF_UPDATE_PENDING, mask_sh),\
|
||||||
SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_DRR_TIMING_DBUF_UPDATE_MODE, mask_sh),\
|
SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_DRR_TIMING_DBUF_UPDATE_MODE, mask_sh),\
|
||||||
SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_BLANK_DATA_DOUBLE_BUFFER_EN, mask_sh)
|
SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_BLANK_DATA_DOUBLE_BUFFER_EN, mask_sh)
|
||||||
|
|
||||||
|
@ -317,6 +318,7 @@
|
||||||
SF(OTG0_OTG_DRR_TRIGGER_WINDOW, OTG_DRR_TRIGGER_WINDOW_END_X, mask_sh),\
|
SF(OTG0_OTG_DRR_TRIGGER_WINDOW, OTG_DRR_TRIGGER_WINDOW_END_X, mask_sh),\
|
||||||
SF(OTG0_OTG_DRR_V_TOTAL_CHANGE, OTG_DRR_V_TOTAL_CHANGE_LIMIT, mask_sh),\
|
SF(OTG0_OTG_DRR_V_TOTAL_CHANGE, OTG_DRR_V_TOTAL_CHANGE_LIMIT, mask_sh),\
|
||||||
SF(OTG0_OTG_H_TIMING_CNTL, OTG_H_TIMING_DIV_MODE, mask_sh),\
|
SF(OTG0_OTG_H_TIMING_CNTL, OTG_H_TIMING_DIV_MODE, mask_sh),\
|
||||||
|
SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_DRR_TIMING_DBUF_UPDATE_PENDING, mask_sh),\
|
||||||
SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_DRR_TIMING_DBUF_UPDATE_MODE, mask_sh)
|
SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_DRR_TIMING_DBUF_UPDATE_MODE, mask_sh)
|
||||||
|
|
||||||
void dcn30_timing_generator_init(struct optc *optc1);
|
void dcn30_timing_generator_init(struct optc *optc1);
|
||||||
|
|
|
@ -331,6 +331,7 @@ struct timing_generator_funcs {
|
||||||
uint32_t vtotal_change_limit);
|
uint32_t vtotal_change_limit);
|
||||||
|
|
||||||
void (*init_odm)(struct timing_generator *tg);
|
void (*init_odm)(struct timing_generator *tg);
|
||||||
|
void (*wait_drr_doublebuffer_pending_clear)(struct timing_generator *tg);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue