Commit 85e148fb authored by Tony Cheng's avatar Tony Cheng Committed by Alex Deucher

drm/amd/display: fix workaround for incorrect double buffer register for DLG ADL and TTU

[Why]
these registers should have been double buffered. SW workaround we will have SW program the more aggressive (lower) values
whenever we are upating this register, so we will not have underflow at expense of less optimzal request pattern.

[How]
there is a driver bug where we don't check for 0, which is uninitialzed HW default.  since 0 is smaller than any value we need to program,
driver end up with not programming these registers
Signed-off-by: default avatarTony Cheng <tony.cheng@amd.com>
Reviewed-by: default avatarYongqiang Sun <yongqiang.sun@amd.com>
Acked-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 96577cf8
...@@ -79,32 +79,47 @@ void apply_DEDCN21_142_wa_for_hostvm_deadline( ...@@ -79,32 +79,47 @@ void apply_DEDCN21_142_wa_for_hostvm_deadline(
struct _vcs_dpi_display_dlg_regs_st *dlg_attr) struct _vcs_dpi_display_dlg_regs_st *dlg_attr)
{ {
struct dcn21_hubp *hubp21 = TO_DCN21_HUBP(hubp); struct dcn21_hubp *hubp21 = TO_DCN21_HUBP(hubp);
uint32_t cur_value; uint32_t refcyc_per_vm_group_vblank;
uint32_t refcyc_per_vm_req_vblank;
uint32_t refcyc_per_vm_group_flip;
uint32_t refcyc_per_vm_req_flip;
const uint32_t uninitialized_hw_default = 0;
REG_GET(VBLANK_PARAMETERS_5, REFCYC_PER_VM_GROUP_VBLANK, &cur_value); REG_GET(VBLANK_PARAMETERS_5,
if (cur_value > dlg_attr->refcyc_per_vm_group_vblank) REFCYC_PER_VM_GROUP_VBLANK, &refcyc_per_vm_group_vblank);
if (refcyc_per_vm_group_vblank == uninitialized_hw_default ||
refcyc_per_vm_group_vblank > dlg_attr->refcyc_per_vm_group_vblank)
REG_SET(VBLANK_PARAMETERS_5, 0, REG_SET(VBLANK_PARAMETERS_5, 0,
REFCYC_PER_VM_GROUP_VBLANK, dlg_attr->refcyc_per_vm_group_vblank); REFCYC_PER_VM_GROUP_VBLANK, dlg_attr->refcyc_per_vm_group_vblank);
REG_GET(VBLANK_PARAMETERS_6, REG_GET(VBLANK_PARAMETERS_6,
REFCYC_PER_VM_REQ_VBLANK, REFCYC_PER_VM_REQ_VBLANK, &refcyc_per_vm_req_vblank);
&cur_value);
if (cur_value > dlg_attr->refcyc_per_vm_req_vblank) if (refcyc_per_vm_req_vblank == uninitialized_hw_default ||
refcyc_per_vm_req_vblank > dlg_attr->refcyc_per_vm_req_vblank)
REG_SET(VBLANK_PARAMETERS_6, 0, REG_SET(VBLANK_PARAMETERS_6, 0,
REFCYC_PER_VM_REQ_VBLANK, dlg_attr->refcyc_per_vm_req_vblank); REFCYC_PER_VM_REQ_VBLANK, dlg_attr->refcyc_per_vm_req_vblank);
REG_GET(FLIP_PARAMETERS_3, REFCYC_PER_VM_GROUP_FLIP, &cur_value); REG_GET(FLIP_PARAMETERS_3,
if (cur_value > dlg_attr->refcyc_per_vm_group_flip) REFCYC_PER_VM_GROUP_FLIP, &refcyc_per_vm_group_flip);
if (refcyc_per_vm_group_flip == uninitialized_hw_default ||
refcyc_per_vm_group_flip > dlg_attr->refcyc_per_vm_group_flip)
REG_SET(FLIP_PARAMETERS_3, 0, REG_SET(FLIP_PARAMETERS_3, 0,
REFCYC_PER_VM_GROUP_FLIP, dlg_attr->refcyc_per_vm_group_flip); REFCYC_PER_VM_GROUP_FLIP, dlg_attr->refcyc_per_vm_group_flip);
REG_GET(FLIP_PARAMETERS_4, REFCYC_PER_VM_REQ_FLIP, &cur_value); REG_GET(FLIP_PARAMETERS_4,
if (cur_value > dlg_attr->refcyc_per_vm_req_flip) REFCYC_PER_VM_REQ_FLIP, &refcyc_per_vm_req_flip);
if (refcyc_per_vm_req_flip == uninitialized_hw_default ||
refcyc_per_vm_req_flip > dlg_attr->refcyc_per_vm_req_flip)
REG_SET(FLIP_PARAMETERS_4, 0, REG_SET(FLIP_PARAMETERS_4, 0,
REFCYC_PER_VM_REQ_FLIP, dlg_attr->refcyc_per_vm_req_flip); REFCYC_PER_VM_REQ_FLIP, dlg_attr->refcyc_per_vm_req_flip);
REG_SET(FLIP_PARAMETERS_5, 0, REG_SET(FLIP_PARAMETERS_5, 0,
REFCYC_PER_PTE_GROUP_FLIP_C, dlg_attr->refcyc_per_pte_group_flip_c); REFCYC_PER_PTE_GROUP_FLIP_C, dlg_attr->refcyc_per_pte_group_flip_c);
REG_SET(FLIP_PARAMETERS_6, 0, REG_SET(FLIP_PARAMETERS_6, 0,
REFCYC_PER_META_CHUNK_FLIP_C, dlg_attr->refcyc_per_meta_chunk_flip_c); REFCYC_PER_META_CHUNK_FLIP_C, dlg_attr->refcyc_per_meta_chunk_flip_c);
} }
......
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