drm/i915: improve modeset state checking after dpms calls
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 31 Aug 2012 15:37:33 +0000 (17:37 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 6 Sep 2012 06:21:31 +0000 (08:21 +0200)
Now that we have solid modeset state tracking and checking code in
place, we can do the Full Monty also after dpms calls.

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_crt.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_dvo.c
drivers/gpu/drm/i915/intel_sdvo.c

index cca266f72a4c397f22944da5d94cb12cc1f8194e..b9f08f66a4a42a6157869aaa86ca8bff438ec2a2 100644 (file)
@@ -177,7 +177,7 @@ static void intel_crt_dpms(struct drm_connector *connector, int mode)
                intel_crtc_update_dpms(crtc);
        }
 
-       intel_connector_check_state(to_intel_connector(connector));
+       intel_modeset_check_state(connector->dev);
 }
 
 static int intel_crt_mode_valid(struct drm_connector *connector,
index d15fa0c6ae8877545f27926079db6a55c023611f..44318bf8e7b9be55ffd30e6ee6fa534db2ddd2b0 100644 (file)
@@ -3585,7 +3585,7 @@ void intel_encoder_dpms(struct intel_encoder *encoder, int mode)
 
 /* Cross check the actual hw state with our own modeset state tracking (and it's
  * internal consistency). */
-void intel_connector_check_state(struct intel_connector *connector)
+static void intel_connector_check_state(struct intel_connector *connector)
 {
        if (connector->get_hw_state(connector)) {
                struct intel_encoder *encoder = connector->encoder;
@@ -3639,7 +3639,7 @@ void intel_connector_dpms(struct drm_connector *connector, int mode)
        else
                WARN_ON(encoder->connectors_active != false);
 
-       intel_connector_check_state(to_intel_connector(connector));
+       intel_modeset_check_state(connector->dev);
 }
 
 /* Simple connector->get_hw_state implementation for encoders that support only
@@ -6872,7 +6872,7 @@ intel_modeset_update_state(struct drm_device *dev, unsigned prepare_pipes)
                            base.head) \
                if (mask & (1 <<(intel_crtc)->pipe)) \
 
-static void
+void
 intel_modeset_check_state(struct drm_device *dev)
 {
        struct intel_crtc *crtc;
index 3b1c407699c7d32155014fdf08ff75e4650beafe..d391e67231b7fd7545d94be4c3bb65de78fd40d3 100644 (file)
@@ -1362,7 +1362,7 @@ intel_dp_dpms(struct drm_connector *connector, int mode)
                intel_encoder_dpms(&intel_dp->base, mode);
        }
 
-       intel_connector_check_state(to_intel_connector(connector));
+       intel_modeset_check_state(connector->dev);
 }
 
 /*
index 2061399d92c1c975a628bae4540103b8e397d354..19e69285ba3134305b157943c87c1da448589624 100644 (file)
@@ -455,7 +455,8 @@ extern void intel_encoder_dpms(struct intel_encoder *encoder, int mode);
 extern bool intel_encoder_check_is_cloned(struct intel_encoder *encoder);
 extern void intel_connector_dpms(struct drm_connector *, int mode);
 extern bool intel_connector_get_hw_state(struct intel_connector *connector);
-extern void intel_connector_check_state(struct intel_connector *);
+extern void intel_modeset_check_state(struct drm_device *dev);
+
 
 static inline struct intel_encoder *intel_attached_encoder(struct drm_connector *connector)
 {
index aa1bf57963b19664f3a8c5aa44c5ca6f8cb6ca40..4f1fdcc4400588929b36e33f7cc4b8f4732b0031 100644 (file)
@@ -189,7 +189,7 @@ static void intel_dvo_dpms(struct drm_connector *connector, int mode)
                intel_crtc_update_dpms(crtc);
        }
 
-       intel_connector_check_state(to_intel_connector(connector));
+       intel_modeset_check_state(connector->dev);
 }
 
 static int intel_dvo_mode_valid(struct drm_connector *connector,
index 6f538719b727e0929cdbf88bf6e25fc940e20495..07d39212dcad6d22adf58d2b1d5ee9c892d14b10 100644 (file)
@@ -1275,7 +1275,7 @@ static void intel_sdvo_dpms(struct drm_connector *connector, int mode)
                intel_sdvo_set_active_outputs(intel_sdvo, intel_sdvo->attached_output);
        }
 
-       intel_connector_check_state(to_intel_connector(connector));
+       intel_modeset_check_state(connector->dev);
 }
 
 static int intel_sdvo_mode_valid(struct drm_connector *connector,