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

Commit 39418208 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: fix issue in calculating decimated dimensions"

parents 14fa7799 bacee6ec
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -572,7 +572,7 @@ int mdss_mdp_perf_calc_pipe(struct mdss_mdp_pipe *pipe,
	 * no need to account for these lines in MDP clock or request bus
	 * bandwidth to fetch them.
	 */
	src_h = src.h >> pipe->vert_deci;
	src_h = DECIMATED_DIMENSION(src.h, pipe->vert_deci);

	quota = fps * src.w * src_h;

+21 −16
Original line number Diff line number Diff line
@@ -309,8 +309,8 @@ int mdss_mdp_overlay_req_check(struct msm_fb_data_type *mfd,
			dst_h = req->dst_rect.h;
		}

		src_w = req->src_rect.w >> req->horz_deci;
		src_h = req->src_rect.h >> req->vert_deci;
		src_w = DECIMATED_DIMENSION(req->src_rect.w, req->horz_deci);
		src_h = DECIMATED_DIMENSION(req->src_rect.h, req->vert_deci);

		if (src_w > mdata->max_pipe_width) {
			pr_err("invalid source width=%d HDec=%d\n",
@@ -442,8 +442,8 @@ static int __mdss_mdp_validate_pxl_extn(struct mdss_mdp_pipe *pipe)
		u32 hor_req_pixels, hor_fetch_pixels;
		u32 hor_ov_fetch, vert_ov_fetch;
		u32 vert_req_pixels, vert_fetch_pixels;
		u32 src_w = pipe->src.w >> pipe->horz_deci;
		u32 src_h = pipe->src.h >> pipe->vert_deci;
		u32 src_w = DECIMATED_DIMENSION(pipe->src.w, pipe->horz_deci);
		u32 src_h = DECIMATED_DIMENSION(pipe->src.h, pipe->vert_deci);

		/*
		 * plane 1 and 2 are for chroma and are same. While configuring
@@ -474,33 +474,38 @@ static int __mdss_mdp_validate_pxl_extn(struct mdss_mdp_pipe *pipe)
			pipe->scale.num_ext_pxls_right[plane];

		hor_fetch_pixels = src_w +
			pipe->scale.left_ftch[plane] +
			(pipe->scale.left_ftch[plane] >> pipe->horz_deci) +
			pipe->scale.left_rpt[plane] +
			pipe->scale.right_ftch[plane] +
			(pipe->scale.right_ftch[plane] >> pipe->horz_deci) +
			pipe->scale.right_rpt[plane];

		hor_ov_fetch = src_w + pipe->scale.left_ftch[plane] +
			pipe->scale.right_ftch[plane];
		hor_ov_fetch = src_w +
			(pipe->scale.left_ftch[plane] >> pipe->horz_deci)+
			(pipe->scale.right_ftch[plane] >> pipe->horz_deci);

		vert_req_pixels = pipe->scale.num_ext_pxls_top[plane] +
			pipe->scale.num_ext_pxls_btm[plane];

		vert_fetch_pixels = pipe->scale.top_ftch[plane] +
		vert_fetch_pixels =
			(pipe->scale.top_ftch[plane] >> pipe->vert_deci) +
			pipe->scale.top_rpt[plane] +
			pipe->scale.btm_ftch[plane] +
			(pipe->scale.btm_ftch[plane] >> pipe->vert_deci)+
			pipe->scale.btm_rpt[plane];

		vert_ov_fetch = src_h + pipe->scale.top_ftch[plane] +
			pipe->scale.btm_ftch[plane];
		vert_ov_fetch = src_h +
			(pipe->scale.top_ftch[plane] >> pipe->vert_deci)+
			(pipe->scale.btm_ftch[plane] >> pipe->vert_deci);

		if ((hor_req_pixels != hor_fetch_pixels) ||
			(hor_ov_fetch > pipe->img_width) ||
			(vert_req_pixels != vert_fetch_pixels) ||
			(vert_ov_fetch > pipe->img_height)) {
			pr_err("err: plane=%d h_req:%d h_fetch:%d v_req:%d v_fetch:%d src_img:[%d,%d]\n",
			pr_err("err: plane=%d h_req:%d h_fetch:%d v_req:%d v_fetch:%d\n",
					plane,
					hor_req_pixels, hor_fetch_pixels,
					vert_req_pixels, vert_fetch_pixels,
					vert_req_pixels, vert_fetch_pixels);
			pr_err("roi_w[%d]=%d, src_img:[%d, %d]\n",
					plane, pipe->scale.roi_w[plane],
					pipe->img_width, pipe->img_height);
			pipe->scale.enable_pxl_ext = 0;
			return -EINVAL;
@@ -515,7 +520,7 @@ static int __mdss_mdp_overlay_setup_scaling(struct mdss_mdp_pipe *pipe)
	u32 src;
	int rc;

	src = pipe->src.w >> pipe->horz_deci;
	src = DECIMATED_DIMENSION(pipe->src.w, pipe->horz_deci);

	if (pipe->scale.enable_pxl_ext) {
		rc = __mdss_mdp_validate_pxl_extn(pipe);
@@ -534,7 +539,7 @@ static int __mdss_mdp_overlay_setup_scaling(struct mdss_mdp_pipe *pipe)
		return rc;
	}

	src = pipe->src.h >> pipe->vert_deci;
	src = DECIMATED_DIMENSION(pipe->src.h, pipe->vert_deci);
	rc = mdss_mdp_calc_phase_step(src, pipe->dst.h,
			&pipe->scale.phase_step_y[0]);

+20 −9
Original line number Diff line number Diff line
@@ -409,7 +409,7 @@ static int mdss_mdp_calc_stride(struct mdss_mdp_pipe *pipe,
	if (mdata->has_pixel_ram)
		return 0;

	width = pipe->src.w >> pipe->horz_deci;
	width = DECIMATED_DIMENSION(pipe->src.w, pipe->horz_deci);

	if (pipe->bwc_mode) {
		rc = mdss_mdp_get_rau_strides(pipe->src.w, pipe->src.h,
@@ -1811,8 +1811,9 @@ int mdss_mdp_pipe_is_staged(struct mdss_mdp_pipe *pipe)
static inline void __mdss_mdp_pipe_program_pixel_extn_helper(
	struct mdss_mdp_pipe *pipe, u32 plane, u32 off)
{
	u32 src_h = pipe->src.h >> pipe->vert_deci;
	u32 src_h = DECIMATED_DIMENSION(pipe->src.h, pipe->vert_deci);
	u32 mask = 0xFF;
	u32 lr_pe, tb_pe, tot_req_pixels;

	/*
	 * CB CR plane required pxls need to be accounted
@@ -1820,23 +1821,33 @@ static inline void __mdss_mdp_pipe_program_pixel_extn_helper(
	 */
	if (plane == 1)
		src_h >>= pipe->chroma_sample_v;
	writel_relaxed(((pipe->scale.right_ftch[plane] & mask) << 24)|

	lr_pe = ((pipe->scale.right_ftch[plane] & mask) << 24)|
		((pipe->scale.right_rpt[plane] & mask) << 16)|
		((pipe->scale.left_ftch[plane] & mask) << 8)|
		(pipe->scale.left_rpt[plane] & mask), pipe->base +
			MDSS_MDP_REG_SSPP_SW_PIX_EXT_C0_LR + off);
	writel_relaxed(((pipe->scale.btm_ftch[plane] & mask) << 24)|
		(pipe->scale.left_rpt[plane] & mask);

	tb_pe = ((pipe->scale.btm_ftch[plane] & mask) << 24)|
		((pipe->scale.btm_rpt[plane] & mask) << 16)|
		((pipe->scale.top_ftch[plane] & mask) << 8)|
		(pipe->scale.top_rpt[plane] & mask), pipe->base +
		(pipe->scale.top_rpt[plane] & mask);

	writel_relaxed(lr_pe, pipe->base +
			MDSS_MDP_REG_SSPP_SW_PIX_EXT_C0_LR + off);
	writel_relaxed(tb_pe, pipe->base +
			MDSS_MDP_REG_SSPP_SW_PIX_EXT_C0_TB + off);

	mask = 0xFFFF;
	writel_relaxed((((src_h + pipe->scale.num_ext_pxls_top[plane] +
	tot_req_pixels = (((src_h + pipe->scale.num_ext_pxls_top[plane] +
		pipe->scale.num_ext_pxls_btm[plane]) & mask) << 16) |
		((pipe->scale.roi_w[plane] +
		pipe->scale.num_ext_pxls_left[plane] +
		pipe->scale.num_ext_pxls_right[plane]) & mask), pipe->base +
		pipe->scale.num_ext_pxls_right[plane]) & mask);
	writel_relaxed(tot_req_pixels, pipe->base +
			MDSS_MDP_REG_SSPP_SW_PIX_EXT_C0_REQ_PIXELS + off);

	pr_debug("pipe num=%d, plane=%d, LR PE=0x%x, TB PE=0x%x, req_pixels=0x0%x\n",
		pipe->num, plane, lr_pe, tb_pe, tot_req_pixels);
}

/**
+2 −2
Original line number Diff line number Diff line
@@ -1068,8 +1068,8 @@ static int mdss_mdp_scale_setup(struct mdss_mdp_pipe *pipe)
		}
	}

	src_w = pipe->src.w >> pipe->horz_deci;
	src_h = pipe->src.h >> pipe->vert_deci;
	src_w = DECIMATED_DIMENSION(pipe->src.w, pipe->horz_deci);
	src_h = DECIMATED_DIMENSION(pipe->src.h, pipe->vert_deci);

	chroma_sample = pipe->src_fmt->chroma_sample;
	if (pipe->flags & MDP_SOURCE_ROTATED_90) {
+1 −0
Original line number Diff line number Diff line
@@ -534,6 +534,7 @@ enum mdss_mdp_blend_op {
	BLEND_OP_MAX,
};

#define DECIMATED_DIMENSION(dim, deci) (((dim) + ((1 << (deci)) - 1)) >> (deci))
#define MAX_PLANES	4
struct mdp_scale_data {
	uint8_t enable_pxl_ext;