drm/amd/display: Fix sending redundant enable command to dmub

[WHY & HOW]
Fix sending repeating PR enable/disable command to dmub
which causing performance problem

Reviewed-by: Robin Chen <robin.chen@amd.com>
Signed-off-by: Jack Chang <jack.chang@amd.com>
Signed-off-by: Leon Huang <Leon.Huang1@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Jack Chang 2025-09-17 15:51:40 +08:00 committed by Alex Deucher
parent ca4310e86b
commit 6d76189a84

View File

@ -1313,16 +1313,20 @@ bool edp_pr_enable(struct dc_link *link, bool enable)
if (!dc_get_edp_link_panel_inst(dc, link, &panel_inst))
return false;
//for sending PR enable commands to DMUB
memset(&cmd, 0, sizeof(cmd));
if (link->replay_settings.replay_allow_active != enable) {
//for sending PR enable commands to DMUB
memset(&cmd, 0, sizeof(cmd));
cmd.pr_enable.header.type = DMUB_CMD__PR;
cmd.pr_enable.header.sub_type = DMUB_CMD__PR_ENABLE;
cmd.pr_enable.header.payload_bytes = sizeof(struct dmub_cmd_pr_enable_data);
cmd.pr_enable.data.panel_inst = panel_inst;
cmd.pr_enable.data.enable = enable ? 1 : 0;
cmd.pr_enable.header.type = DMUB_CMD__PR;
cmd.pr_enable.header.sub_type = DMUB_CMD__PR_ENABLE;
cmd.pr_enable.header.payload_bytes = sizeof(struct dmub_cmd_pr_enable_data);
cmd.pr_enable.data.panel_inst = panel_inst;
cmd.pr_enable.data.enable = enable ? 1 : 0;
dc_wake_and_execute_dmub_cmd(dc->ctx, &cmd, DM_DMUB_WAIT_TYPE_WAIT);
dc_wake_and_execute_dmub_cmd(dc->ctx, &cmd, DM_DMUB_WAIT_TYPE_WAIT);
link->replay_settings.replay_allow_active = enable;
}
return true;
}