All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: abhay.kumar@intel.com
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: edp resume/On time optimization.
Date: Wed, 16 Dec 2015 12:55:34 +0200	[thread overview]
Message-ID: <20151216105534.GW4437@intel.com> (raw)
In-Reply-To: <1450217798-24292-1-git-send-email-abhay.kumar@intel.com>

On Tue, Dec 15, 2015 at 02:16:38PM -0800, abhay.kumar@intel.com wrote:
> 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);

I think what we want to use is CLOCK_BOOTTIME. It's like
MONOTONIC, except it counts the suspend time too.

Initially I figured we'd use REALTIME, and only do the adjustment around
suspend/resume. But actually BOOTTIME should be perfectly safe to use
all the time (changing the system time doesn't affect it). So maybe we just
want to convert the power cycle delay handling entirely over to using
the BOOTTIME clock instead of jiffies?

>  	}
>  
>  	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

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-12-16 10:55 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
2015-12-16 10:41 ` Kumar, Shobhit
2015-12-16 10:55 ` Ville Syrjälä [this message]
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=20151216105534.GW4437@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=abhay.kumar@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.