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

Commit 14c225c6 authored by Dhaval Patel's avatar Dhaval Patel
Browse files

msm: mdss: pass file pointer as argument to fb_ioctl api



MDSS driver uses file pointer to track the client
and associates the resources based on it. There can
be a race condition between to clients ioctl call
and it can lead to track resources with wrong
caller. This can leads to release/reallocate
resources prematurely to other client which may
show blank screen on display.

One good example client call flow is:
 <-step:1-> fb_open by client-X
 <-step:2-> fb_open by client-Y
 <-step:3-> fb_ioctl by client-X
 <-step:4-> fb_ioctl by client-Y
 <-step:5-> fb_ioctl by client-X
 <-step:6-> fb_close by client-Y

If step-5 and step-6 both are running on two different
CPUs at same time then it may overwrite the file node
unintentionally.

This change tries to pass the file pointer as one of
the argument to IOCTL call. It avoids usage of mutex
lock to support the concurrent calls.

Change-Id: I0bfd76358c80892c8e4f56298bce6c33b4132550
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent 8cd988e4
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -1085,7 +1085,7 @@ fb_blank(struct fb_info *info, int blank)
EXPORT_SYMBOL(fb_blank);

static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
			unsigned long arg)
			unsigned long arg, struct file *file)
{
	struct fb_ops *fb;
	struct fb_var_screeninfo var;
@@ -1213,7 +1213,9 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
		break;
	default:
		fb = info->fbops;
		if (fb->fb_ioctl)
		if (fb->fb_ioctl_v2)
			ret = fb->fb_ioctl_v2(info, cmd, arg, file);
		else if (fb->fb_ioctl)
			ret = fb->fb_ioctl(info, cmd, arg);
		else
			ret = -ENOTTY;
@@ -1227,10 +1229,7 @@ static long fb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)

	if (!info)
		return -ENODEV;
	mutex_lock(&info->lock);
	info->file = file;
	mutex_unlock(&info->lock);
	return do_fb_ioctl(info, cmd, arg);
	return do_fb_ioctl(info, cmd, arg, file);
}

#ifdef CONFIG_COMPAT
@@ -1261,7 +1260,7 @@ struct fb_cmap32 {
};

static int fb_getput_cmap(struct fb_info *info, unsigned int cmd,
			  unsigned long arg)
			  unsigned long arg, struct file *file)
{
	struct fb_cmap_user __user *cmap;
	struct fb_cmap32 __user *cmap32;
@@ -1284,7 +1283,7 @@ static int fb_getput_cmap(struct fb_info *info, unsigned int cmd,
	    put_user(compat_ptr(data), &cmap->transp))
		return -EFAULT;

	err = do_fb_ioctl(info, cmd, (unsigned long) cmap);
	err = do_fb_ioctl(info, cmd, (unsigned long) cmap, file);

	if (!err) {
		if (copy_in_user(&cmap32->start,
@@ -1329,7 +1328,7 @@ static int do_fscreeninfo_to_user(struct fb_fix_screeninfo *fix,
}

static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd,
			      unsigned long arg)
			      unsigned long arg, struct file *file)
{
	mm_segment_t old_fs;
	struct fb_fix_screeninfo fix;
@@ -1340,7 +1339,7 @@ static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd,

	old_fs = get_fs();
	set_fs(KERNEL_DS);
	err = do_fb_ioctl(info, cmd, (unsigned long) &fix);
	err = do_fb_ioctl(info, cmd, (unsigned long) &fix, file);
	set_fs(old_fs);

	if (!err)
@@ -1367,20 +1366,22 @@ static long fb_compat_ioctl(struct file *file, unsigned int cmd,
	case FBIOPUT_CON2FBMAP:
		arg = (unsigned long) compat_ptr(arg);
	case FBIOBLANK:
		ret = do_fb_ioctl(info, cmd, arg);
		ret = do_fb_ioctl(info, cmd, arg, file);
		break;

	case FBIOGET_FSCREENINFO:
		ret = fb_get_fscreeninfo(info, cmd, arg);
		ret = fb_get_fscreeninfo(info, cmd, arg, file);
		break;

	case FBIOGETCMAP:
	case FBIOPUTCMAP:
		ret = fb_getput_cmap(info, cmd, arg);
		ret = fb_getput_cmap(info, cmd, arg, file);
		break;

	default:
		if (fb->fb_compat_ioctl)
		if (fb->fb_compat_ioctl_v2)
			ret = fb->fb_compat_ioctl_v2(info, cmd, arg, file);
		else if (fb->fb_compat_ioctl)
			ret = fb->fb_compat_ioctl(info, cmd, arg);
		break;
	}
+46 −42
Original line number Diff line number Diff line
@@ -293,7 +293,7 @@ end:
}

static int __compat_atomic_commit(struct fb_info *info, unsigned int cmd,
			 unsigned long argp)
			 unsigned long argp, struct file *file)
{
	int ret, i;
	struct mdp_layer_commit  commit;
@@ -361,7 +361,7 @@ static int __compat_atomic_commit(struct fb_info *info, unsigned int cmd,
		}
	}

	ret = mdss_fb_atomic_commit(info, &commit);
	ret = mdss_fb_atomic_commit(info, &commit, file);
	if (ret)
		pr_err("atomic commit failed ret:%d\n", ret);

@@ -471,7 +471,7 @@ static int __compat_async_position_update(struct fb_info *info,
}

static int mdss_fb_compat_buf_sync(struct fb_info *info, unsigned int cmd,
			 unsigned long arg)
			 unsigned long arg, struct file *file)
{
	struct mdp_buf_sync32 __user *buf_sync32;
	struct mdp_buf_sync __user *buf_sync;
@@ -498,7 +498,7 @@ static int mdss_fb_compat_buf_sync(struct fb_info *info, unsigned int cmd,
	    put_user(compat_ptr(data), &buf_sync->retire_fen_fd))
		return -EFAULT;

	ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) buf_sync);
	ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) buf_sync, file);
	if (ret) {
		pr_err("%s: failed %d\n", __func__, ret);
		return ret;
@@ -583,7 +583,7 @@ static int __from_user_fb_image(struct fb_image __user *image,
}

static int mdss_fb_compat_cursor(struct fb_info *info, unsigned int cmd,
			unsigned long arg)
			unsigned long arg, struct file *file)
{
	struct fb_cursor32 __user *cursor32;
	struct fb_cursor __user *cursor;
@@ -611,11 +611,12 @@ static int mdss_fb_compat_cursor(struct fb_info *info, unsigned int cmd,
	if (__from_user_fb_image(&cursor->image, &cursor32->image))
		return -EFAULT;

	ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) cursor);
	ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) cursor, file);
	return ret;
}

