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

Commit 3b242a9f authored by Fuad Hossain's avatar Fuad Hossain
Browse files

drm/msm/dp: fix mst mode switch issue



During a mode switch operation, the connector is
detached from the mst bridge, but not reattached
via the atomic_best_encoder function. Cache the
old connector info in the mst bridge, and
reconnect it in the bridge_mode_set function.
Clear the old connector info in the
bridge_pre_enable to disallow new connections
from using the old configuration.

CRs-Fixed: 2325207
Change-Id: I8524be6843c4b0a9f0ba02a75aedbc51dd9e6377
Signed-off-by: default avatarFuad Hossain <fhossain@codeaurora.org>
parent 1986b053
Loading
Loading
Loading
Loading
+21 −4
Original line number Diff line number Diff line
@@ -102,7 +102,9 @@ struct dp_mst_bridge {
	struct drm_display_mode drm_mode;
	struct dp_display_mode dp_mode;
	struct drm_connector *connector;
	struct drm_connector *old_connector;
	void *dp_panel;
	void *old_dp_panel;

	int vcpi;
	int pbn;
@@ -691,6 +693,9 @@ static void dp_mst_bridge_pre_enable(struct drm_bridge *drm_bridge)
	bridge = to_dp_mst_bridge(drm_bridge);
	dp = bridge->display;

	bridge->old_connector = NULL;
	bridge->old_dp_panel = NULL;

	if (!bridge->connector) {
		pr_err("Invalid connector\n");
		return;
@@ -841,6 +846,10 @@ static void dp_mst_bridge_post_disable(struct drm_bridge *drm_bridge)
	/* maintain the connector to encoder link during suspend/resume */
	if (mst->state != PM_SUSPEND) {
		/* Disconnect the connector and panel info from bridge */
		mst->mst_bridge[bridge->id].old_connector =
				mst->mst_bridge[bridge->id].connector;
		mst->mst_bridge[bridge->id].old_dp_panel =
				mst->mst_bridge[bridge->id].dp_panel;
		mst->mst_bridge[bridge->id].connector = NULL;
		mst->mst_bridge[bridge->id].dp_panel = NULL;
		mst->mst_bridge[bridge->id].encoder_active_sts = false;
@@ -865,14 +874,22 @@ static void dp_mst_bridge_mode_set(struct drm_bridge *drm_bridge,

	bridge = to_dp_mst_bridge(drm_bridge);
	if (!bridge->connector) {
		if (!bridge->old_connector) {
			pr_err("Invalid connector\n");
			return;
		}
		bridge->connector = bridge->old_connector;
		bridge->old_connector = NULL;
	}

	if (!bridge->dp_panel) {
		if (!bridge->old_dp_panel) {
			pr_err("Invalid dp_panel\n");
			return;
		}
		bridge->dp_panel = bridge->old_dp_panel;
		bridge->old_dp_panel = NULL;
	}

	dp = bridge->display;