Commit d28d4731 authored by Abhay Kumar's avatar Abhay Kumar Committed by Daniel Vetter

drm/i915: edp resume/On time optimization.

Make resume/on codepath not to wait for panel_power_cycle_delay(t11_t12)
if this time is already spent in suspend/poweron time.

v2: Use CLOCK_BOOTTIME and remove jiffies for panel power cycle
    delay calculation(Ville).

v3: Addressed below comments
    1. Tracking time from where last powercycle is initiated.
    2. Used ktime_get_bootime() wrapper for boottime clock.
    3. Used ktime_ms_delta() to get time difference.

v4: Updated v3 change log in detail.

v5: Removed static from panel_power_on_time(Stéphane).

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarAbhay Kumar <abhay.kumar@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1453513144-14135-1-git-send-email-abhay.kumar@intel.com
parent 05fd934b
...@@ -1815,12 +1815,21 @@ static void wait_panel_off(struct intel_dp *intel_dp) ...@@ -1815,12 +1815,21 @@ static void wait_panel_off(struct intel_dp *intel_dp)
static void wait_panel_power_cycle(struct intel_dp *intel_dp) static void wait_panel_power_cycle(struct intel_dp *intel_dp)
{ {
ktime_t panel_power_on_time;
s64 panel_power_off_duration;
DRM_DEBUG_KMS("Wait for panel power cycle\n"); DRM_DEBUG_KMS("Wait for panel power cycle\n");
/* take the difference of currrent time and panel power off time
* and then make panel wait for t11_t12 if needed. */
panel_power_on_time = ktime_get_boottime();
panel_power_off_duration = ktime_ms_delta(panel_power_on_time, intel_dp->panel_power_off_time);
/* When we disable the VDD override bit last we have to do the manual /* When we disable the VDD override bit last we have to do the manual
* wait. */ * wait. */
wait_remaining_ms_from_jiffies(intel_dp->last_power_cycle, if (panel_power_off_duration < (s64)intel_dp->panel_power_cycle_delay)
intel_dp->panel_power_cycle_delay); wait_remaining_ms_from_jiffies(jiffies,
intel_dp->panel_power_cycle_delay - panel_power_off_duration);
wait_panel_status(intel_dp, IDLE_CYCLE_MASK, IDLE_CYCLE_VALUE); wait_panel_status(intel_dp, IDLE_CYCLE_MASK, IDLE_CYCLE_VALUE);
} }
...@@ -1972,7 +1981,7 @@ static void edp_panel_vdd_off_sync(struct intel_dp *intel_dp) ...@@ -1972,7 +1981,7 @@ static void edp_panel_vdd_off_sync(struct intel_dp *intel_dp)
I915_READ(pp_stat_reg), I915_READ(pp_ctrl_reg)); I915_READ(pp_stat_reg), I915_READ(pp_ctrl_reg));
if ((pp & POWER_TARGET_ON) == 0) if ((pp & POWER_TARGET_ON) == 0)
intel_dp->last_power_cycle = jiffies; intel_dp->panel_power_off_time = ktime_get_boottime();
power_domain = intel_display_port_aux_power_domain(intel_encoder); power_domain = intel_display_port_aux_power_domain(intel_encoder);
intel_display_power_put(dev_priv, power_domain); intel_display_power_put(dev_priv, power_domain);
...@@ -2121,7 +2130,7 @@ static void edp_panel_off(struct intel_dp *intel_dp) ...@@ -2121,7 +2130,7 @@ static void edp_panel_off(struct intel_dp *intel_dp)
I915_WRITE(pp_ctrl_reg, pp); I915_WRITE(pp_ctrl_reg, pp);
POSTING_READ(pp_ctrl_reg); POSTING_READ(pp_ctrl_reg);
intel_dp->last_power_cycle = jiffies; intel_dp->panel_power_off_time = ktime_get_boottime();
wait_panel_off(intel_dp); wait_panel_off(intel_dp);
/* We got a reference when we enabled the VDD. */ /* We got a reference when we enabled the VDD. */
...@@ -5120,7 +5129,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect ...@@ -5120,7 +5129,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect
static void intel_dp_init_panel_power_timestamps(struct intel_dp *intel_dp) static void intel_dp_init_panel_power_timestamps(struct intel_dp *intel_dp)
{ {
intel_dp->last_power_cycle = jiffies; intel_dp->panel_power_off_time = ktime_get_boottime();
intel_dp->last_power_on = jiffies; intel_dp->last_power_on = jiffies;
intel_dp->last_backlight_off = jiffies; intel_dp->last_backlight_off = jiffies;
} }
......
...@@ -771,9 +771,9 @@ struct intel_dp { ...@@ -771,9 +771,9 @@ struct intel_dp {
int backlight_off_delay; int backlight_off_delay;
struct delayed_work panel_vdd_work; struct delayed_work panel_vdd_work;
bool want_panel_vdd; bool want_panel_vdd;
unsigned long last_power_cycle;
unsigned long last_power_on; unsigned long last_power_on;
unsigned long last_backlight_off; unsigned long last_backlight_off;
ktime_t panel_power_off_time;
struct notifier_block edp_notifier; struct notifier_block edp_notifier;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment