From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kumar, Abhay" Subject: Re: [PATCH v4] drm/i915: edp resume/On time optimization. Date: Tue, 19 Jan 2016 14:37:55 -0800 Message-ID: <569EBAC3.9000507@intel.com> References: <1452650255-11125-1-git-send-email-abhay.kumar@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1630631855==" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 69E6E6E087 for ; Tue, 19 Jan 2016 14:38:00 -0800 (PST) In-Reply-To: <1452650255-11125-1-git-send-email-abhay.kumar@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: "Intel-gfx@lists.freedesktop.org" , "ville.syrjala@linux.intel.com" , Daniel Vetter List-Id: intel-gfx@lists.freedesktop.org This is a multi-part message in MIME format. --===============1630631855== Content-Type: multipart/alternative; boundary="------------090007000206080602040107" This is a multi-part message in MIME format. --------------090007000206080602040107 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 1/12/2016 5:57 PM, Kumar, Abhay wrote: > From: Abhay Kumar > > 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. > > Cc: Ville Syrj=C3=A4l=C3=A4 > Signed-off-by: Abhay Kumar > --- > drivers/gpu/drm/i915/intel_dp.c | 19 ++++++++++++++----- > drivers/gpu/drm/i915/intel_drv.h | 2 +- > 2 files changed, 15 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/int= el_dp.c > index 796e3d3..0042693 100644 > --- a/drivers/gpu/drm/i915/intel_dp.c > +++ b/drivers/gpu/drm/i915/intel_dp.c > @@ -1812,12 +1812,21 @@ static void wait_panel_off(struct intel_dp *int= el_dp) > =20 > static void wait_panel_power_cycle(struct intel_dp *intel_dp) > { > + static ktime_t panel_power_on_time; > + s64 panel_power_off_duration; > + > DRM_DEBUG_KMS("Wait for panel power cycle\n"); > =20 > + /* 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 =3D ktime_get_boottime(); > + panel_power_off_duration =3D ktime_ms_delta(panel_power_on_time, inte= l_dp->panel_power_off_time); > + > /* When we disable the VDD override bit last we have to do the manua= l > * wait. */ > - wait_remaining_ms_from_jiffies(intel_dp->last_power_cycle, > - intel_dp->panel_power_cycle_delay); > + if (panel_power_off_duration < (s64)intel_dp->panel_power_cycle_delay= ) > + wait_remaining_ms_from_jiffies(jiffies, > + intel_dp->panel_power_cycle_delay - panel_power_off_duratio= n); > =20 > wait_panel_status(intel_dp, IDLE_CYCLE_MASK, IDLE_CYCLE_VALUE); > } > @@ -1969,7 +1978,7 @@ static void edp_panel_vdd_off_sync(struct intel_d= p *intel_dp) > I915_READ(pp_stat_reg), I915_READ(pp_ctrl_reg)); > =20 > if ((pp & POWER_TARGET_ON) =3D=3D 0) > - intel_dp->last_power_cycle =3D jiffies; > + intel_dp->panel_power_off_time =3D ktime_get_boottime(); > =20 > power_domain =3D intel_display_port_aux_power_domain(intel_encoder); > intel_display_power_put(dev_priv, power_domain); > @@ -2118,7 +2127,7 @@ static void edp_panel_off(struct intel_dp *intel_= dp) > I915_WRITE(pp_ctrl_reg, pp); > POSTING_READ(pp_ctrl_reg); > =20 > - intel_dp->last_power_cycle =3D jiffies; > + intel_dp->panel_power_off_time =3D ktime_get_boottime(); > wait_panel_off(intel_dp); > =20 > /* We got a reference when we enabled the VDD. */ > @@ -5122,7 +5131,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp= , struct drm_connector *connect > =20 > static void intel_dp_init_panel_power_timestamps(struct intel_dp *int= el_dp) > { > - intel_dp->last_power_cycle =3D jiffies; > + intel_dp->panel_power_off_time =3D ktime_get_boottime(); > intel_dp->last_power_on =3D jiffies; > intel_dp->last_backlight_off =3D jiffies; > } > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/in= tel_drv.h > index bdfe403..06b37b8 100644 > --- a/drivers/gpu/drm/i915/intel_drv.h > +++ b/drivers/gpu/drm/i915/intel_drv.h > @@ -793,9 +793,9 @@ struct intel_dp { > int backlight_off_delay; > struct delayed_work panel_vdd_work; > bool want_panel_vdd; > - unsigned long last_power_cycle; > unsigned long last_power_on; > unsigned long last_backlight_off; > + ktime_t panel_power_off_time; > =20 > struct notifier_block edp_notifier; > =20 Since this is already reviewed. Can we please get this Queued for -next ? Regards, Abhay Kumar --------------090007000206080602040107 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

On 1/12/2016 5:57 PM, Kumar, Abhay wrote:
From: Abhay Kumar <abhay.kumar@intel.com>

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.

Cc: Ville Syrj=C3=A4l=C3=A4 <ville.syrjala@linux.intel.com>=

Signed-off-by: Abhay Kumar <abhay.kumar@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c  | 19 ++++++++++++++-----
 drivers/gpu/drm/i915/intel_drv.h |  2 +-
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel=
_dp.c
index 796e3d3..0042693 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1812,12 +1812,21 @@ static void wait_panel_off(struct intel_dp *intel=
_dp)
=20
 static void wait_panel_power_cycle(struct intel_dp *intel_dp)
 {
+	static ktime_t panel_power_on_time;
+	s64 panel_power_off_duration;
+
 	DRM_DEBUG_KMS("Wait for panel power cycle\n");
=20
+	/* 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 =3D ktime_get_boottime();
+	panel_power_off_duration =3D 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
 	 * wait. */
-	wait_remaining_ms_from_jiffies(intel_dp->last_power_cycle,
-				       intel_dp->panel_power_cycle_delay);
+	if (panel_power_off_duration < (s64)intel_dp->panel_power_cycle_d=
elay)
+		wait_remaining_ms_from_jiffies(jiffies,
+				       intel_dp->panel_power_cycle_delay - panel_power_off_durati=
on);
=20
 	wait_panel_status(intel_dp, IDLE_CYCLE_MASK, IDLE_CYCLE_VALUE);
 }
@@ -1969,7 +1978,7 @@ static void edp_panel_vdd_off_sync(struct intel_dp =
*intel_dp)
 	I915_READ(pp_stat_reg), I915_READ(pp_ctrl_reg));
