Commit 2e6e14c9 authored by Duncan Ma's avatar Duncan Ma Committed by Alex Deucher

drm/amd/display: Set compbuf size to min at prep prevent overbook crb

[Why]
Detbuffer size is dynamically set for dcn31x. At certain moment,
compbuf+(def size * num pipes) > config return buffer size causing
flickering. This is easily reproducible when MPO is
enabled with two displays.

[How]
At prepare BW, use the min comp buffer size. When it is to
optimize BW, set compbuf size back to maximum possible size.
Reviewed-by: default avatarCharlene Liu <Charlene.Liu@amd.com>
Acked-by: default avatarSolomon Chiu <solomon.chiu@amd.com>
Signed-off-by: default avatarDuncan Ma <duncanma@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e0adbe73
...@@ -1818,6 +1818,7 @@ void dcn20_prepare_bandwidth( ...@@ -1818,6 +1818,7 @@ void dcn20_prepare_bandwidth(
struct dc_state *context) struct dc_state *context)
{ {
struct hubbub *hubbub = dc->res_pool->hubbub; struct hubbub *hubbub = dc->res_pool->hubbub;
unsigned int compbuf_size_kb = 0;
dc->clk_mgr->funcs->update_clocks( dc->clk_mgr->funcs->update_clocks(
dc->clk_mgr, dc->clk_mgr,
...@@ -1829,9 +1830,16 @@ void dcn20_prepare_bandwidth( ...@@ -1829,9 +1830,16 @@ void dcn20_prepare_bandwidth(
&context->bw_ctx.bw.dcn.watermarks, &context->bw_ctx.bw.dcn.watermarks,
dc->res_pool->ref_clocks.dchub_ref_clock_inKhz / 1000, dc->res_pool->ref_clocks.dchub_ref_clock_inKhz / 1000,
false); false);
/* decrease compbuf size */ /* decrease compbuf size */
if (hubbub->funcs->program_compbuf_size) if (hubbub->funcs->program_compbuf_size) {
hubbub->funcs->program_compbuf_size(hubbub, context->bw_ctx.bw.dcn.compbuf_size_kb, false); if (context->bw_ctx.dml.ip.min_comp_buffer_size_kbytes)
compbuf_size_kb = context->bw_ctx.dml.ip.min_comp_buffer_size_kbytes;
else
compbuf_size_kb = context->bw_ctx.bw.dcn.compbuf_size_kb;
hubbub->funcs->program_compbuf_size(hubbub, compbuf_size_kb, false);
}
} }
void dcn20_optimize_bandwidth( void dcn20_optimize_bandwidth(
......
...@@ -141,6 +141,7 @@ struct _vcs_dpi_ip_params_st { ...@@ -141,6 +141,7 @@ struct _vcs_dpi_ip_params_st {
unsigned int odm_capable; unsigned int odm_capable;
unsigned int rob_buffer_size_kbytes; unsigned int rob_buffer_size_kbytes;
unsigned int det_buffer_size_kbytes; unsigned int det_buffer_size_kbytes;
unsigned int min_comp_buffer_size_kbytes;
unsigned int dpte_buffer_size_in_pte_reqs_luma; unsigned int dpte_buffer_size_in_pte_reqs_luma;
unsigned int dpte_buffer_size_in_pte_reqs_chroma; unsigned int dpte_buffer_size_in_pte_reqs_chroma;
unsigned int pde_proc_buffer_size_64k_reqs; unsigned int pde_proc_buffer_size_64k_reqs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment