]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/crtc_helper: NULL encoder->crtc when switching encoders
authorMaarten Maathuis <madman2003@gmail.com>
Tue, 18 Aug 2009 22:56:45 +0000 (00:56 +0200)
committerDave Airlie <airlied@redhat.com>
Sun, 30 Aug 2009 23:09:29 +0000 (09:09 +1000)
- Previously the old encoder would be called during modeset and without a connector bad things happened.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_crtc_helper.c

index a3837b39bb8f64290ac1599c16e263fc1bbb19b8..205349ea1075f29c114774627307b05ce1247967 100644 (file)
@@ -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;
                }
        }