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

Commit 1bbbef1a authored by Ujwal Patel's avatar Ujwal Patel
Browse files

msm: mdss: add support for rotator in mdss_mdp_mixer_get



Currently ctl->mfd is not populated for rotator sessions. If
mdss_mdp_mixer_get is called by rotator session then it will always
fail the NULL check for ctl->mfd. This will flood the logs for every
rotator commit and can lead to un-predictable outcome. Fix this by
properly handling rotator case in mdss_mdp_mixer_get.

Change-Id: Ib1896149302bd60b99028ae26df2393fab30dd6e
Signed-off-by: default avatarUjwal Patel <ujwalp@codeaurora.org>
parent 7bbebd78
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -2267,25 +2267,30 @@ struct mdss_mdp_mixer *mdss_mdp_mixer_get(struct mdss_mdp_ctl *ctl, int mux)
{
	struct mdss_mdp_mixer *mixer = NULL;
	struct mdss_overlay_private *mdp5_data = NULL;
	if (!ctl || !ctl->mfd) {
	bool is_mixer_swapped = false;

	if (!ctl) {
		pr_err("ctl not initialized\n");
		return NULL;
	}

	if (ctl->mfd) {
		mdp5_data = mfd_to_mdp5_data(ctl->mfd);
		if (!mdp5_data) {
		pr_err("ctl not initialized\n");
			pr_err("mdp5_data not initialized\n");
			return NULL;
		}
		is_mixer_swapped = mdp5_data->mixer_swap;
	}

	switch (mux) {
	case MDSS_MDP_MIXER_MUX_DEFAULT:
	case MDSS_MDP_MIXER_MUX_LEFT:
		mixer = mdp5_data->mixer_swap ?
		mixer = is_mixer_swapped ?
			ctl->mixer_right : ctl->mixer_left;
		break;
	case MDSS_MDP_MIXER_MUX_RIGHT:
		mixer = mdp5_data->mixer_swap ?
		mixer = is_mixer_swapped ?
			ctl->mixer_left : ctl->mixer_right;
		break;
	}