drm: Don't try and disable an encoder that was never enabled
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 6 Dec 2010 11:24:07 +0000 (11:24 +0000)
committerDave Airlie <airlied@redhat.com>
Tue, 7 Dec 2010 23:33:02 +0000 (09:33 +1000)
Prevents code that assumes that the encoder is active when asked to be
disabled from dying a horrible death.

Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_crtc_helper.c

index 7ca59359fee2c83187f9cacc022d4af78bf67dd5..bede10a0340700b69717caf1da8e81ee0546ab00 100644 (file)
@@ -241,7 +241,7 @@ void drm_helper_disable_unused_functions(struct drm_device *dev)
        }
 
        list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
-               if (!drm_helper_encoder_in_use(encoder)) {
+               if (encoder->crtc && !drm_helper_encoder_in_use(encoder)) {
                        drm_encoder_disable(encoder);
                        /* disconnector encoder from any connector */
                        encoder->crtc = NULL;