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

Commit 6b2c1b14 authored by Jayant Shekhar's avatar Jayant Shekhar
Browse files

msm: mdss: Add data check before pipes are programmed



Move the mdss_mdp_data_check call to image_setup instead
of src_addr_setup. Return a failure in image setup so
that the new parameters won't be programmed

Change-Id: Ib35b41eadf4cb50225866b7056670323cc8e8eac
Signed-off-by: default avatarJayant Shekhar <jshekhar@codeaurora.org>
parent c99f9b85
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -509,11 +509,13 @@ int mdss_mdp_pipe_destroy(struct mdss_mdp_pipe *pipe)

}

static int mdss_mdp_image_setup(struct mdss_mdp_pipe *pipe)
static int mdss_mdp_image_setup(struct mdss_mdp_pipe *pipe,
					struct mdss_mdp_data *data)
{
	u32 img_size, src_size, src_xy, dst_size, dst_xy, ystride0, ystride1;
	u32 width, height;
	u32 decimation;
	int ret = 0;

	pr_debug("pnum=%d wh=%dx%d src={%d,%d,%d,%d} dst={%d,%d,%d,%d}\n",
		   pipe->num, pipe->img_width, pipe->img_height,
@@ -525,6 +527,12 @@ static int mdss_mdp_image_setup(struct mdss_mdp_pipe *pipe)
	mdss_mdp_get_plane_sizes(pipe->src_fmt->format, width, height,
			&pipe->src_planes, pipe->bwc_mode);

	if (data != NULL) {
		ret = mdss_mdp_data_check(data, &pipe->src_planes);
		if (ret)
			return ret;
	}

	if ((pipe->flags & MDP_DEINTERLACE) &&
			!(pipe->flags & MDP_SOURCE_ROTATED_90)) {
		int i;
@@ -722,7 +730,7 @@ static int mdss_mdp_pipe_solidfill_setup(struct mdss_mdp_pipe *pipe)

	pr_debug("solid fill setup on pnum=%d\n", pipe->num);

	ret = mdss_mdp_image_setup(pipe);
	ret = mdss_mdp_image_setup(pipe, NULL);
	if (ret) {
		pr_err("image setup error for pnum=%d\n", pipe->num);
		return ret;
@@ -782,7 +790,7 @@ int mdss_mdp_pipe_queue_data(struct mdss_mdp_pipe *pipe,
			goto done;
		}

		ret = mdss_mdp_image_setup(pipe);
		ret = mdss_mdp_image_setup(pipe, src_data);
		if (ret) {
			pr_err("image setup error for pnum=%d\n", pipe->num);
			goto done;