Commit aef320b0 authored by Peichen Huang's avatar Peichen Huang Committed by Alex Deucher
Browse files

drm/amd/display: Return early from vesa replay enable function



[WHY & HOW]
If the enable state is already as expect then just return.

Reviewed-by: default avatarRobin Chen <robin.chen@amd.com>
Reviewed-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Signed-off-by: default avatarPeichen Huang <PeiChen.Huang@amd.com>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Tested-by: default avatarDan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6cafbc18
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -252,10 +252,12 @@ bool dp_pr_enable(struct dc_link *link, bool enable)
	if (!dp_pr_get_panel_inst(dc, link, &panel_inst))
		return false;

	if (link->replay_settings.replay_allow_active == enable)
		return true;

	if (enable && !dc_is_embedded_signal(link->connector_signal))
		dp_pr_set_static_screen_param(link);

	if (link->replay_settings.replay_allow_active != enable) {
	// for sending PR enable commands to DMUB
	memset(&cmd, 0, sizeof(cmd));

@@ -264,11 +266,10 @@ bool dp_pr_enable(struct dc_link *link, bool 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);

	link->replay_settings.replay_allow_active = enable;
	}

	return true;
}