static int mdss_fb_compat_set_lut(struct fb_info *info, unsigned long arg)
static int mdss_fb_compat_set_lut(struct fb_info *info, unsigned long arg,
	struct file *file)
{
	struct fb_cmap_user __user *cmap;
	struct fb_cmap32 __user *cmap32;
@@ -638,7 +639,7 @@ static int mdss_fb_compat_set_lut(struct fb_info *info, unsigned long arg)
	    put_user(compat_ptr(data), &cmap->transp))
		return -EFAULT;

	ret = mdss_fb_do_ioctl(info, MSMFB_SET_LUT, (unsigned long) cmap);
	ret = mdss_fb_do_ioctl(info, MSMFB_SET_LUT, (unsigned long) cmap, file);
	if (!ret)
		pr_debug("%s: compat ioctl successful\n", __func__);

@@ -2941,7 +2942,7 @@ static int __pp_compat_alloc(struct msmfb_mdp_pp32 __user *pp32,
}

static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			unsigned long arg)
			unsigned long arg, struct file *file)
{
	uint32_t op;
	int ret = 0;
@@ -2966,7 +2967,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.pcc_cfg_data);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		if (ret)
			goto pp_compat_exit;
		ret = __to_user_pcc_cfg_data(
@@ -2979,7 +2980,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.csc_cfg_data);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		if (ret)
			goto pp_compat_exit;
		ret = __to_user_csc_cfg_data(
@@ -2992,7 +2993,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.lut_cfg_data);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		if (ret)
			goto pp_compat_exit;
		ret = __to_user_lut_cfg_data(
@@ -3005,7 +3006,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.qseed_cfg_data);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		if (ret)
			goto pp_compat_exit;
		ret = __to_user_qseed_cfg_data(
@@ -3018,7 +3019,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.bl_scale_data);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		break;
	case mdp_op_pa_cfg:
		ret = __from_user_pa_cfg_data(
@@ -3026,7 +3027,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.pa_cfg_data);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		if (ret)
			goto pp_compat_exit;
		ret = __to_user_pa_cfg_data(
@@ -3039,7 +3040,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.pa_v2_cfg_data);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		if (ret)
			goto pp_compat_exit;
		ret = __to_user_pa_v2_cfg_data(
@@ -3052,7 +3053,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.dither_cfg_data);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		if (ret)
			goto pp_compat_exit;
		ret = __to_user_dither_cfg_data(
@@ -3065,7 +3066,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.gamut_cfg_data);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		if (ret)
			goto pp_compat_exit;
		ret = __to_user_gamut_cfg_data(
@@ -3078,7 +3079,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.calib_cfg);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		if (ret)
			goto pp_compat_exit;
		ret = __to_user_calib_config_data(
@@ -3091,7 +3092,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.ad_init_cfg);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		break;
	case mdp_op_ad_input:
		ret = __from_user_ad_input(
@@ -3099,7 +3100,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.ad_input);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		if (ret)
			goto pp_compat_exit;
		ret = __to_user_ad_input(
@@ -3112,7 +3113,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.mdss_calib_cfg);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		break;
	case mdp_op_calib_buffer:
		ret = __from_user_calib_config_buffer(
@@ -3120,7 +3121,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.calib_buffer);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		if (ret)
			goto pp_compat_exit;
		ret = __to_user_calib_config_buffer(
@@ -3133,7 +3134,7 @@ static int mdss_compat_pp_ioctl(struct fb_info *info, unsigned int cmd,
			&pp->data.calib_dcm);
		if (ret)
			goto pp_compat_exit;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) pp, file);
		break;
	default:
		break;
