All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kumar, Abhay" <abhay.kumar@intel.com>
To: "Intel-gfx@lists.freedesktop.org"
	<Intel-gfx@lists.freedesktop.org>,
	"Syrjala, Ville" <ville.syrjala@intel.com>,
	Paulo Zanoni <przanoni@gmail.com>
Subject: Re: [PATCH] drm/i915: edp resume/On time optimization.
Date: Wed, 16 Dec 2015 00:23:53 +0000	[thread overview]
Message-ID: <A49308764D41694491D5AFB53AB2F16D08858FB1@ORSMSX114.amr.corp.intel.com> (raw)
In-Reply-To: <1450217798-24292-1-git-send-email-abhay.kumar@intel.com>

Is this something close to what we wanted to optimize for edp resume time and using wall clock.

-----Original Message-----
From: Kumar, Abhay 
Sent: Tuesday, December 15, 2015 2:17 PM
To: Intel-gfx@lists.freedesktop.org
Cc: Kumar, Abhay
Subject: [PATCH] drm/i915: edp resume/On time optimization.

From: Abhay Kumar <abhay.kumar@intel.com>

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

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

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index f00a3c9..d2a5a89 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -2395,6 +2395,9 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder)
 		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
 		intel_edp_panel_vdd_on(intel_dp);
 		intel_edp_panel_off(intel_dp);
+
+		/* storing panel power off time */
+		do_gettimeofday(&intel_dp->panel_power_off_timestamp);
 	}
 
 	if (IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 0f1eb96..1ca01b1 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2032,6 +2032,9 @@ static void edp_panel_on(struct intel_dp *intel_dp)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	u32 pp;
 	i915_reg_t pp_ctrl_reg;
+	u32 panel_power_off_duration;
+	u32 temp_power_cycle_delay;
+
 
 	lockdep_assert_held(&dev_priv->pps_mutex);
 
@@ -2045,8 +2048,22 @@ static void edp_panel_on(struct intel_dp *intel_dp)
 		 "eDP port %c panel power already on\n",
 		 port_name(dp_to_dig_port(intel_dp)->port)))
 		return;
+	/* taking the diffrence of currrent time and panel power off time
+	   and then make panel to wait for T12 if needed */
+	do_gettimeofday(&intel_dp->panel_power_on_timestamp);
+
+	panel_power_off_duration  = (intel_dp->panel_power_on_timestamp.tv_sec-intel_dp->panel_power_off_timestamp.tv_sec) * 1000000 +  intel_dp->panel_power_on_timestamp.tv_usec-intel_dp->panel_power_off_timestamp.tv_usec;
+	panel_power_off_duration = panel_power_off_duration / 1000 ;
+	temp_power_cycle_delay = intel_dp->panel_power_cycle_delay;
+
+	if(panel_power_off_duration >= intel_dp->panel_power_cycle_delay) {
+		intel_dp->panel_power_cycle_delay = 0;
+	} else {
+		intel_dp->panel_power_cycle_delay = intel_dp->panel_power_cycle_delay - panel_power_off_duration;
+	}
 
 	wait_panel_power_cycle(intel_dp);
+	intel_dp->panel_power_cycle_delay = temp_power_cycle_delay;
 
 	pp_ctrl_reg = _pp_ctrl_reg(intel_dp);
 	pp = ironlake_get_pp_control(intel_dp);
@@ -5127,6 +5144,7 @@ static void intel_dp_init_panel_power_timestamps(struct intel_dp *intel_dp)
 	intel_dp->last_power_cycle = jiffies;
 	intel_dp->last_power_on = jiffies;
 	intel_dp->last_backlight_off = jiffies;
+	do_gettimeofday(&intel_dp->panel_power_off_timestamp);
 }
 
 static void
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 76dfa28..66ed2cb 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -769,6 +769,8 @@ struct intel_dp {
 	unsigned long last_power_cycle;
 	unsigned long last_power_on;
 	unsigned long last_backlight_off;
+	struct timeval panel_power_off_timestamp;
+	struct timeval panel_power_on_timestamp;
 
 	struct notifier_block edp_notifier;
 
--
1.9.1

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

  reply	other threads:[~2015-12-16  0:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-15 22:16 [PATCH] drm/i915: edp resume/On time optimization abhay.kumar
2015-12-16  0:23 ` Kumar, Abhay [this message]
2015-12-16 10:41 ` Kumar, Shobhit
2015-12-16 10:55 ` Ville Syrjälä
2015-12-17  1:04   ` Kumar, Abhay
2015-12-17 11:37     ` Ville Syrjälä
2015-12-17 14:50 ` ✗ failure: UK.CI.checkpatch.pl Patchwork
2015-12-18  6:27 [PATCH] drm/i915: edp resume/On time optimization abhay.kumar
2015-12-18  7:01 ` kbuild test robot
2015-12-18 19:55 abhay.kumar
2015-12-21  5:33 ` Kumar, Abhay
2015-12-21 15:57   ` Daniel Vetter
2015-12-21 16:55     ` Kumar, Abhay
2015-12-22  1:18 abhay.kumar
2016-01-05  1:30 ` Kumar, Abhay
2016-01-05 11:04   ` Daniel Vetter
2016-01-05 20:43     ` Kumar, Abhay
2016-01-05 21:14 ` Kumar, Abhay
2016-01-07 18:15 ` Ville Syrjälä
2016-01-08  2:27   ` Kumar, Abhay
2016-01-08 12:55     ` Ville Syrjälä
2016-01-11 22:55 abhay.kumar
2016-01-12 13:48 ` Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A49308764D41694491D5AFB53AB2F16D08858FB1@ORSMSX114.amr.corp.intel.com \
    --to=abhay.kumar@intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=przanoni@gmail.com \
    --cc=ville.syrjala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.