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

Commit 96624d42 authored by Krishna Manikandan's avatar Krishna Manikandan Committed by Abhijith Desai
Browse files

fbdev: msm: Reserve mixers with dspp for primary display



Avoid allocating mixers LM0 and LM1 to external display and
writeback as they are allocated to primary display first.

Change-Id: I343a70dca2e664e5c9765fa2f0b933714b747b4a
Signed-off-by: default avatarKrishna Manikandan <mkrishn@codeaurora.org>
parent ba685975
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -2498,6 +2498,7 @@ struct mdss_mdp_mixer *mdss_mdp_mixer_alloc(
	u32 nmixers_wb;
	u32 i;
	u32 nmixers;
	u32 nmixers_active;
	struct mdss_mdp_mixer *mixer_pool = NULL;

	if (!ctl || !ctl->mdata)
@@ -2511,10 +2512,21 @@ struct mdss_mdp_mixer *mdss_mdp_mixer_alloc(
	case MDSS_MDP_MIXER_TYPE_INTF:
		mixer_pool = ctl->mdata->mixer_intf;
		nmixers = nmixers_intf;
		nmixers_active = nmixers;

		for (i = 0; i < nmixers; i++) {
			mixer = mixer_pool + i;
			if (mixer->ref_cnt)
				nmixers_active--;
		}
		mixer = NULL;

		/*
		 * try to reserve first layer mixer for write back if
		 * assertive display needs to be supported through wfd
		 * assertive display needs to be supported through wfd.
		 * For external displays(pluggable) and writeback avoid
		 * allocating mixers LM0 and LM1 which are allocated
		 * to primary display first.
		 */
		if (ctl->mdata->has_wb_ad && ctl->intf_num &&
			((ctl->panel_data->panel_info.type != MIPI_CMD_PANEL) ||
@@ -2526,6 +2538,10 @@ struct mdss_mdp_mixer *mdss_mdp_mixer_alloc(
			&& (ctl->mdata->ndspp < nmixers)) {
			mixer_pool += ctl->mdata->ndspp;
			nmixers -= ctl->mdata->ndspp;
		} else if ((ctl->panel_data->panel_info.is_pluggable) &&
				nmixers_active) {
			mixer_pool += ctl->mdata->ndspp;
			nmixers -= ctl->mdata->ndspp;
		}
		break;