Example #1
0
int mdp_stop_histogram(struct fb_info *info)
{
	unsigned long flag;
	int ret = 0;
	struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par;

	mutex_lock(&mdp_hist_mutex);
	if (!mdp_is_hist_start) {
		printk(KERN_ERR "%s histogram already stopped\n", __func__);
		ret = -EPERM;
		goto mdp_hist_stop_err;
	}
	spin_lock_irqsave(&mdp_spin_lock, flag);
	mdp_is_hist_start = FALSE;
	spin_unlock_irqrestore(&mdp_spin_lock, flag);

	if (!mfd->panel_power_on) {

		mdp_is_hist_data = FALSE;
		complete(&mdp_hist_comp);
		ret = -EINVAL;
		goto mdp_hist_stop_err;
	}

	ret = _mdp_histogram_ctrl(FALSE);

	mutex_unlock(&mdp_hist_mutex);
	flush_workqueue(mdp_hist_wq);
	return ret;

mdp_hist_stop_err:
	mutex_unlock(&mdp_hist_mutex);
	return ret;
}
Example #2
0
int mdp_histogram_ctrl(boolean en)
{
	int ret = 0;
	mutex_lock(&mdp_hist_mutex);
	ret = _mdp_histogram_ctrl(en);
	mutex_unlock(&mdp_hist_mutex);
	return ret;
}
Example #3
0
int mdp_histogram_ctrl(boolean en)
{
	int ret = 0;
	mutex_lock(&mdp_hist_mutex);
	if (mdp_is_hist_start)
		ret = _mdp_histogram_ctrl(en);
	mutex_unlock(&mdp_hist_mutex);

	if (en == false)
		flush_workqueue(mdp_hist_wq);

	return ret;
}
Example #4
0
int mdp_stop_histogram(struct fb_info *info)
{
	unsigned long flag;
	int ret = 0;
	mutex_lock(&mdp_hist_mutex);
	if (!mdp_is_hist_start) {
		printk(KERN_ERR "%s histogram already stopped\n", __func__);
		ret = -EPERM;
		goto mdp_hist_stop_err;
	}

	spin_lock_irqsave(&mdp_spin_lock, flag);
	mdp_is_hist_start = FALSE;
	spin_unlock_irqrestore(&mdp_spin_lock, flag);

	ret = _mdp_histogram_ctrl(FALSE);

mdp_hist_stop_err:
	mutex_unlock(&mdp_hist_mutex);
	return ret;
}