@@ -3333,7 +3334,7 @@ static int __to_user_hist_data(
}

static int mdss_histo_compat_ioctl(struct fb_info *info, unsigned int cmd,
			unsigned long arg)
			unsigned long arg, struct file *file)
{
	struct mdp_histogram_data __user *hist;
	struct mdp_histogram_data32 __user *hist32;
@@ -3356,10 +3357,11 @@ static int mdss_histo_compat_ioctl(struct fb_info *info, unsigned int cmd,
		ret = __from_user_hist_start_req(hist_req32, hist_req);
		if (ret)
			goto histo_compat_err;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) hist_req);
		ret = mdss_fb_do_ioctl(info, cmd,
			(unsigned long) hist_req, file);
		break;
	case MSMFB_HISTOGRAM_STOP:
		ret = mdss_fb_do_ioctl(info, cmd, arg);
		ret = mdss_fb_do_ioctl(info, cmd, arg, file);
		break;
	case MSMFB_HISTOGRAM:
		hist32 = compat_ptr(arg);
@@ -3375,7 +3377,7 @@ static int mdss_histo_compat_ioctl(struct fb_info *info, unsigned int cmd,
		ret = __from_user_hist_data(hist32, hist);
		if (ret)
			goto histo_compat_err;
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) hist);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) hist, file);
		if (ret)
			goto histo_compat_err;
		ret = __to_user_hist_data(hist32, hist);
@@ -4076,7 +4078,7 @@ static int __pp_sspp_set_offsets(struct mdp_overlay *ov)
}

int mdss_compat_overlay_ioctl(struct fb_info *info, unsigned int cmd,
			 unsigned long arg)
			 unsigned long arg, struct file *file)
{
	struct mdp_overlay *ov, **layers_head;
	struct mdp_overlay32 *ov32;
@@ -4094,12 +4096,12 @@ int mdss_compat_overlay_ioctl(struct fb_info *info, unsigned int cmd,

	switch (cmd) {
	case MSMFB_MDP_PP:
		ret = mdss_compat_pp_ioctl(info, cmd, arg);
		ret = mdss_compat_pp_ioctl(info, cmd, arg, file);
		break;
	case MSMFB_HISTOGRAM_START:
	case MSMFB_HISTOGRAM_STOP:
	case MSMFB_HISTOGRAM:
		ret = mdss_histo_compat_ioctl(info, cmd, arg);
		ret = mdss_histo_compat_ioctl(info, cmd, arg, file);
		break;
	case MSMFB_OVERLAY_GET:
		alloc_size += sizeof(*ov) + __pp_sspp_size();
@@ -4119,7 +4121,8 @@ int mdss_compat_overlay_ioctl(struct fb_info *info, unsigned int cmd,
		if (ret)
			pr_err("%s: compat mdp overlay failed\n", __func__);
		else
			ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) ov);
			ret = mdss_fb_do_ioctl(info, cmd,
				(unsigned long) ov, file);
		ret = __to_user_mdp_overlay(ov32, ov);
		break;
	case MSMFB_OVERLAY_SET:
@@ -4140,7 +4143,8 @@ int mdss_compat_overlay_ioctl(struct fb_info *info, unsigned int cmd,
		if (ret) {
			pr_err("%s: compat mdp overlay failed\n", __func__);
		} else {
			ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) ov);
			ret = mdss_fb_do_ioctl(info, cmd,
				(unsigned long) ov, file);
			ret = __to_user_mdp_overlay(ov32, ov);
		}
		break;
@@ -4180,7 +4184,7 @@ int mdss_compat_overlay_ioctl(struct fb_info *info, unsigned int cmd,
			pr_err("compat mdp overlaylist failed\n");
		} else {
			ret = mdss_fb_do_ioctl(info, cmd,
						(unsigned long) ovlist);
				(unsigned long) ovlist, file);
			if (!ret)
				ret = __to_user_mdp_overlaylist(ovlist32,
							 ovlist, layers_head);
@@ -4193,7 +4197,7 @@ int mdss_compat_overlay_ioctl(struct fb_info *info, unsigned int cmd,
	case MSMFB_METADATA_GET:
	default:
		pr_debug("%s: overlay ioctl cmd=[%u]\n", __func__, cmd);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) arg);
		ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) arg, file);
		break;
	}
	return ret;
