Re: [PATCH 1/1] initial panel_power_off_time should be 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 20 Sep 2018, ning.a.zhang@xxxxxxxxx wrote:
> From: Zhang Ning <ning.a.zhang@xxxxxxxxx>
>
> power on an eDP panel requests eDP panal fully powered off.
> need to wait t11_t12 after LCDVCC is off. usually t12 is 500ms.
>
> code, intel_dp.c, func edp_panel_vdd_on, line 2010:
>
> 	if (!edp_have_panel_power(intel_dp))
> 		wait_panel_power_cycle(intel_dp);
>
> translate to human readable:
>         if panel is off; then wait.
>
> the wait time is (t11_t12 - power_off_duration).
>
> power_off_duration = (now_time - last_off_timestamp)
>
> when (t10_t12 > power_off_duration), a wait is requested.
> otherwise not needed.
>
> for coldboot, panel is powered off, not powered on.
> so last_off_timestamp for coldboot should be 0.
>
> but in code, this value is set to i915 module initial timestamp,
> by:
>
> static void intel_dp_init_panel_power_timestamps(struct intel_dp
> *intel_dp)
> {
> 	intel_dp->panel_power_off_time = ktime_get_boottime();
> 	intel_dp->last_power_on = jiffies;
> 	intel_dp->last_backlight_off = jiffies;
> }
>
> this is not real last_off_timestamp, and make i915 driver wait unnecessarily.
>
> to make i915 initial faster, set panel_power_off_time to (ktime_t){.tv64
> = 0}
>
> actully saves 200ms for coldboot.
>
> Signed-off-by: Zhang Ning <ning.a.zhang@xxxxxxxxx>
> Reviewed-off-by: Zhang, Baoli <baoli.zhang@xxxxxxxxx>

I can think of two scenarios where the proposed change could lead to too
short a wait:

1) GOP enables *and* disables eDP. Seems very unlikely to me.

2) i915 module unload and reload. Also unlikely in an end user case, but
potentially relevant for development and CI.

Otherwise, your patch does seem like a good idea. I'm not sure what, if
anything, we should do about the above scenarios. The current approach
does seem fairly conservative. It's a possibility "get boottime" was
misunderstood for time of boot rather than time *since* boot.

I'll let Ville chime in as well.

BR,
Jani.


> ---
>  drivers/gpu/drm/i915/intel_dp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 1193202766a2..9b985768ead6 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -5373,7 +5373,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)
>  {
> -	intel_dp->panel_power_off_time = ktime_get_boottime();
> +	intel_dp->panel_power_off_time = ktime_set(0, 0);
>  	intel_dp->last_power_on = jiffies;
>  	intel_dp->last_backlight_off = jiffies;
>  }

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux