From: Allen Li wei-guang.li@amd.com
[ Upstream commit b65cf4baeb24bdb5fee747679ee88f1ade5c1d6c ]
[Why&How] We need to inform DMUB whether fast sync in ultra sleep mode is supported, so that it can disable desync error detection when the it is not enabled. This helps prevent unexpected desync errors when transitioning out of ultra sleep mode.
Add fast sync in ultra sleep mode field in replay copy setting command.
Reviewed-by: Robin Chen robin.chen@amd.com Reviewed-by: Nicholas Kazlauskas nicholas.kazlauskas@amd.com Signed-off-by: Allen Li wei-guang.li@amd.com Signed-off-by: Ivan Lipski ivan.lipski@amd.com Tested-by: Dan Wheeler daniel.wheeler@amd.com Signed-off-by: Alex Deucher alexander.deucher@amd.com Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES - `amdgpu_dm_link_setup_replay()` already derives whether a panel can keep “fast resync” while in ultra-sleep (`drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_replay.c:136`), but until this change that information never left the driver. The DMUB firmware therefore had to assume the feature was always present, so on panels that cannot fast-resync it keeps desync error detection enabled and triggers the “unexpected desync errors” described in the commit message whenever the link wakes up. - The patch finally propagates that capability bit into the replay copy- settings command (`drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c:173`) and defines an explicit field for it in the DMUB command payload (`drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h:4148`). This lets updated firmware disable desync detection when fast resync is unavailable, eliminating the spurious error storms users are seeing on affected eDP panels. - The fix is tightly scoped, reuses a byte that used to be padding, and leaves the overall command size unchanged, so older firmware that ignores the extra byte continues to work while newer firmware benefits. There are no functional side effects beyond the bug fix, and every prerequisite (the capability flag and replay infrastructure) has been in stable releases for some time.
Given the real user impact, the minimal, self-contained change, and its compatibility with existing firmware, this is a solid candidate for stable backporting.
drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c | 1 + drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c index fcd3d86ad5173..727ce832b5bb8 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c @@ -168,6 +168,7 @@ static bool dmub_replay_copy_settings(struct dmub_replay *dmub, copy_settings_data->max_deviation_line = link->dpcd_caps.pr_info.max_deviation_line; copy_settings_data->smu_optimizations_en = link->replay_settings.replay_smu_opt_enable; copy_settings_data->replay_timing_sync_supported = link->replay_settings.config.replay_timing_sync_supported; + copy_settings_data->replay_support_fast_resync_in_ultra_sleep_mode = link->replay_settings.config.replay_support_fast_resync_in_ultra_sleep_mode;
copy_settings_data->debug.bitfields.enable_ips_visual_confirm = dc->dc->debug.enable_ips_visual_confirm;
diff --git a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h index 6fa25b0375858..5c9deb41ac7e6 100644 --- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h @@ -4104,10 +4104,14 @@ struct dmub_cmd_replay_copy_settings_data { * @hpo_link_enc_inst: HPO link encoder instance */ uint8_t hpo_link_enc_inst; + /** + * Determines if fast sync in ultra sleep mode is enabled/disabled. + */ + uint8_t replay_support_fast_resync_in_ultra_sleep_mode; /** * @pad: Align structure to 4 byte boundary. */ - uint8_t pad[2]; + uint8_t pad[1]; };
/**