drm/i915: simplify intel_crtc_prepare_encoders
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 2 Jul 2012 08:16:35 +0000 (10:16 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 6 Sep 2012 05:57:03 +0000 (07:57 +0200)
- We don't have the ->get_crtc callback.
- Call intel_encoder->disable directly.

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index 3e119a62888da1ebd172435c18e4be252a2ca0b0..343f99104c39bd083032d5444cc32d975dbf0643 100644 (file)
@@ -6635,32 +6635,15 @@ intel_crtc_helper_disable(struct drm_crtc *crtc)
        return 0;
 }
 
-static void
-intel_encoder_disable_helper(struct drm_encoder *encoder)
-{
-       struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
-
-       if (encoder_funcs->disable)
-               (*encoder_funcs->disable)(encoder);
-       else
-               (*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF);
-}
-
 static void
 intel_crtc_prepare_encoders(struct drm_device *dev)
 {
-       struct drm_encoder_helper_funcs *encoder_funcs;
-       struct drm_encoder *encoder;
+       struct intel_encoder *encoder;
 
-       list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
-               encoder_funcs = encoder->helper_private;
+       list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.head) {
                /* Disable unused encoders */
-               if (encoder->crtc == NULL)
-                       intel_encoder_disable_helper(encoder);
-               /* Disable encoders whose CRTC is about to change */
-               if (encoder_funcs->get_crtc &&
-                   encoder->crtc != (*encoder_funcs->get_crtc)(encoder))
-                       intel_encoder_disable_helper(encoder);
+               if (encoder->base.crtc == NULL)
+                       encoder->disable(encoder);
        }
 }