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

Commit 1d8e1976 authored by Ingrid Gallardo's avatar Ingrid Gallardo
Browse files

msm: mdss: fix rotator failures when pixel format changes



Current code fails the SMP allocation in the rotator session
when the pixel format during the session changes from YUV to
RGB. Fix these failures by releasing the SMP allocation
if pixel format changes.

Change-Id: Ic051ad4c48be6d4998d392fa74f7b3fb2c131980
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
parent 88240c83
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -180,6 +180,7 @@ static int mdss_mdp_rotator_pipe_dequeue(struct mdss_mdp_rotator_session *rot)
					       head);

			rc = mdss_mdp_rotator_busy_wait(tmp);
			mdss_mdp_smp_release(tmp->pipe);
			list_del(&tmp->head);
			if (rc) {
				pr_err("no pipe attached to session=%d\n",
@@ -442,6 +443,7 @@ int mdss_mdp_rotator_setup(struct msm_fb_data_type *mfd,
	struct mdss_mdp_rotator_session *rot = NULL;
	struct mdss_mdp_format_params *fmt;
	u32 bwc_enabled;
	bool format_changed = false;
	int ret = 0;

	mutex_lock(&rotator_lock);
@@ -475,6 +477,10 @@ int mdss_mdp_rotator_setup(struct msm_fb_data_type *mfd,
			ret = -ENODEV;
			goto rot_err;
		}

		if (rot->format != fmt->format)
			format_changed = true;

	} else {
		pr_err("invalid rotator session id=%x\n", req->id);
		ret = -EINVAL;
@@ -522,6 +528,12 @@ int mdss_mdp_rotator_setup(struct msm_fb_data_type *mfd,

	rot->params_changed++;

	/* If the format changed, release the smp alloc */
	if (format_changed && rot->pipe) {
		mdss_mdp_rotator_busy_wait(rot);
		mdss_mdp_smp_release(rot->pipe);
	}

	ret = __mdss_mdp_rotator_pipe_reserve(rot);
	if (!ret && rot->next)
		ret = __mdss_mdp_rotator_pipe_reserve(rot->next);