[Intel-gfx] [PATCH RFC 3/8] drm: Trigger a complete modeset if link_train_retry is set

Manasi Navare manasi.d.navare at intel.com
Wed Oct 19 21:46:19 UTC 2016


The link_train_retry property of the connector needs to be checked
to see if a full modeset is required. If this is set, then link train
retry is requested possibly due to linktrain failure in the previous
modeset. Hence we need to indicate connector status changed in order to
trigger a full modeset.

Cc: dri-devel at lists.freedesktop.org
Cc: Jani Nikula <jani.nikula at linux.intel.com>
Cc: Daniel Vetter <daniel.vetter at intel.com>
Cc: Ville Syrjala <ville.syrjala at linux.intel.com>
Signed-off-by: Manasi Navare <manasi.d.navare at intel.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 9 +++++++++
 drivers/gpu/drm/drm_fb_helper.c     | 3 ++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 07b432f..aeb2215 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -517,6 +517,15 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state,
 		 */
 		ret = update_connector_routing(state, connector,
 					       connector_state);
+		/* Set crtc->mode_changed and crtc->connectors_changed if
+		 * link_train_retry flag is set in the connector.
+		 */
+		if (connector->link_train_retry) {
+			crtc_state = drm_atomic_get_existing_crtc_state(state,
+									connector->state->crtc);
+			crtc_state->connectors_changed = true;
+			crtc_state->mode_changed = true;
+		}
 		if (ret)
 			return ret;
 	}
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 8fffac8..b408e62 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -2152,7 +2152,8 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper)
 			fb_crtc->desired_mode = mode;
 			fb_crtc->x = offset->x;
 			fb_crtc->y = offset->y;
-			if (modeset->mode)
+			if (modeset->mode &&
+			    !(fb_helper->connector_info[i]->connector->link_train_retry))
 				drm_mode_destroy(dev, modeset->mode);
 			modeset->mode = drm_mode_duplicate(dev,
 							   fb_crtc->desired_mode);
-- 
1.9.1



More information about the Intel-gfx mailing list