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

Commit 3039994c authored by Shubhashree Dhar's avatar Shubhashree Dhar Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: check for ppsplit topology from current state



During pm suspend-resume cases, topology is reset and ppsplit
flag is set to false based on previous connector state. This
leads to incorrect interface config resulting in pptimeout.
Made changes to update the ppsplit flag based on current
connector state to avoid this.

Change-Id: Id42313036eda98e5109083b0d57a778f1262f3fd
Signed-off-by: default avatarShubhashree Dhar <dhar@codeaurora.org>
parent ab872dd5
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -1408,8 +1408,10 @@ static u32 _sde_crtc_get_displays_affected(struct drm_crtc *crtc,
{
	struct sde_crtc *sde_crtc;
	struct sde_crtc_state *crtc_state;
	struct drm_encoder *encoder;
	u32 disp_bitmask = 0;
	int i;
	bool is_ppsplit = false;

	if (!crtc || !state) {
		pr_err("Invalid crtc or state\n");
@@ -1419,8 +1421,16 @@ static u32 _sde_crtc_get_displays_affected(struct drm_crtc *crtc,
	sde_crtc = to_sde_crtc(crtc);
	crtc_state = to_sde_crtc_state(state);

	list_for_each_entry(encoder,
			&crtc->dev->mode_config.encoder_list, head) {
		if (encoder->crtc != state->crtc)
			continue;

		is_ppsplit |= sde_encoder_is_topology_ppsplit(encoder);
	}

	/* pingpong split: one ROI, one LM, two physical displays */
	if (crtc_state->is_ppsplit) {
	if (is_ppsplit) {
		u32 lm_split_width = crtc_state->lm_bounds[0].w / 2;
		struct sde_rect *roi = &crtc_state->lm_roi[0];

+18 −0
Original line number Diff line number Diff line
@@ -954,6 +954,24 @@ bool sde_encoder_in_clone_mode(struct drm_encoder *drm_enc)
	return false;
}

bool sde_encoder_is_topology_ppsplit(struct drm_encoder *drm_enc)
{
	struct sde_encoder_virt *sde_enc;
	struct sde_encoder_phys *master;

	if (!drm_enc)
		return false;

	sde_enc = to_sde_encoder_virt(drm_enc);
	master = sde_enc->cur_master;

	if (!master || !master->connector)
		return false;

	return  (sde_connector_get_topology_name(master->connector)
			== SDE_RM_TOPOLOGY_PPSPLIT);
}

static int sde_encoder_virt_atomic_check(
		struct drm_encoder *drm_enc,
		struct drm_crtc_state *crtc_state,
+8 −0
Original line number Diff line number Diff line
@@ -312,6 +312,14 @@ void sde_encoder_recovery_events_handler(struct drm_encoder *encoder,
 */
bool sde_encoder_in_clone_mode(struct drm_encoder *enc);

/**
 *sde_encoder_is_topology_ppsplit - checks if the current encoder is in
	ppsplit topology.
 *@drm_enc:	Pointer to drm encoder structure
 *@Return:	true if the present topology is ppsplit
 */
bool sde_encoder_is_topology_ppsplit(struct drm_encoder *drm_enc);

/**
 * sde_encoder_is_primary_display - checks if underlying display is primary
 *     display or not.