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

Commit 45927833 authored by Ramkumar Radhakrishnan's avatar Ramkumar Radhakrishnan Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: use one dma pipe during block mode transaction



Use one dma pipe during block mode transaction instead of two pipes
for the buffer resolution greater than max mixer width

Change-Id: I2a9f1bba95bfb66d1c0168aa9b99b8b9de57cd6a
Signed-off-by: default avatarRamkumar Radhakrishnan <ramkumar@codeaurora.org>
parent d81481d4
Loading
Loading
Loading
Loading
+0 −73
Original line number Diff line number Diff line
@@ -441,7 +441,6 @@ int mdss_mdp_rotator_setup(struct msm_fb_data_type *mfd,
	struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd);
	struct mdss_mdp_rotator_session *rot = NULL;
	struct mdss_mdp_format_params *fmt;
	struct mdss_data_type *mdata = mfd_to_mdata(mfd);
	u32 bwc_enabled;
	int ret = 0;

@@ -521,78 +520,6 @@ int mdss_mdp_rotator_setup(struct msm_fb_data_type *mfd,
	if (rot->flags & MDP_ROT_90)
		swap(rot->dst.w, rot->dst.h);

	if (rot->src_rect.w > mdata->max_mixer_width) {
		struct mdss_mdp_rotator_session *tmp;
		u32 width;

		if (rot->bwc_mode) {
			pr_err("Unable to do split rotation with bwc set\n");
			ret = -EINVAL;
			goto rot_err;
		}

		width = rot->src_rect.w;

		pr_debug("setting up split rotation src=%dx%d\n",
			rot->src_rect.w, rot->src_rect.h);

		if (width > (mdata->max_mixer_width * 2)) {
			pr_err("unsupported source width %d\n", width);
			ret = -EOVERFLOW;
			goto rot_err;
		}

		if (!rot->next) {
			tmp = mdss_mdp_rotator_session_alloc();
			if (!tmp) {
				pr_err("unable to allocate rot dual session\n");
				ret = -ENOMEM;
				goto rot_err;
			}
			rot->next = tmp;
		}
		tmp = rot->next;

		tmp->session_id = rot->session_id & ~MDSS_MDP_ROT_SESSION_MASK;
		tmp->flags = rot->flags;
		tmp->format = rot->format;
		tmp->img_width = rot->img_width;
		tmp->img_height = rot->img_height;
		tmp->src_rect = rot->src_rect;

		tmp->src_rect.w = width / 2;
		width -= tmp->src_rect.w;
		tmp->src_rect.x += width;

		tmp->dst = rot->dst;
		rot->src_rect.w = width;

		if (rot->flags & MDP_ROT_90) {
			/*
			 * If rotated by 90 first half should be on top.
			 * But if horizontally flipped should be on bottom.
			 */
			if (rot->flags & MDP_FLIP_LR)
				rot->dst.y = tmp->src_rect.w;
			else
				tmp->dst.y = rot->src_rect.w;
		} else {
			/*
			 * If not rotated, first half should be the left part
			 * of the frame, unless horizontally flipped
			 */
			if (rot->flags & MDP_FLIP_LR)
				rot->dst.x = tmp->src_rect.w;
			else
				tmp->dst.x = rot->src_rect.w;
		}

		tmp->params_changed++;
	} else if (rot->next) {
		mdss_mdp_rotator_finish(rot->next);
		rot->next = NULL;
	}

	rot->params_changed++;

	ret = __mdss_mdp_rotator_pipe_reserve(rot);