mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 12:44:32 -04:00
drm/amd/display: Enable Request rate limiter during C-State on dcn401
[WHY] When C-State entry is requested, the rate limiter will be disabled which can result in high contention in the DCHUB return path. [HOW] Enable the rate limiter during C-state requests to prevent contention. Cc: stable@vger.kernel.org # 6.11+ Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Signed-off-by: Dillon Varone <dillon.varone@amd.com> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
27227a234c
commit
89713ce551
@@ -11,6 +11,7 @@
|
||||
|
||||
#define DML2_MAX_FMT_420_BUFFER_WIDTH 4096
|
||||
#define DML_MAX_NUM_OF_SLICES_PER_DSC 4
|
||||
#define ALLOW_SDPIF_RATE_LIMIT_PRE_CSTATE
|
||||
|
||||
const char *dml2_core_internal_bw_type_str(enum dml2_core_internal_bw_type bw_type)
|
||||
{
|
||||
@@ -3886,6 +3887,10 @@ static void CalculateSwathAndDETConfiguration(struct dml2_core_internal_scratch
|
||||
#endif
|
||||
|
||||
*p->hw_debug5 = false;
|
||||
#ifdef ALLOW_SDPIF_RATE_LIMIT_PRE_CSTATE
|
||||
if (p->NumberOfActiveSurfaces > 1)
|
||||
*p->hw_debug5 = true;
|
||||
#else
|
||||
for (unsigned int k = 0; k < p->NumberOfActiveSurfaces; ++k) {
|
||||
if (!(p->mrq_present) && (!(*p->UnboundedRequestEnabled)) && (TotalActiveDPP == 1)
|
||||
&& p->display_cfg->plane_descriptors[k].surface.dcc.enable
|
||||
@@ -3901,6 +3906,7 @@ static void CalculateSwathAndDETConfiguration(struct dml2_core_internal_scratch
|
||||
dml2_printf("DML::%s: k=%u hw_debug5 = %u\n", __func__, k, *p->hw_debug5);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static enum dml2_odm_mode DecideODMMode(unsigned int HActive,
|
||||
|
||||
@@ -200,6 +200,7 @@ struct dcn_hubbub_registers {
|
||||
uint32_t DCHUBBUB_ARB_FRAC_URG_BW_MALL_B;
|
||||
uint32_t DCHUBBUB_TIMEOUT_DETECTION_CTRL1;
|
||||
uint32_t DCHUBBUB_TIMEOUT_DETECTION_CTRL2;
|
||||
uint32_t DCHUBBUB_CTRL_STATUS;
|
||||
};
|
||||
|
||||
#define HUBBUB_REG_FIELD_LIST_DCN32(type) \
|
||||
@@ -320,7 +321,12 @@ struct dcn_hubbub_registers {
|
||||
type DCHUBBUB_TIMEOUT_REQ_STALL_THRESHOLD;\
|
||||
type DCHUBBUB_TIMEOUT_PSTATE_STALL_THRESHOLD;\
|
||||
type DCHUBBUB_TIMEOUT_DETECTION_EN;\
|
||||
type DCHUBBUB_TIMEOUT_TIMER_RESET
|
||||
type DCHUBBUB_TIMEOUT_TIMER_RESET;\
|
||||
type ROB_UNDERFLOW_STATUS;\
|
||||
type ROB_OVERFLOW_STATUS;\
|
||||
type ROB_OVERFLOW_CLEAR;\
|
||||
type DCHUBBUB_HW_DEBUG;\
|
||||
type CSTATE_SWATH_CHK_GOOD_MODE
|
||||
|
||||
#define HUBBUB_STUTTER_REG_FIELD_LIST(type) \
|
||||
type DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_A;\
|
||||
|
||||
@@ -96,6 +96,7 @@ struct dcn20_hubbub {
|
||||
unsigned int det1_size;
|
||||
unsigned int det2_size;
|
||||
unsigned int det3_size;
|
||||
bool allow_sdpif_rate_limit_when_cstate_req;
|
||||
};
|
||||
|
||||
void hubbub2_construct(struct dcn20_hubbub *hubbub,
|
||||
|
||||
@@ -1192,15 +1192,35 @@ static void dcn401_wait_for_det_update(struct hubbub *hubbub, int hubp_inst)
|
||||
}
|
||||
}
|
||||
|
||||
static void dcn401_program_timeout_thresholds(struct hubbub *hubbub, struct dml2_display_arb_regs *arb_regs)
|
||||
static bool dcn401_program_arbiter(struct hubbub *hubbub, struct dml2_display_arb_regs *arb_regs, bool safe_to_lower)
|
||||
{
|
||||
struct dcn20_hubbub *hubbub2 = TO_DCN20_HUBBUB(hubbub);
|
||||
|
||||
bool wm_pending = false;
|
||||
uint32_t temp;
|
||||
|
||||
/* request backpressure and outstanding return threshold (unused)*/
|
||||
//REG_UPDATE(DCHUBBUB_TIMEOUT_DETECTION_CTRL1, DCHUBBUB_TIMEOUT_REQ_STALL_THRESHOLD, arb_regs->req_stall_threshold);
|
||||
|
||||
/* P-State stall threshold */
|
||||
REG_UPDATE(DCHUBBUB_TIMEOUT_DETECTION_CTRL2, DCHUBBUB_TIMEOUT_PSTATE_STALL_THRESHOLD, arb_regs->pstate_stall_threshold);
|
||||
|
||||
if (safe_to_lower || arb_regs->allow_sdpif_rate_limit_when_cstate_req > hubbub2->allow_sdpif_rate_limit_when_cstate_req) {
|
||||
hubbub2->allow_sdpif_rate_limit_when_cstate_req = arb_regs->allow_sdpif_rate_limit_when_cstate_req;
|
||||
|
||||
/* only update the required bits */
|
||||
REG_GET(DCHUBBUB_CTRL_STATUS, DCHUBBUB_HW_DEBUG, &temp);
|
||||
if (hubbub2->allow_sdpif_rate_limit_when_cstate_req) {
|
||||
temp |= (1 << 5);
|
||||
} else {
|
||||
temp &= ~(1 << 5);
|
||||
}
|
||||
REG_UPDATE(DCHUBBUB_CTRL_STATUS, DCHUBBUB_HW_DEBUG, temp);
|
||||
} else {
|
||||
wm_pending = true;
|
||||
}
|
||||
|
||||
return wm_pending;
|
||||
}
|
||||
|
||||
static const struct hubbub_funcs hubbub4_01_funcs = {
|
||||
@@ -1226,7 +1246,7 @@ static const struct hubbub_funcs hubbub4_01_funcs = {
|
||||
.program_det_segments = dcn401_program_det_segments,
|
||||
.program_compbuf_segments = dcn401_program_compbuf_segments,
|
||||
.wait_for_det_update = dcn401_wait_for_det_update,
|
||||
.program_timeout_thresholds = dcn401_program_timeout_thresholds,
|
||||
.program_arbiter = dcn401_program_arbiter,
|
||||
};
|
||||
|
||||
void hubbub401_construct(struct dcn20_hubbub *hubbub2,
|
||||
|
||||
@@ -128,7 +128,12 @@
|
||||
HUBBUB_SF(DCHUBBUB_TIMEOUT_DETECTION_CTRL1, DCHUBBUB_TIMEOUT_REQ_STALL_THRESHOLD, mask_sh),\
|
||||
HUBBUB_SF(DCHUBBUB_TIMEOUT_DETECTION_CTRL2, DCHUBBUB_TIMEOUT_PSTATE_STALL_THRESHOLD, mask_sh),\
|
||||
HUBBUB_SF(DCHUBBUB_TIMEOUT_DETECTION_CTRL2, DCHUBBUB_TIMEOUT_DETECTION_EN, mask_sh),\
|
||||
HUBBUB_SF(DCHUBBUB_TIMEOUT_DETECTION_CTRL2, DCHUBBUB_TIMEOUT_TIMER_RESET, mask_sh)
|
||||
HUBBUB_SF(DCHUBBUB_TIMEOUT_DETECTION_CTRL2, DCHUBBUB_TIMEOUT_TIMER_RESET, mask_sh),\
|
||||
HUBBUB_SF(DCHUBBUB_CTRL_STATUS, ROB_UNDERFLOW_STATUS, mask_sh),\
|
||||
HUBBUB_SF(DCHUBBUB_CTRL_STATUS, ROB_OVERFLOW_STATUS, mask_sh),\
|
||||
HUBBUB_SF(DCHUBBUB_CTRL_STATUS, ROB_OVERFLOW_CLEAR, mask_sh),\
|
||||
HUBBUB_SF(DCHUBBUB_CTRL_STATUS, DCHUBBUB_HW_DEBUG, mask_sh),\
|
||||
HUBBUB_SF(DCHUBBUB_CTRL_STATUS, CSTATE_SWATH_CHK_GOOD_MODE, mask_sh)
|
||||
|
||||
bool hubbub401_program_urgent_watermarks(
|
||||
struct hubbub *hubbub,
|
||||
|
||||
@@ -1488,6 +1488,10 @@ void dcn401_prepare_bandwidth(struct dc *dc,
|
||||
&context->bw_ctx.bw.dcn.watermarks,
|
||||
dc->res_pool->ref_clocks.dchub_ref_clock_inKhz / 1000,
|
||||
false);
|
||||
/* update timeout thresholds */
|
||||
if (hubbub->funcs->program_arbiter) {
|
||||
dc->wm_optimized_required |= hubbub->funcs->program_arbiter(hubbub, &context->bw_ctx.bw.dcn.arb_regs, false);
|
||||
}
|
||||
|
||||
/* decrease compbuf size */
|
||||
if (hubbub->funcs->program_compbuf_segments) {
|
||||
@@ -1529,6 +1533,10 @@ void dcn401_optimize_bandwidth(
|
||||
&context->bw_ctx.bw.dcn.watermarks,
|
||||
dc->res_pool->ref_clocks.dchub_ref_clock_inKhz / 1000,
|
||||
true);
|
||||
/* update timeout thresholds */
|
||||
if (hubbub->funcs->program_arbiter) {
|
||||
hubbub->funcs->program_arbiter(hubbub, &context->bw_ctx.bw.dcn.arb_regs, true);
|
||||
}
|
||||
|
||||
if (dc->clk_mgr->dc_mode_softmax_enabled)
|
||||
if (dc->clk_mgr->clks.dramclk_khz > dc->clk_mgr->bw_params->dc_mode_softmax_memclk * 1000 &&
|
||||
@@ -1554,11 +1562,6 @@ void dcn401_optimize_bandwidth(
|
||||
pipe_ctx->dlg_regs.min_dst_y_next_start);
|
||||
}
|
||||
}
|
||||
|
||||
/* update timeout thresholds */
|
||||
if (hubbub->funcs->program_timeout_thresholds) {
|
||||
hubbub->funcs->program_timeout_thresholds(hubbub, &context->bw_ctx.bw.dcn.arb_regs);
|
||||
}
|
||||
}
|
||||
|
||||
void dcn401_fams2_global_control_lock(struct dc *dc,
|
||||
|
||||
@@ -228,7 +228,7 @@ struct hubbub_funcs {
|
||||
void (*program_det_segments)(struct hubbub *hubbub, int hubp_inst, unsigned det_buffer_size_seg);
|
||||
void (*program_compbuf_segments)(struct hubbub *hubbub, unsigned compbuf_size_seg, bool safe_to_increase);
|
||||
void (*wait_for_det_update)(struct hubbub *hubbub, int hubp_inst);
|
||||
void (*program_timeout_thresholds)(struct hubbub *hubbub, struct dml2_display_arb_regs *arb_regs);
|
||||
bool (*program_arbiter)(struct hubbub *hubbub, struct dml2_display_arb_regs *arb_regs, bool safe_to_lower);
|
||||
};
|
||||
|
||||
struct hubbub {
|
||||
|
||||
@@ -612,7 +612,8 @@ void dcn401_prepare_mcache_programming(struct dc *dc, struct dc_state *context);
|
||||
SR(DCHUBBUB_SDPIF_CFG1), \
|
||||
SR(DCHUBBUB_MEM_PWR_MODE_CTRL), \
|
||||
SR(DCHUBBUB_TIMEOUT_DETECTION_CTRL1), \
|
||||
SR(DCHUBBUB_TIMEOUT_DETECTION_CTRL2)
|
||||
SR(DCHUBBUB_TIMEOUT_DETECTION_CTRL2), \
|
||||
SR(DCHUBBUB_CTRL_STATUS)
|
||||
|
||||
/* DCCG */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user