diff mbox

[RFC,5/6] drm/i915: Replace all refs to intel_dp delays

Message ID 1412694584-743-6-git-send-email-vandana.kannan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

vandana.kannan@intel.com Oct. 7, 2014, 3:09 p.m. UTC
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.kannan@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 79ccf5a..36c6b3b 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -496,6 +496,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;
 
@@ -515,7 +516,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);
@@ -1320,26 +1321,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
@@ -1370,6 +1374,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;
@@ -1409,7 +1414,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;
@@ -1489,6 +1494,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;
 
 	/*
@@ -1496,7 +1502,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);
 }
 
@@ -3659,6 +3666,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;
@@ -3717,7 +3725,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