drm/amd/display: Set minimum requirement for using PSR-SU on Rembrandt
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 23 Jun 2023 15:05:20 +0000 (10:05 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 30 Jun 2023 17:11:36 +0000 (13:11 -0400)
A number of parade TCONs are causing system hangs when utilized with
older DMUB firmware and PSR-SU. Some changes have been introduced into
DMUB firmware to add resilience against these failures.

Don't allow running PSR-SU unless on the newer firmware.

Cc: stable@vger.kernel.org
Cc: Sean Wang <sean.ns.wang@amd.com>
Cc: Marc Rossi <Marc.Rossi@amd.com>
Cc: Hamza Mahfooz <Hamza.Mahfooz@amd.com>
Cc: Tsung-hua (Ryan) Lin <Tsung-hua.Lin@amd.com>
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2443
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h
drivers/gpu/drm/amd/display/dmub/dmub_srv.h
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.h
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c

index d647f68fd5630e9609c27dabe2890f6776ef821a..4f61d4f257cd7a908fcbfaeae9540451ec6111b0 100644 (file)
@@ -24,6 +24,7 @@
  */
 
 #include "amdgpu_dm_psr.h"
+#include "dc_dmub_srv.h"
 #include "dc.h"
 #include "dm_helpers.h"
 #include "amdgpu_dm.h"
@@ -50,7 +51,7 @@ static bool link_supports_psrsu(struct dc_link *link)
            !link->dpcd_caps.psr_info.psr2_su_y_granularity_cap)
                return false;
 
-       return true;
+       return dc_dmub_check_min_version(dc->ctx->dmub_srv->dmub);
 }
 
 /*
index c52c40b1638722e10a4703de3e808eca0d83a919..c753c6f30dd71445fc9476e41d20985b366f27ff 100644 (file)
@@ -1011,3 +1011,10 @@ void dc_send_update_cursor_info_to_dmu(
                dm_execute_dmub_cmd_list(pCtx->stream->ctx, 2, cmd, DM_DMUB_WAIT_TYPE_WAIT);
        }
 }
+
+bool dc_dmub_check_min_version(struct dmub_srv *srv)
+{
+       if (!srv->hw_funcs.is_psrsu_supported)
+               return true;
+       return srv->hw_funcs.is_psrsu_supported(srv);
+}
index a5196a9292b356576b4bc0ef596da76b45da26b7..099f94b6107cff21ff7958a704e9d9f13e81ac4f 100644 (file)
@@ -86,4 +86,5 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc, struct dc_state *context, b
 void dc_dmub_srv_log_diagnostic_data(struct dc_dmub_srv *dc_dmub_srv);
 
 void dc_send_update_cursor_info_to_dmu(struct pipe_ctx *pCtx, uint8_t pipe_idx);
+bool dc_dmub_check_min_version(struct dmub_srv *srv);
 #endif /* _DMUB_DC_SRV_H_ */
index 2a66a305679a1ce4688b7f4dd8bd1af8803ed2e4..4585e0419da615d2791401d9f8cd973d4b86426f 100644 (file)
@@ -367,6 +367,8 @@ struct dmub_srv_hw_funcs {
 
        bool (*is_supported)(struct dmub_srv *dmub);
 
+       bool (*is_psrsu_supported)(struct dmub_srv *dmub);
+
        bool (*is_hw_init)(struct dmub_srv *dmub);
 
        void (*enable_dmub_boot_options)(struct dmub_srv *dmub,
index ebf7aeec4029cb8a7b03bcf0c6a705a846990c1b..5e952541e72d5160edb6bd3eeae7356aebf8618e 100644 (file)
@@ -302,6 +302,11 @@ bool dmub_dcn31_is_supported(struct dmub_srv *dmub)
        return supported;
 }
 
+bool dmub_dcn31_is_psrsu_supported(struct dmub_srv *dmub)
+{
+       return dmub->fw_version >= DMUB_FW_VERSION(4, 0, 59);
+}
+
 void dmub_dcn31_set_gpint(struct dmub_srv *dmub,
                          union dmub_gpint_data_register reg)
 {
index 7d5c10ee539b413f4b4c34c52c3e30c92def6584..89c5a948b67d5c1228c4d73c7cd029902e5575c6 100644 (file)
@@ -221,6 +221,8 @@ bool dmub_dcn31_is_hw_init(struct dmub_srv *dmub);
 
 bool dmub_dcn31_is_supported(struct dmub_srv *dmub);
 
+bool dmub_dcn31_is_psrsu_supported(struct dmub_srv *dmub);
+
 void dmub_dcn31_set_gpint(struct dmub_srv *dmub,
                          union dmub_gpint_data_register reg);
 
index 9e9a6a44a7ac4b4a949a2e8261d21dd3f218a15a..7a31e3e27babb7c725bf8573baa750134318b61b 100644 (file)
@@ -226,14 +226,16 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic)
        case DMUB_ASIC_DCN314:
        case DMUB_ASIC_DCN315:
        case DMUB_ASIC_DCN316:
-               if (asic == DMUB_ASIC_DCN314)
+               if (asic == DMUB_ASIC_DCN314) {
                        dmub->regs_dcn31 = &dmub_srv_dcn314_regs;
-               else if (asic == DMUB_ASIC_DCN315)
+               } else if (asic == DMUB_ASIC_DCN315) {
                        dmub->regs_dcn31 = &dmub_srv_dcn315_regs;
-               else if (asic == DMUB_ASIC_DCN316)
+               } else if (asic == DMUB_ASIC_DCN316) {
                        dmub->regs_dcn31 = &dmub_srv_dcn316_regs;
-               else
+               } else {
                        dmub->regs_dcn31 = &dmub_srv_dcn31_regs;
+                       funcs->is_psrsu_supported = dmub_dcn31_is_psrsu_supported;
+               }
                funcs->reset = dmub_dcn31_reset;
                funcs->reset_release = dmub_dcn31_reset_release;
                funcs->backdoor_load = dmub_dcn31_backdoor_load;