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

Commit 3722a596 authored by Krishna Chaitanya Parimi's avatar Krishna Chaitanya Parimi Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: Change histogram collect error in mdp3 to EPROTO



During suspend, histogram stop will be called from control off.
However userspace would not be aware that histogram has been
disabled and will continue to send ioctl calls for collection
of histogram. This causes repeated ioctl failures, so we now
return EPROTO as the error, so that userspace is made aware
that histograms have been halted in kernel. Userspace can
make use of this return value to prevent multiple calls to
collect histogram data after histogram block was turned off.

Change-Id: I85d4d46bca3b102286b474e7126e33b03a27503a
Signed-off-by: default avatarKrishna Chaitanya Parimi <cparimi@codeaurora.org>
parent dc75cd31
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -1347,6 +1347,7 @@ static int mdp3_histogram_stop(struct mdp3_session_data *session,
	mutex_lock(&session->histo_lock);

	if (!session->histo_status) {
		pr_debug("mdp3_histogram_stop already stopped!");
		ret = 0;
		goto histogram_stop_err;
	}
@@ -1376,21 +1377,21 @@ static int mdp3_histogram_collect(struct mdp3_session_data *session,
		return -EINVAL;
	}

	if (!session->clk_on) {
		pr_debug("mdp/dsi clock off currently\n");
		return -EPERM;
	}

	mutex_lock(&session->histo_lock);

	if (!session->histo_status) {
		pr_err("mdp3_histogram_collect not started\n");
		pr_debug("mdp3_histogram_collect not started\n");
		mutex_unlock(&session->histo_lock);
		return -EPERM;
		return -EPROTO;
	}

	mutex_unlock(&session->histo_lock);

	if (!session->clk_on) {
		pr_debug("mdp/dsi clock off currently\n");
		return -EPERM;
	}

	mdp3_clk_enable(1, 0);
	ret = session->dma->get_histo(session->dma);
	mdp3_clk_enable(0, 0);
@@ -1691,7 +1692,7 @@ static int mdp3_ctrl_ioctl_handler(struct msm_fb_data_type *mfd,
	req = &mdp3_session->req_overlay;

	if (!mdp3_session->status && cmd != MSMFB_METADATA_GET &&
		cmd != MSMFB_HISTOGRAM_STOP) {
		cmd != MSMFB_HISTOGRAM_STOP && cmd != MSMFB_HISTOGRAM) {
		pr_err("mdp3_ctrl_ioctl_handler, display off!\n");
		return -EPERM;
	}