Commit 6b85151f authored by Martin Leung's avatar Martin Leung Committed by Alex Deucher

drm/amd/display: adding pathway to retrieve stutter period

why:
some functions may need be dependent on stutter period in the future

how:
Extract from stutter calculations and place into perf_params structure
Signed-off-by: default avatarMartin Leung <martin.leung@amd.com>
Acked-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6b29bb37
...@@ -2210,6 +2210,9 @@ static void dcn30_calculate_wm( ...@@ -2210,6 +2210,9 @@ static void dcn30_calculate_wm(
context->bw_ctx.bw.dcn.watermarks.a.frac_urg_bw_flip = get_fraction_of_urgent_bandwidth_imm_flip(&context->bw_ctx.dml, pipes, pipe_cnt) * 1000; context->bw_ctx.bw.dcn.watermarks.a.frac_urg_bw_flip = get_fraction_of_urgent_bandwidth_imm_flip(&context->bw_ctx.dml, pipes, pipe_cnt) * 1000;
context->bw_ctx.bw.dcn.watermarks.a.urgent_latency_ns = get_urgent_latency(&context->bw_ctx.dml, pipes, pipe_cnt) * 1000; context->bw_ctx.bw.dcn.watermarks.a.urgent_latency_ns = get_urgent_latency(&context->bw_ctx.dml, pipes, pipe_cnt) * 1000;
context->perf_params.stutter_period_us =
context->bw_ctx.dml.vba.StutterPeriod;
for (i = 0, pipe_idx = 0; i < dc->res_pool->pipe_count; i++) { for (i = 0, pipe_idx = 0; i < dc->res_pool->pipe_count; i++) {
if (!context->res_ctx.pipe_ctx[i].stream) if (!context->res_ctx.pipe_ctx[i].stream)
continue; continue;
......
...@@ -597,7 +597,8 @@ static void CalculateStutterEfficiency( ...@@ -597,7 +597,8 @@ static void CalculateStutterEfficiency(
double meta_row_bw[], double meta_row_bw[],
double dpte_row_bw[], double dpte_row_bw[],
double *StutterEfficiencyNotIncludingVBlank, double *StutterEfficiencyNotIncludingVBlank,
double *StutterEfficiency); double *StutterEfficiency,
double *StutterPeriodOut);
static void CalculateSwathAndDETConfiguration( static void CalculateSwathAndDETConfiguration(
bool ForceSingleDPP, bool ForceSingleDPP,
...@@ -3134,7 +3135,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman ...@@ -3134,7 +3135,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
v->meta_row_bw, v->meta_row_bw,
v->dpte_row_bw, v->dpte_row_bw,
&v->StutterEfficiencyNotIncludingVBlank, &v->StutterEfficiencyNotIncludingVBlank,
&v->StutterEfficiency); &v->StutterEfficiency,
&v->StutterPeriod);
} }
static void DisplayPipeConfiguration(struct display_mode_lib *mode_lib) static void DisplayPipeConfiguration(struct display_mode_lib *mode_lib)
...@@ -6151,7 +6153,8 @@ static void CalculateStutterEfficiency( ...@@ -6151,7 +6153,8 @@ static void CalculateStutterEfficiency(
double meta_row_bw[], double meta_row_bw[],
double dpte_row_bw[], double dpte_row_bw[],
double *StutterEfficiencyNotIncludingVBlank, double *StutterEfficiencyNotIncludingVBlank,
double *StutterEfficiency) double *StutterEfficiency,
double *StutterPeriodOut)
{ {
double FullDETBufferingTimeY[DC__NUM_DPP__MAX] = { 0 }; double FullDETBufferingTimeY[DC__NUM_DPP__MAX] = { 0 };
double FrameTimeForMinFullDETBufferingTime = 0; double FrameTimeForMinFullDETBufferingTime = 0;
...@@ -6262,6 +6265,9 @@ static void CalculateStutterEfficiency( ...@@ -6262,6 +6265,9 @@ static void CalculateStutterEfficiency(
} }
*StutterEfficiency = (*StutterEfficiencyNotIncludingVBlank / 100.0 * (FrameTimeForMinFullDETBufferingTime - SmallestVBlank) + SmallestVBlank) / FrameTimeForMinFullDETBufferingTime * 100; *StutterEfficiency = (*StutterEfficiencyNotIncludingVBlank / 100.0 * (FrameTimeForMinFullDETBufferingTime - SmallestVBlank) + SmallestVBlank) / FrameTimeForMinFullDETBufferingTime * 100;
if (StutterPeriodOut)
*StutterPeriodOut = StutterPeriod;
} }
static void CalculateSwathAndDETConfiguration( static void CalculateSwathAndDETConfiguration(
......
...@@ -411,6 +411,10 @@ struct dc_state { ...@@ -411,6 +411,10 @@ struct dc_state {
struct clk_mgr *clk_mgr; struct clk_mgr *clk_mgr;
struct kref refcount; struct kref refcount;
struct {
unsigned int stutter_period_us;
} perf_params;
}; };
#endif /* _CORE_TYPES_H_ */ #endif /* _CORE_TYPES_H_ */
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