From: Maarten Maathuis Date: Tue, 18 Aug 2009 22:56:45 +0000 (+0200) Subject: drm/crtc_helper: NULL encoder->crtc when switching encoders X-Git-Tag: upstream/snapshot3+hdmi~16628^2~186 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff846ab7f76ffecba4f0bef026163d2a2364d7d0;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git drm/crtc_helper: NULL encoder->crtc when switching encoders - Previously the old encoder would be called during modeset and without a connector bad things happened. Signed-off-by: Maarten Maathuis Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index a3837b3..205349e 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -823,6 +823,10 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) if (new_encoder != connector->encoder) { DRM_DEBUG_KMS("encoder changed, full mode switch\n"); mode_changed = true; + /* If the encoder is reused for another connector, then + * the appropriate crtc will be set later. + */ + connector->encoder->crtc = NULL; connector->encoder = new_encoder; } }