drm/i915: vlv: get power domain for eDP vdd
authorImre Deak <imre.deak@intel.com>
Thu, 27 Mar 2014 15:45:11 +0000 (17:45 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 1 Apr 2014 20:58:18 +0000 (22:58 +0200)
Besides D0 device state we need the proper power wells to be on on
some platforms, so get the port power domain reference instead of an RPM
reference.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Antti Koskipää <antti.koskipaa@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_dp.c

index 44471ccdc3852f57ce56ece598da0f1a57fd592a..67d8173ac21e472ab38dc0d8a9ceae037dafee56 100644 (file)
@@ -1043,7 +1043,10 @@ static  u32 ironlake_get_pp_control(struct intel_dp *intel_dp)
 static bool _edp_panel_vdd_on(struct intel_dp *intel_dp)
 {
        struct drm_device *dev = intel_dp_to_dev(intel_dp);
+       struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
+       struct intel_encoder *intel_encoder = &intel_dig_port->base;
        struct drm_i915_private *dev_priv = dev->dev_private;
+       enum intel_display_power_domain power_domain;
        u32 pp;
        u32 pp_stat_reg, pp_ctrl_reg;
        bool need_to_disable = !intel_dp->want_panel_vdd;
@@ -1056,7 +1059,8 @@ static bool _edp_panel_vdd_on(struct intel_dp *intel_dp)
        if (edp_have_panel_vdd(intel_dp))
                return need_to_disable;
 
-       intel_runtime_pm_get(dev_priv);
+       power_domain = intel_display_port_power_domain(intel_encoder);
+       intel_display_power_get(dev_priv, power_domain);
 
        DRM_DEBUG_KMS("Turning eDP VDD on\n");
 
@@ -1103,6 +1107,11 @@ static void edp_panel_vdd_off_sync(struct intel_dp *intel_dp)
        WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
 
        if (!intel_dp->want_panel_vdd && edp_have_panel_vdd(intel_dp)) {
+               struct intel_digital_port *intel_dig_port =
+                                               dp_to_dig_port(intel_dp);
+               struct intel_encoder *intel_encoder = &intel_dig_port->base;
+               enum intel_display_power_domain power_domain;
+
                DRM_DEBUG_KMS("Turning eDP VDD off\n");
 
                pp = ironlake_get_pp_control(intel_dp);
@@ -1121,7 +1130,8 @@ static void edp_panel_vdd_off_sync(struct intel_dp *intel_dp)
                if ((pp & POWER_TARGET_ON) == 0)
                        intel_dp->last_power_cycle = jiffies;
 
-               intel_runtime_pm_put(dev_priv);
+               power_domain = intel_display_port_power_domain(intel_encoder);
+               intel_display_power_put(dev_priv, power_domain);
        }
 }
 
@@ -1205,8 +1215,11 @@ void intel_edp_panel_on(struct intel_dp *intel_dp)
 
 void intel_edp_panel_off(struct intel_dp *intel_dp)
 {
+       struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
+       struct intel_encoder *intel_encoder = &intel_dig_port->base;
        struct drm_device *dev = intel_dp_to_dev(intel_dp);
        struct drm_i915_private *dev_priv = dev->dev_private;
+       enum intel_display_power_domain power_domain;
        u32 pp;
        u32 pp_ctrl_reg;
 
@@ -1236,7 +1249,8 @@ void intel_edp_panel_off(struct intel_dp *intel_dp)
        wait_panel_off(intel_dp);
 
        /* We got a reference when we enabled the VDD. */
-       intel_runtime_pm_put(dev_priv);
+       power_domain = intel_display_port_power_domain(intel_encoder);
+       intel_display_power_put(dev_priv, power_domain);
 }
 
 void intel_edp_backlight_on(struct intel_dp *intel_dp)