Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4dff470b authored by Saurabh Shah's avatar Saurabh Shah
Browse files

msm: mdss: Do not return error on same autorefresh settings



If userspace tries to set the same autorefresh enable value as before
do not return an error, since it is not, and bail out silently.

Change-Id: If2699817dc5cb06dd8182e5125c1ae868c925ddf
Signed-off-by: default avatarSaurabh Shah <saurshah@codeaurora.org>
parent 41747adc
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -2911,22 +2911,11 @@ static inline int mdss_validate_autorefresh_param(struct mdss_mdp_ctl *ctl,
{
	int rc = 0;

	if (frame_cnt == ctl->autorefresh_frame_cnt) {
		rc = -EINVAL;
		pr_debug("No change to autorefresh parameters\n");
		goto exit;
	}

	if (frame_cnt < 0 || frame_cnt >= BIT(16)) {
		rc = -EINVAL;
		pr_err("frame cnt %d is out of range (16 bits).\n", frame_cnt);
		goto exit;
	}

	pr_debug("Setting autorefresh_enable=%d frame_cnt=%d\n",
		ctl->cmd_autorefresh_en, frame_cnt);

exit:
	return rc;
}

@@ -2961,7 +2950,7 @@ static ssize_t mdss_mdp_cmd_autorefresh_store(struct device *dev,
	if (rc) {
		pr_err("kstrtoint failed. rc=%d\n", rc);
		return rc;
	} else {
	} else if (frame_cnt != ctl->autorefresh_frame_cnt) {
		rc = mdss_validate_autorefresh_param(ctl, frame_cnt);
		if (rc)
			return rc;