@@ -4210,7 +4214,7 @@ int mdss_compat_overlay_ioctl(struct fb_info *info, unsigned int cmd,
 * framebuffer device driven in 64-bit kernel.
 */
int mdss_fb_compat_ioctl(struct fb_info *info, unsigned int cmd,
			 unsigned long arg)
			 unsigned long arg, struct file *file)
{
	int ret;

@@ -4220,16 +4224,16 @@ int mdss_fb_compat_ioctl(struct fb_info *info, unsigned int cmd,
	cmd = __do_compat_ioctl_nr(cmd);
	switch (cmd) {
	case MSMFB_CURSOR:
		ret = mdss_fb_compat_cursor(info, cmd, arg);
		ret = mdss_fb_compat_cursor(info, cmd, arg, file);
		break;
	case MSMFB_SET_LUT:
		ret = mdss_fb_compat_set_lut(info, arg);
		ret = mdss_fb_compat_set_lut(info, arg, file);
		break;
	case MSMFB_BUFFER_SYNC:
		ret = mdss_fb_compat_buf_sync(info, cmd, arg);
		ret = mdss_fb_compat_buf_sync(info, cmd, arg, file);
		break;
	case MSMFB_ATOMIC_COMMIT:
		ret = __compat_atomic_commit(info, cmd, arg);
		ret = __compat_atomic_commit(info, cmd, arg, file);
		break;
	case MSMFB_ASYNC_POSITION_UPDATE:
		ret = __compat_async_position_update(info, cmd, arg);
@@ -4246,12 +4250,12 @@ int mdss_fb_compat_ioctl(struct fb_info *info, unsigned int cmd,
	case MSMFB_METADATA_SET:
	case MSMFB_METADATA_GET:
	case MSMFB_OVERLAY_PREPARE:
		ret = mdss_compat_overlay_ioctl(info, cmd, arg);
		ret = mdss_compat_overlay_ioctl(info, cmd, arg, file);
		break;
	case MSMFB_NOTIFY_UPDATE:
	case MSMFB_DISPLAY_COMMIT:
	default:
		ret = mdss_fb_do_ioctl(info, cmd, arg);
		ret = mdss_fb_do_ioctl(info, cmd, arg, file);
		break;
	}

+10 −11
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ static int mdss_fb_blank_sub(int blank_mode, struct fb_info *info,
			     int op_enable);
static int mdss_fb_suspend_sub(struct msm_fb_data_type *mfd);
static int mdss_fb_ioctl(struct fb_info *info, unsigned int cmd,
			 unsigned long arg);
			 unsigned long arg, struct file *file);
static int mdss_fb_fbmem_ion_mmap(struct fb_info *info,
		struct vm_area_struct *vma);
static int mdss_fb_alloc_fb_ion_memory(struct msm_fb_data_type *mfd,
@@ -2184,9 +2184,9 @@ static struct fb_ops mdss_fb_ops = {
	.fb_set_par = mdss_fb_set_par,	/* set the video mode */
	.fb_blank = mdss_fb_blank,	/* blank display */
	.fb_pan_display = mdss_fb_pan_display,	/* pan display */
	.fb_ioctl = mdss_fb_ioctl,	/* perform fb specific ioctl */
	.fb_ioctl_v2 = mdss_fb_ioctl,	/* perform fb specific ioctl */
#ifdef CONFIG_COMPAT
	.fb_compat_ioctl = mdss_fb_compat_ioctl,
	.fb_compat_ioctl_v2 = mdss_fb_compat_ioctl,
#endif
	.fb_mmap = mdss_fb_mmap,
};
@@ -3073,11 +3073,10 @@ static int __ioctl_transition_dyn_mode_state(struct msm_fb_data_type *mfd,
}

int mdss_fb_atomic_commit(struct fb_info *info,
	struct mdp_layer_commit  *commit)
	struct mdp_layer_commit  *commit, struct file *file)
{
	struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par;
	struct mdp_layer_commit_v1 *commit_v1;
	struct file *file = info->file;
	bool wait_for_finish;
	int ret = -EPERM;

@@ -4028,7 +4027,7 @@ static int mdss_fb_display_commit(struct fb_info *info,
}

static int mdss_fb_atomic_commit_ioctl(struct fb_info *info,
						unsigned long *argp)
	unsigned long *argp, struct file *file)
{
	int ret, i = 0, j = 0, rc;
	struct mdp_layer_commit  commit;
@@ -4130,7 +4129,7 @@ static int mdss_fb_atomic_commit_ioctl(struct fb_info *info,
		}
	}

	ret = mdss_fb_atomic_commit(info, &commit);
	ret = mdss_fb_atomic_commit(info, &commit, file);
	if (ret)
		pr_err("atomic commit failed ret:%d\n", ret);

@@ -4297,7 +4296,7 @@ static int __ioctl_wait_idle(struct msm_fb_data_type *mfd, u32 cmd)
 * by compat ioctl or regular ioctl to handle the supported commands.
 */
int mdss_fb_do_ioctl(struct fb_info *info, unsigned int cmd,
			 unsigned long arg)
			 unsigned long arg, struct file *file)
{
	struct msm_fb_data_type *mfd;
	void __user *argp = (void __user *)arg;
@@ -4379,7 +4378,7 @@ int mdss_fb_do_ioctl(struct fb_info *info, unsigned int cmd,
		ret = mdss_fb_mode_switch(mfd, dsi_mode);
		break;
	case MSMFB_ATOMIC_COMMIT:
		ret = mdss_fb_atomic_commit_ioctl(info, argp);
		ret = mdss_fb_atomic_commit_ioctl(info, argp, file);
		break;

	case MSMFB_ASYNC_POSITION_UPDATE:
@@ -4403,12 +4402,12 @@ exit:
}

static int mdss_fb_ioctl(struct fb_info *info, unsigned int cmd,
			 unsigned long arg)
			 unsigned long arg, struct file *file)
{
	if (!info || !info->par)
		return -EINVAL;

	return mdss_fb_do_ioctl(info, cmd, arg);
	return mdss_fb_do_ioctl(info, cmd, arg, file);
}

struct fb_info *msm_fb_get_writeback_fb(void)
+3 −3
Original line number Diff line number Diff line
@@ -434,11 +434,11 @@ int mdss_fb_register_mdp_instance(struct msm_mdp_interface *mdp);
int mdss_fb_dcm(struct msm_fb_data_type *mfd, int req_state);
int mdss_fb_suspres_panel(struct device *dev, void *data);
int mdss_fb_do_ioctl(struct fb_info *info, unsigned int cmd,
		     unsigned long arg);
		     unsigned long arg, struct file *file);
int mdss_fb_compat_ioctl(struct fb_info *info, unsigned int cmd,
			 unsigned long arg);
			 unsigned long arg, struct file *file);
int mdss_fb_atomic_commit(struct fb_info *info,
	struct mdp_layer_commit  *commit);
	struct mdp_layer_commit  *commit, struct file *file);
int mdss_fb_async_position_update(struct fb_info *info,
		struct mdp_position_update *update_pos);

+8 −0
Original line number Diff line number Diff line
@@ -288,10 +288,18 @@ struct fb_ops {
	int (*fb_ioctl)(struct fb_info *info, unsigned int cmd,
			unsigned long arg);

	/* perform fb specific ioctl v2 (optional) - provides file param */
	int (*fb_ioctl_v2)(struct fb_info *info, unsigned int cmd,
			unsigned long arg, struct file *file);

	/* Handle 32bit compat ioctl (optional) */
	int (*fb_compat_ioctl)(struct fb_info *info, unsigned cmd,
			unsigned long arg);

	/* Handle 32bit compat ioctl (optional) */
	int (*fb_compat_ioctl_v2)(struct fb_info *info, unsigned cmd,
			unsigned long arg, struct file *file);

	/* perform fb specific mmap */
	int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma);