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

Commit a245be26 authored by Jayaprakash Madisetty's avatar Jayaprakash Madisetty
Browse files

disp: msm: sde: add changes to allocate compatible cwb mixers in RM



This change parses new dt property CWB_MIXER_MASK, which signifies
the compatible mixer_mask for the corresponding CWB block.
During mixer allocation for CWB usecase, we use this cwb_mixer_mask
to decide compatible mixers for built-in primary and secondary displays.

In the current issue case, mixer allocation is as below in
multi display usecase:

primary: LM0
secondary: LM1
external: LM2

RM loops through available mixers and tries to allocate LM3 when
CWB is triggered on primary display. But from HW perspective,
LM0 is not muxed to LM3 causing wb timeouts. With current change
LM3 gets skipped and LM4 gets allocated.

Change-Id: I95ce16a083c9b9976a9dff309d7754085ee08958
Signed-off-by: default avatarJayaprakash Madisetty <jmadiset@codeaurora.org>
parent 8a46f8f3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1833,7 +1833,7 @@ static int _sde_connector_lm_preference(struct sde_connector *sde_conn,
		return -EINVAL;
	}

	sde_hw_mixer_set_preference(sde_kms->catalog, num_lm, disp_type);
	sde_conn->lm_mask = sde_hw_mixer_set_preference(sde_kms->catalog, num_lm, disp_type);

	return ret;
}
+1 −0
Original line number Diff line number Diff line
@@ -547,6 +547,7 @@ struct sde_connector {
	bool hdr_supported;

	u32 color_enc_fmt;
	u32 lm_mask;

	u8 hdr_plus_app_ver;
	u32 qsync_mode;
+2 −4
Original line number Diff line number Diff line
@@ -267,13 +267,11 @@ static int _sde_encoder_wait_timeout(int32_t drm_id, int32_t hw_id,
	return rc;
}

bool sde_encoder_is_primary_display(struct drm_encoder *drm_enc)
u32 sde_encoder_get_display_type(struct drm_encoder *drm_enc)
{
	struct sde_encoder_virt *sde_enc = to_sde_encoder_virt(drm_enc);

	return sde_enc &&
		(sde_enc->disp_info.display_type ==
		SDE_CONNECTOR_PRIMARY);
	return sde_enc ? sde_enc->disp_info.display_type : 0;
}

bool sde_encoder_is_dsi_display(struct drm_encoder *drm_enc)
+4 −4
Original line number Diff line number Diff line
@@ -523,12 +523,12 @@ bool sde_encoder_is_cwb_disabling(struct drm_encoder *drm_enc,
	struct drm_crtc *drm_crtc);

/**
 * sde_encoder_is_primary_display - checks if underlying display is primary
 *     display or not.
 * sde_encoder_get_display_type - returns the display_type of underlying
 *     display
 * @drm_enc:    Pointer to drm encoder structure
 * @Return:     true if it is primary display. false if secondary display
 * @Return:     display_type
 */
bool sde_encoder_is_primary_display(struct drm_encoder *enc);
u32 sde_encoder_get_display_type(struct drm_encoder *enc);

/**
 * sde_encoder_is_dsi_display - checks if underlying display is DSI
+11 −2
Original line number Diff line number Diff line
@@ -425,6 +425,7 @@ enum {
	MIXER_BLOCKS,
	MIXER_DISP,
	MIXER_CWB,
	MIXER_CWB_MASK,
	MIXER_PROP_MAX,
};

@@ -710,6 +711,7 @@ static struct sde_prop_type mixer_prop[] = {
		PROP_TYPE_STRING_ARRAY},
	{MIXER_CWB, "qcom,sde-mixer-cwb-pref", false,
		PROP_TYPE_STRING_ARRAY},
	{MIXER_CWB_MASK, "qcom,sde-mixer-cwb-mask", false, PROP_TYPE_U32_ARRAY},
};

static struct sde_prop_type mixer_blocks_prop[] = {
@@ -1976,10 +1978,10 @@ void sde_hw_ctl_set_preference(struct sde_mdss_cfg *sde_cfg,
	}
}

void sde_hw_mixer_set_preference(struct sde_mdss_cfg *sde_cfg, u32 num_lm,
u32 sde_hw_mixer_set_preference(struct sde_mdss_cfg *sde_cfg, u32 num_lm,
		uint32_t disp_type)
{
	u32 i, cnt = 0, sec_cnt = 0;
	u32 i, cnt = 0, sec_cnt = 0, lm_mask = 0;

	if (disp_type == SDE_CONNECTOR_PRIMARY) {
		for (i = 0; i < sde_cfg->mixer_count; i++) {
@@ -1998,6 +2000,7 @@ void sde_hw_mixer_set_preference(struct sde_mdss_cfg *sde_cfg, u32 num_lm,
			if (cnt < num_lm) {
				set_bit(SDE_DISP_PRIMARY_PREF,
						&sde_cfg->mixer[i].features);
				lm_mask |=  BIT(sde_cfg->mixer[i].id - 1);
				cnt++;
			}

@@ -2036,10 +2039,13 @@ void sde_hw_mixer_set_preference(struct sde_mdss_cfg *sde_cfg, u32 num_lm,
					BIT(SDE_DISP_PRIMARY_PREF))) {
				set_bit(SDE_DISP_SECONDARY_PREF,
						&sde_cfg->mixer[i].features);
				lm_mask |= BIT(sde_cfg->mixer[i].id - 1);
				cnt++;
			}
		}
	}

	return lm_mask;
}

static int sde_mixer_parse_dt(struct device_node *np,
@@ -2151,6 +2157,9 @@ static int sde_mixer_parse_dt(struct device_node *np,
		if (BIT(mixer->id - LM_0) & sde_cfg->cwb_virtual_mixers_mask)
			set_bit(SDE_MIXER_IS_VIRTUAL, &mixer->features);

		mixer->cwb_mask = !props->exists[MIXER_CWB_MASK] ? 0x0 :
				PROP_VALUE_ACCESS(props->values, MIXER_CWB_MASK, i);

		mixer->pingpong = pp_count > 0 ? pp_idx + PINGPONG_0
							: PINGPONG_MAX;
		mixer->dspp = dspp_count > 0 ? dspp_idx + DSPP_0
Loading