drm/i915: Use atomic state in tv load detection.
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 17 Feb 2016 08:18:37 +0000 (09:18 +0100)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Thu, 18 Feb 2016 09:41:49 +0000 (10:41 +0100)
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1455697119-31416-4-git-send-email-maarten.lankhorst@linux.intel.com
drivers/gpu/drm/i915/intel_tv.c

index d21f75bda96e0aa173ff077d6335286845c556a3..6745bad5bff065bd594506077e2ea95949b12a29 100644 (file)
@@ -1182,10 +1182,9 @@ static int
 intel_tv_detect_type(struct intel_tv *intel_tv,
                      struct drm_connector *connector)
 {
-       struct drm_encoder *encoder = &intel_tv->base.base;
-       struct drm_crtc *crtc = encoder->crtc;
+       struct drm_crtc *crtc = connector->state->crtc;
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-       struct drm_device *dev = encoder->dev;
+       struct drm_device *dev = connector->dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
        u32 tv_ctl, save_tv_ctl;
        u32 tv_dac, save_tv_dac;
@@ -1234,8 +1233,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
        I915_WRITE(TV_DAC, tv_dac);
        POSTING_READ(TV_DAC);
 
-       intel_wait_for_vblank(intel_tv->base.base.dev,
-                             to_intel_crtc(intel_tv->base.base.crtc)->pipe);
+       intel_wait_for_vblank(dev, intel_crtc->pipe);
 
        type = -1;
        tv_dac = I915_READ(TV_DAC);
@@ -1265,8 +1263,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
        POSTING_READ(TV_CTL);
 
        /* For unknown reasons the hw barfs if we don't do this vblank wait. */
-       intel_wait_for_vblank(intel_tv->base.base.dev,
-                             to_intel_crtc(intel_tv->base.base.crtc)->pipe);
+       intel_wait_for_vblank(dev, intel_crtc->pipe);
 
        /* Restore interrupt config */
        if (connector->polled & DRM_CONNECTOR_POLL_HPD) {