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

Commit 39ac1aec authored by Ujwal Patel's avatar Ujwal Patel
Browse files

msm: mdss: Fix MDP hang issue for H2V1 interleaved formats



MDSS HW with decimation block present, uses two SMP clients, Y and UV,
regardless of YUV surface is interleaved or planar. Current code takes
care of planar format but not interleave YUV. Fix this by temporarily
converting those formats to pseudo-planar while calculating SMP
requirements.

CRs-Fixed: 568011
Change-Id: I917f7dfd848144bcc4a6c463cd20fb302c432cc5
Signed-off-by: default avatarUjwal Patel <ujwalp@codeaurora.org>
parent b5b762bb
Loading
Loading
Loading
Loading
+20 −12
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ int mdss_mdp_smp_reserve(struct mdss_mdp_pipe *pipe)
	struct mdss_mdp_plane_sizes ps;
	int i;
	int rc = 0, rot_mode = 0;
	u32 nlines;
	u32 nlines, format;
	u16 width;

	width = pipe->src.w >> pipe->horz_deci;
@@ -179,8 +179,25 @@ int mdss_mdp_smp_reserve(struct mdss_mdp_pipe *pipe)
		pr_debug("BWC SMP strides ystride0=%x ystride1=%x\n",
			ps.ystride[0], ps.ystride[1]);
	} else {
		rc = mdss_mdp_get_plane_sizes(pipe->src_fmt->format,
			width, pipe->src.h, &ps, 0);
		format = pipe->src_fmt->format;
		/*
		 * when decimation block is present, all chroma planes
		 * are fetched on a single SMP plane for chroma pixels
		 */
		if (mdata->has_decimation) {
			switch (pipe->src_fmt->chroma_sample) {
			case MDSS_MDP_CHROMA_H2V1:
				format = MDP_Y_CRCB_H2V1;
				break;
			case MDSS_MDP_CHROMA_420:
				format = MDP_Y_CBCR_H2V2;
				break;
			default:
				break;
			}
		}
		rc = mdss_mdp_get_plane_sizes(format, width, pipe->src.h,
			&ps, 0);
		if (rc)
			return rc;

@@ -190,15 +207,6 @@ int mdss_mdp_smp_reserve(struct mdss_mdp_pipe *pipe)
			ps.ystride[0] = MAX_BPP *
				max(pipe->mixer->width, width);
		} else if (mdata->has_decimation) {
			/*
			 * when decimation block is used, all chroma planes
			 * are fetched on a single SMP plane for chroma pixels
			 */
			if (ps.num_planes == 3) {
				ps.num_planes = 2;
				ps.ystride[1] += ps.ystride[2];
			}

			/*
			 * To avoid quailty loss, MDP does one less decimation
			 * on chroma components if they are subsampled.