Add checks for enabling PSR-SU
Subsystems (3)
v2 cover Add checks for enabling PSR-SU
There have been a number of field reports of hangs tied to PSR-SU specifically to Parade TCONs. These hangs are fixed by changes in DMCUB firmware for both Rembrandt and Phoenix. Add checks to ensure that PSR-SU is only enabled when the newer DMCUB firmware is present.
Mario Limonciello (4):
drm/amd/display: Correct DMUB_FW_VERSION macro drm/amd/display: Set minimum requirement for using PSR-SU on Rembrandt drm/amd/display: Set minimum requirement for using PSR-SU on Phoenix Revert "drm/amd: Disable PSR-SU on Parade 0803 TCON"
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 3 ++- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 7 +++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 1 + drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 4 +++- drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c | 5 +++++ drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.h | 2 ++ drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.c | 5 +++++ drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.h | 2 ++ drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 11 +++++++---- .../gpu/drm/amd/display/modules/power/power_helpers.c | 2 -- 10 files changed, 34 insertions(+), 8 deletions(-)
Signature · 1 line
2.34.1
PATCH v2 1/4 drm/amd/display: Correct `DMUB_FW_VERSION` macro
The DMUB_FW_VERSION macro has a mistake in that the revision field is off by one byte. The last byte is typically used for other purposes and not a revision.
--- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +1 -1
@@ -492,7 +492,7 @@ struct dmub_notification {* of a firmware to know if feature or functionality is supported or present. */ #define DMUB_FW_VERSION (major, minor, revision) \ - ((((major) & 0xFF) << 24) | (((minor) & 0xFF) << 16) | ((revision) & 0xFFFF)) + ((((major) & 0xFF) << 24) | (((minor) & 0xFF) << 16) | (((revision) & 0xFF) << 8))/** * dmub_srv_create() - creates the DMUB service.
Signature · 1 line
2.34.1
PATCH v2 2/4 drm/amd/display: Set minimum requirement for using PSR-SU on Rembrandt
In reply to Mario LimoncielloA 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.
---v1->v2:
* Fix a s/dcn314/dcn31/ mixup
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 3 ++- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 7 +++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 1 + drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 2 ++ drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c | 5 +++++ drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.h | 2 ++ drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 10 ++++++---- 7 files changed, 25 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +2 -1
@@ -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); }/*
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +7 -0
@@ -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); +}
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +1 -0
@@ -86,4 +86,5 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc, struct dc_state *context, bvoid 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_ */
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +2 -0
@@ -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,
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c +5 -0
@@ -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 ,58 ); +} +void dmub_dcn31_set_gpint (struct dmub_srv *dmub,union dmub_gpint_data_register reg) {
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.h +2 -0
@@ -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);
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +6 -4
@@ -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;
Signature · 1 line
2.34.1
Re: [PATCH v2 2/4] drm/amd/display: Set minimum requirement for using PSR-SU on Rembrandt
Quoted 4 lines · Mario Limonciello
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.
Quoted 8 lines
Don't allow running PSR-SU unless on the newer firmware.
Cc Sean Wang <[email protected]>Cc Marc Rossi <[email protected]>Cc Hamza Mahfooz <[email protected]>Cc Tsung-hua (Ryan) Lin <[email protected]>Signed-off-by Mario Limonciello <[email protected]>
Quoted 126 lines
---
v1->v2:
* Fix a s/dcn314/dcn31/ mixup--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 3 ++- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 7 +++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 1 + drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 2 ++ drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c | 5 +++++ drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.h | 2 ++ drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 10 ++++++---- 7 files changed, 25 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +2
-1@@ -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); }/* drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +7
-0@@ -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); +}drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +1
-0@@ -86,4 +86,5 @@ void dc_dmub_setup_subvp_dmub_command(struct dc *dc, struct dc_state *context, bvoid 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_ */ drivers/gpu/drm/amd/display/dmub/dmub_srv.h +2
-0@@ -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,drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c +5
-0@@ -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 ,58 ); +} +void dmub_dcn31_set_gpint (struct dmub_srv *dmub,union dmub_gpint_data_register reg) {drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.h +2
-0@@ -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);drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +6
-4@@ -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;
PATCH v2 3/4 drm/amd/display: Set minimum requirement for using PSR-SU on Phoenix
In reply to Mario LimoncielloThe same parade TCON issue can potentially happen on Phoenix, and the same PSR resilience changes have been ported into the DMUB firmware.
Don't allow running PSR-SU unless on the newer firmware.
---v1->v2:
* Fix a s/dcn31/dcn314/ mixup
--- drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.c | 5 +++++ drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.h | 2 ++ drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 1 + 3 files changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.c +5 -0
@@ -60,3 +60,8 @@ const struct dmub_srv_dcn31_regs dmub_srv_dcn314_regs = { { DMUB_DCN31_FIELDS() },#undef DMUB_SF }; + +bool dmub_dcn314_is_psrsu_supported (struct dmub_srv *dmub) +{ +return dmub->fw_version >=DMUB_FW_VERSION (8 ,0 ,16 ); +}
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.h +2 -0
@@ -30,4 +30,6 @@extern const struct dmub_srv_dcn31_regs dmub_srv_dcn314_regs; +bool dmub_dcn314_is_psrsu_supported (struct dmub_srv *dmub); +#endif /* _DMUB_DCN314_H_ */
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +1 -0
@@ -228,6 +228,7 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic)case DMUB_ASIC_DCN316 :if (asic ==DMUB_ASIC_DCN314 ) { dmub->regs_dcn31 = &dmub_srv_dcn314_regs; + funcs->is_psrsu_supported = dmub_dcn314_is_psrsu_supported; }else if (asic ==DMUB_ASIC_DCN315 ) { dmub->regs_dcn31 = &dmub_srv_dcn315_regs; }else if (asic ==DMUB_ASIC_DCN316 ) {
Signature · 1 line
2.34.1
Re: [PATCH v2 3/4] drm/amd/display: Set minimum requirement for using PSR-SU on Phoenix
Quoted 10 lines · Mario Limonciello
The same parade TCON issue can potentially happen on Phoenix, and the same PSR resilience changes have been ported into the DMUB firmware.
Don't allow running PSR-SU unless on the newer firmware.
Cc Sean Wang <[email protected]>Cc Marc Rossi <[email protected]>Cc Hamza Mahfooz <[email protected]>Cc Tsung-hua (Ryan) Lin <[email protected]>Signed-off-by Mario Limonciello <[email protected]>
Quoted 45 lines
---
v1->v2:
* Fix a s/dcn31/dcn314/ mixup--- drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.c | 5 +++++ drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.h | 2 ++ drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 1 + 3 files changed, 8 insertions(+)drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.c +5
-0@@ -60,3 +60,8 @@ const struct dmub_srv_dcn31_regs dmub_srv_dcn314_regs = { { DMUB_DCN31_FIELDS() },#undef DMUB_SF }; + +bool dmub_dcn314_is_psrsu_supported (struct dmub_srv *dmub) +{ +return dmub->fw_version >=DMUB_FW_VERSION (8 ,0 ,16 ); +}drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.h +2
-0@@ -30,4 +30,6 @@extern const struct dmub_srv_dcn31_regs dmub_srv_dcn314_regs; +bool dmub_dcn314_is_psrsu_supported (struct dmub_srv *dmub); +#endif /* _DMUB_DCN314_H_ */ drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +1
-0@@ -228,6 +228,7 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic)case DMUB_ASIC_DCN316 :if (asic ==DMUB_ASIC_DCN314 ) { dmub->regs_dcn31 = &dmub_srv_dcn314_regs; + funcs->is_psrsu_supported = dmub_dcn314_is_psrsu_supported; }else if (asic ==DMUB_ASIC_DCN315 ) { dmub->regs_dcn31 = &dmub_srv_dcn315_regs; }else if (asic ==DMUB_ASIC_DCN316 ) {
PATCH v2 4/4 Revert "drm/amd: Disable PSR-SU on Parade 0803 TCON"
In reply to Mario LimoncielloThis reverts commit 33eec907ce0eb50a56dca621aa7310f7fa904b93. This is no longer necessary when using newer DMUB F/W.
--- drivers/gpu/drm/amd/display/modules/power/power_helpers.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/display/modules/power/power_helpers.c +0 -2
@@ -839,8 +839,6 @@ bool is_psr_su_specific_panel(struct dc_link *link) ((dpcd_caps->sink_dev_id_str[1] == 0x08 && dpcd_caps->sink_dev_id_str[0] == 0x08) || (dpcd_caps->sink_dev_id_str[1] == 0x08 && dpcd_caps->sink_dev_id_str[0] == 0x07))) isPSRSUSupported = false; - else if (dpcd_caps->sink_dev_id_str[1] == 0x08 && dpcd_caps->sink_dev_id_str[0] == 0x03) - isPSRSUSupported = false; else if (dpcd_caps->psr_info.force_psrsu_cap == 0x1) isPSRSUSupported = true; }
Signature · 1 line
2.34.1