=20
 	if ((pp & POWER_TARGET_ON) =3D=3D 0)
-		intel_dp->last_power_cycle =3D jiffies;
+		intel_dp->panel_power_off_time =3D ktime_get_boottime();
=20
 	power_domain =3D intel_display_port_aux_power_domain(intel_encoder);
 	intel_display_power_put(dev_priv, power_domain);
@@ -2118,7 +2127,7 @@ static void edp_panel_off(struct intel_dp *intel_dp=
)
 	I915_WRITE(pp_ctrl_reg, pp);
 	POSTING_READ(pp_ctrl_reg);
=20
-	intel_dp->last_power_cycle =3D jiffies;
+	intel_dp->panel_power_off_time =3D ktime_get_boottime();
 	wait_panel_off(intel_dp);
=20
 	/* We got a reference when we enabled the VDD. */
@@ -5122,7 +5131,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp, =
struct drm_connector *connect
=20
 static void intel_dp_init_panel_power_timestamps(struct intel_dp *intel_=
dp)
 {
-	intel_dp->last_power_cycle =3D jiffies;
+	intel_dp->panel_power_off_time =3D ktime_get_boottime();
 	intel_dp->last_power_on =3D jiffies;
 	intel_dp->last_backlight_off =3D jiffies;
 }
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/inte=
l_drv.h
index bdfe403..06b37b8 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -793,9 +793,9 @@ struct intel_dp {
 	int backlight_off_delay;
 	struct delayed_work panel_vdd_work;
 	bool want_panel_vdd;
-	unsigned long last_power_cycle;
 	unsigned long last_power_on;
 	unsigned long last_backlight_off;
+	ktime_t panel_power_off_time;
=20
 	struct notifier_block edp_notifier;
=20

Since this is already reviewed. Can we please get this Que= ued for -next ?

Regards,
Abhay Kumar

--------------090007000206080602040107-- --===============1630631855== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9pbnRlbC1nZngK --===============1630631855==--