Commit 821112aa authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: simplify intel_crtc_prepare_encoders

- We don't have the ->get_crtc callback.
- Call intel_encoder->disable directly.
Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent a6778b3c
...@@ -6635,32 +6635,15 @@ intel_crtc_helper_disable(struct drm_crtc *crtc) ...@@ -6635,32 +6635,15 @@ intel_crtc_helper_disable(struct drm_crtc *crtc)
return 0; 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 static void
intel_crtc_prepare_encoders(struct drm_device *dev) intel_crtc_prepare_encoders(struct drm_device *dev)
{ {
struct drm_encoder_helper_funcs *encoder_funcs; struct intel_encoder *encoder;
struct drm_encoder *encoder;
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.head) {
encoder_funcs = encoder->helper_private;
/* Disable unused encoders */ /* Disable unused encoders */
if (encoder->crtc == NULL) if (encoder->base.crtc == NULL)
intel_encoder_disable_helper(encoder); encoder->disable(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);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment