Removing delays from intel_dp.
Replacing intel_dp PPS delays with intel_panel PPS delays.
This is part of removing all refs to PPS in intel_dp and moving it to
PPS in intel_panel.

Signed-off-by: Vandana Kannan <vandana.kan...@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c  | 22 +++++++++++++++-------
 drivers/gpu/drm/i915/intel_drv.h |  5 -----
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index ca11eb1..bdb8317 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -497,6 +497,7 @@ static int edp_notify_handler(struct notifier_block *this, 
unsigned long code,
                                                 edp_notifier);
        struct drm_device *dev = intel_dp_to_dev(intel_dp);
        struct drm_i915_private *dev_priv = dev->dev_private;
+       struct intel_connector *intel_connector = intel_dp->attached_connector;
        u32 pp_div;
        u32 pp_ctrl_reg, pp_div_reg;
 
@@ -516,7 +517,7 @@ static int edp_notify_handler(struct notifier_block *this, 
unsigned long code,
                /* 0x1F write to PP_DIV_REG sets max cycle delay */
                I915_WRITE(pp_div_reg, pp_div | 0x1F);
                I915_WRITE(pp_ctrl_reg, PANEL_UNLOCK_REGS | PANEL_POWER_OFF);
-               msleep(intel_dp->panel_power_cycle_delay);
+               msleep(intel_connector->panel.pps.panel_power_cycle_delay);
        }
 
        pps_unlock(intel_dp);
@@ -1321,26 +1322,29 @@ static void wait_panel_off(struct intel_dp *intel_dp)
 
 static void wait_panel_power_cycle(struct intel_dp *intel_dp)
 {
+       struct intel_connector *intel_connector = intel_dp->attached_connector;
        DRM_DEBUG_KMS("Wait for panel power cycle\n");
 
        /* When we disable the VDD override bit last we have to do the manual
         * wait. */
        wait_remaining_ms_from_jiffies(intel_dp->last_power_cycle,
-                                      intel_dp->panel_power_cycle_delay);
+                       intel_connector->panel.pps.panel_power_cycle_delay);
 
        wait_panel_status(intel_dp, IDLE_CYCLE_MASK, IDLE_CYCLE_VALUE);
 }
 
 static void wait_backlight_on(struct intel_dp *intel_dp)
 {
+       struct intel_connector *intel_connector = intel_dp->attached_connector;
        wait_remaining_ms_from_jiffies(intel_dp->last_power_on,
-                                      intel_dp->backlight_on_delay);
+                       intel_connector->panel.pps.backlight_on_delay);
 }
 
 static void edp_wait_backlight_off(struct intel_dp *intel_dp)
 {
+       struct intel_connector *intel_connector = intel_dp->attached_connector;
        wait_remaining_ms_from_jiffies(intel_dp->last_backlight_off,
-                                      intel_dp->backlight_off_delay);
+                       intel_connector->panel.pps.backlight_off_delay);
 }
 
 /* Read the current pp_control value, unlocking the register if it
@@ -1371,6 +1375,7 @@ 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 intel_connector *intel_connector = intel_dp->attached_connector;
        struct drm_i915_private *dev_priv = dev->dev_private;
        enum intel_display_power_domain power_domain;
        u32 pp;
@@ -1410,7 +1415,7 @@ static bool edp_panel_vdd_on(struct intel_dp *intel_dp)
         */
        if (!edp_have_panel_power(intel_dp)) {
                DRM_DEBUG_KMS("eDP was not running\n");
-               msleep(intel_dp->panel_power_up_delay);
+               msleep(intel_connector->panel.pps.panel_power_up_delay);
        }
 
        return need_to_disable;
@@ -1490,6 +1495,7 @@ static void edp_panel_vdd_work(struct work_struct *__work)
 
 static void edp_panel_vdd_schedule_off(struct intel_dp *intel_dp)
 {
+       struct intel_connector *intel_connector = intel_dp->attached_connector;
        unsigned long delay;
 
        /*
@@ -1497,7 +1503,8 @@ static void edp_panel_vdd_schedule_off(struct intel_dp 
*intel_dp)
         * down delay) to keep the panel power up across a sequence of
         * operations.
         */
-       delay = msecs_to_jiffies(intel_dp->panel_power_cycle_delay * 5);
+       delay = msecs_to_jiffies(
+               intel_connector->panel.pps.panel_power_cycle_delay * 5);
        schedule_delayed_work(&intel_dp->panel_vdd_work, delay);
 }
 
@@ -3702,6 +3709,7 @@ static void
 intel_dp_link_down(struct intel_dp *intel_dp)
 {
        struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
+       struct intel_connector *intel_connector = intel_dp->attached_connector;
        enum port port = intel_dig_port->port;
        struct drm_device *dev = intel_dig_port->base.base.dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3760,7 +3768,7 @@ intel_dp_link_down(struct intel_dp *intel_dp)
        DP &= ~DP_AUDIO_OUTPUT_ENABLE;
        I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN);
        POSTING_READ(intel_dp->output_reg);
-       msleep(intel_dp->panel_power_down_delay);
+       msleep(intel_connector->panel.pps.panel_power_down_delay);
 }
 
 static bool
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 4ae913c..f99cbc5 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -581,11 +581,6 @@ struct intel_dp {
        uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
        struct drm_dp_aux aux;
        uint8_t train_set[4];
-       int panel_power_up_delay;
-       int panel_power_down_delay;
-       int panel_power_cycle_delay;
-       int backlight_on_delay;
-       int backlight_off_delay;
        struct delayed_work panel_vdd_work;
        bool want_panel_vdd;
        unsigned long last_power_cycle;
-- 
2.0.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to