]> git.dujemihanovic.xyz Git - linux.git/commitdiff
drm/amd/display: Limit DCN32 8 channel or less parts to DPM1 for FPO
authorAlvin Lee <Alvin.Lee2@amd.com>
Mon, 10 Apr 2023 18:37:27 +0000 (14:37 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 24 Apr 2023 22:36:45 +0000 (18:36 -0400)
- Due to hardware related QoS issues, we need to limit certain
  SKUs with less memory channels to DPM1 and above.
- At DPM0 + workload running, the urgent return latency can
  exceed 15us (the expected maximum is 4us) which results in underflow

Cc: stable@vger.kernel.org
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Saaem Rizvi <SyedSaaem.Rizvi@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h

index 4f8286ae699b03269a9d3c5fb8dc32c60d0231d5..0085ea78ea317a92da915f8d7faa35556e212c88 100644 (file)
@@ -1888,6 +1888,8 @@ bool dcn32_validate_bandwidth(struct dc *dc,
 
        dc->res_pool->funcs->calculate_wm_and_dlg(dc, context, pipes, pipe_cnt, vlevel);
 
+       dcn32_override_min_req_memclk(dc, context);
+
        BW_VAL_TRACE_END_WATERMARKS();
 
        goto validate_out;
index b8a2518faecc72fb4627167d88acfdd8a6cee519..ed7ea4c42412b58db18137bb5fed6202614a47a2 100644 (file)
@@ -2887,3 +2887,18 @@ void dcn32_set_clock_limits(const struct _vcs_dpi_soc_bounding_box_st *soc_bb)
        dc_assert_fp_enabled();
        dcn3_2_soc.clock_limits[0].dcfclk_mhz = 1200.0;
 }
+
+void dcn32_override_min_req_memclk(struct dc *dc, struct dc_state *context)
+{
+       // WA: restrict FPO and SubVP to use first non-strobe mode (DCN32 BW issue)
+       if ((context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || dcn32_subvp_in_use(dc, context)) &&
+                       dc->dml.soc.num_chans <= 8) {
+               int num_mclk_levels = dc->clk_mgr->bw_params->clk_table.num_entries_per_clk.num_memclk_levels;
+
+               if (context->bw_ctx.dml.vba.DRAMSpeed <= dc->clk_mgr->bw_params->clk_table.entries[0].memclk_mhz * 16 &&
+                               num_mclk_levels > 1) {
+                       context->bw_ctx.dml.vba.DRAMSpeed = dc->clk_mgr->bw_params->clk_table.entries[1].memclk_mhz * 16;
+                       context->bw_ctx.bw.dcn.clk.dramclk_khz = context->bw_ctx.dml.vba.DRAMSpeed * 1000 / 16;
+               }
+       }
+}
index dcf512cd30721645033a86dae9be51ed44d7aa16..a4206b71d650a99c24f7c543972618132f67aaca 100644 (file)
@@ -80,6 +80,8 @@ void dcn32_assign_fpo_vactive_candidate(struct dc *dc, const struct dc_state *co
 
 bool dcn32_find_vactive_pipe(struct dc *dc, const struct dc_state *context, uint32_t vactive_margin_req);
 
+void dcn32_override_min_req_memclk(struct dc *dc, struct dc_state *context);
+
 void dcn32_set_clock_limits(const struct _vcs_dpi_soc_bounding_box_st *soc_bb);
 
 #endif