]> www.infradead.org Git - users/hch/configfs.git/commitdiff
drm/amd/display: Improve FAM control for DCN401
authorRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Mon, 29 Jul 2024 17:59:25 +0000 (11:59 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 13 Aug 2024 14:51:45 +0000 (10:51 -0400)
[why & how]
When the commit 5324e2b205a2 ("drm/amd/display: Add driver support for
future FAMS versions") was introduced, it missed some of the FAM2 code.
This commit introduces the code that control the FAM enable and disable.

Fixes: 5324e2b205a2 ("drm/amd/display: Add driver support for future FAMS versions")
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c

index 6a40b2e2beb5fa35e557e45c5ea0d09572d33b66..a36e11606f90e35ea929028f46741cf01a769012 100644 (file)
@@ -985,8 +985,19 @@ void dcn32_init_hw(struct dc *dc)
                dc->caps.dmub_caps.gecc_enable = dc->ctx->dmub_srv->dmub->feature_caps.gecc_enable;
                dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch_ver;
 
-               if (dc->ctx->dmub_srv->dmub->fw_version <
+               /* for DCN401 testing only */
+               dc->caps.dmub_caps.fams_ver = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch_ver;
+               if (dc->caps.dmub_caps.fams_ver == 2) {
+                       /* FAMS2 is enabled */
+                       dc->debug.fams2_config.bits.enable &= true;
+               } else if (dc->ctx->dmub_srv->dmub->fw_version <
                                DMUB_FW_VERSION(7, 0, 35)) {
+                       /* FAMS2 is disabled */
+                       dc->debug.fams2_config.bits.enable = false;
+                       if (dc->debug.using_dml2 && dc->res_pool->funcs->update_bw_bounding_box) {
+                               /* update bounding box if FAMS2 disabled */
+                               dc->res_pool->funcs->update_bw_bounding_box(dc, dc->clk_mgr->bw_params);
+                       }
                        dc->debug.force_disable_subvp = true;
                        dc->debug.disable_fpo_optimizations = true;
                }