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

Commit 8e983248 authored by Adrian Salido-Moreno's avatar Adrian Salido-Moreno Committed by Ingrid Gallardo
Browse files

msm: mdss: fix check for hardware cursor mixer stage



Currently max target zorder is used to check where hw cursor needs to be
setup since it needs to be setup at highest mixer stage for target.
However max target zorder reflects the maximum number of layers
supported and not the actual mixer stage. Fix by doing proper check and
configuring right mixer stage for cursor.

Change-Id: I6dee63a852126110bdc4953239d5b92b77f12488
Signed-off-by: default avatarAdrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
parent b6d89b7b
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -44,6 +44,10 @@
#define IS_RIGHT_MIXER_OV(flags, dst_x, left_lm_w)	\
	((flags & MDSS_MDP_RIGHT_MIXER) || (dst_x >= left_lm_w))

/* hw cursor can only be setup in highest mixer stage */
#define HW_CURSOR_STAGE(mdata) \
	(((mdata)->max_target_zorder + MDSS_MDP_STAGE_0) - 1)

#define BUF_POOL_SIZE 32

static int mdss_mdp_overlay_free_fb_pipe(struct msm_fb_data_type *mfd);
@@ -246,10 +250,10 @@ int mdss_mdp_overlay_req_check(struct msm_fb_data_type *mfd,
	 * with dedicated cursors within VP
	 */
	if ((req->pipe_type == MDSS_MDP_PIPE_TYPE_CURSOR) &&
		((req->z_order != mdata->max_target_zorder - 1) ||
		((req->z_order != HW_CURSOR_STAGE(mdata)) ||
		 !mdata->ncursor_pipes ||
		 (req->src_rect.w > mdata->max_cursor_size))) {
		pr_err("Inccorect cursor overlay cursor_pipes=%d zorder=%d\n",
		pr_err("Incorrect cursor overlay cursor_pipes=%d zorder=%d\n",
			mdata->ncursor_pipes, req->z_order);
		return -EINVAL;
	}
@@ -2929,7 +2933,7 @@ static int mdss_mdp_hw_cursor_pipe_update(struct msm_fb_data_type *mfd,

	memset(&req, 0, sizeof(struct mdp_overlay));
	req.pipe_type = PIPE_TYPE_CURSOR;
	req.z_order = MDSS_MDP_STAGE_6;
	req.z_order = HW_CURSOR_STAGE(mdata);

	req.src.width = img->width;
	req.src.height = img->height;