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

Commit 3f1b7c30 authored by Adrian Salido-Moreno's avatar Adrian Salido-Moreno Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: increase height constraints for panel resolution



MDP is able to support higher resolution and is only limited in height
by the MDP clock rate. There is already check in place for the MDP clock
requirement, however need to update phase step calculation to handle
proper overflow conditions for these higher resolution according to
hardware constraints based on potential overflow while scaling with some
phase steps. At the same time hardware is able to handle some conditions
that are currently failed, so enable these to allow more cases that can
go through MDP.

Change-Id: I4c5a569e115302f05db7c525c0f8a76ed1738521
Signed-off-by: default avatarAdrian Salido-Moreno <adrianm@codeaurora.org>
parent e5421545
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
#define MDP_CLK_DEFAULT_RATE	200000000
#define PHASE_STEP_SHIFT	21
#define MAX_MIXER_WIDTH		2048
#define MAX_MIXER_HEIGHT	2400
#define MAX_MIXER_HEIGHT	0xFFFF
#define MAX_IMG_WIDTH		0x3FFF
#define MAX_IMG_HEIGHT		0x3FFF
#define AHB_CLK_OFFSET		0x3B4
+10 −3
Original line number Diff line number Diff line
@@ -295,7 +295,10 @@ static int __mdss_mdp_overlay_setup_scaling(struct mdss_mdp_pipe *pipe)
	memset(&pipe->scale, 0, sizeof(struct mdp_scale_data));
	rc = mdss_mdp_calc_phase_step(src, pipe->dst.w,
			&pipe->scale.phase_step_x[0]);
	if (rc) {
	if (rc == -EOVERFLOW) {
		/* overflow on horizontal direction is acceptable */
		rc = 0;
	} else if (rc) {
		pr_err("Horizontal scaling calculation failed=%d! %d->%d\n",
				rc, src, pipe->dst.w);
		return rc;
@@ -304,7 +307,11 @@ static int __mdss_mdp_overlay_setup_scaling(struct mdss_mdp_pipe *pipe)
	src = pipe->src.h >> pipe->vert_deci;
	rc = mdss_mdp_calc_phase_step(src, pipe->dst.h,
			&pipe->scale.phase_step_y[0]);
	if (rc) {

	if ((rc == -EOVERFLOW) && (pipe->type == MDSS_MDP_PIPE_TYPE_VIG)) {
		/* overflow on Qseed2 scaler is acceptable */
		rc = 0;
	} else if (rc) {
		pr_err("Vertical scaling calculation failed=%d! %d->%d\n",
				rc, src, pipe->dst.h);
		return rc;
@@ -313,7 +320,7 @@ static int __mdss_mdp_overlay_setup_scaling(struct mdss_mdp_pipe *pipe)
					(1 << PHASE_STEP_SHIFT)) / 2;
	pipe->scale.init_phase_y[0] = (pipe->scale.phase_step_y[0] -
					(1 << PHASE_STEP_SHIFT)) / 2;
	return 0;
	return rc;
}

static inline void __mdss_mdp_overlay_set_chroma_sample(
+9 −4
Original line number Diff line number Diff line
@@ -620,9 +620,9 @@ int mdss_mdp_get_img(struct msmfb_data *img, struct mdss_mdp_img_data *data)

int mdss_mdp_calc_phase_step(u32 src, u32 dst, u32 *out_phase)
{
	u32 unit, residue;
	u32 unit, residue, result;

	if (dst == 0)
	if (src == 0 || dst == 0)
		return -EINVAL;

	unit = 1 << PHASE_STEP_SHIFT;
@@ -630,8 +630,13 @@ int mdss_mdp_calc_phase_step(u32 src, u32 dst, u32 *out_phase)

	/* check if overflow is possible */
	if (src > dst) {
		residue = *out_phase & (unit - 1);
		if (residue && ((residue * dst) < (unit - residue)))
		residue = *out_phase - unit;
		result = (residue * dst) + residue;

		while (result > (unit + (unit >> 1)))
			result -= unit;

		if ((result > residue) && (result < unit))
			return -EOVERFLOW;
	}