All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] idea for optimize i915 initial time with eDP
@ 2018-09-20  8:49 ning.a.zhang
  2018-09-20  8:49 ` [PATCH 1/1] initial panel_power_off_time should be 0 ning.a.zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: ning.a.zhang @ 2018-09-20  8:49 UTC (permalink / raw)
  To: chris, jani.nikula, joonas.lahtinen; +Cc: intel-gfx, Zhang Ning

From: Zhang Ning <ning.a.zhang@intel.com>

I find it on Broxton Gorden Peak, its BIOS doesn't have GOP driver.
displays are powered on by Linux kernel (i915 driver). not BIOS.

For eDP panel, power on it requires to fully powered off, that means wait enough time.

when i915 tries to power on eDP panel, it set last_off_timestamp to driver init time,
this assumes eDP is already powered on.
this is not right on no GOP system, eDP is never powered on.

Then set it to kernel time 0, I know this not right, in two way:

1, this is not *real* last_off_timestamp, can't set an negtive timestamp.
2, no check system with GOP or without GOP, or check whether eDP is powered on.

due to I don't have system with GOP and eDP, can't fully verify my idea.

Zhang Ning (1):
  initial panel_power_off_time should be 0

 drivers/gpu/drm/i915/intel_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.18.0

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/1] initial panel_power_off_time should be 0
  2018-09-20  8:49 [PATCH 0/1] idea for optimize i915 initial time with eDP ning.a.zhang
@ 2018-09-20  8:49 ` ning.a.zhang
  2018-09-25  9:55   ` Jani Nikula
  2018-09-20  9:35 ` ✗ Fi.CI.CHECKPATCH: warning for idea for optimize i915 initial time with eDP Patchwork
  2018-09-20 10:00 ` ✗ Fi.CI.BAT: failure " Patchwork
  2 siblings, 1 reply; 7+ messages in thread
From: ning.a.zhang @ 2018-09-20  8:49 UTC (permalink / raw)
  To: chris, jani.nikula, joonas.lahtinen; +Cc: intel-gfx, Zhang Ning

From: Zhang Ning <ning.a.zhang@intel.com>

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@intel.com>
Reviewed-off-by: Zhang, Baoli <baoli.zhang@intel.com>
---
 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;
 }
-- 
2.18.0

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* ✗ Fi.CI.CHECKPATCH: warning for idea for optimize i915 initial time with eDP
  2018-09-20  8:49 [PATCH 0/1] idea for optimize i915 initial time with eDP ning.a.zhang
  2018-09-20  8:49 ` [PATCH 1/1] initial panel_power_off_time should be 0 ning.a.zhang
@ 2018-09-20  9:35 ` Patchwork
  2018-09-20 10:00 ` ✗ Fi.CI.BAT: failure " Patchwork
  2 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-09-20  9:35 UTC (permalink / raw)
  To: ning.a.zhang; +Cc: intel-gfx

== Series Details ==

Series: idea for optimize i915 initial time with eDP
URL   : https://patchwork.freedesktop.org/series/49952/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
32ea43a57a0b initial panel_power_off_time should be 0
-:38: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#38: 
this is not real last_off_timestamp, and make i915 driver wait unnecessarily.

-:46: WARNING:BAD_SIGN_OFF: Non-standard signature: Reviewed-off-by:
#46: 
Reviewed-off-by: Zhang, Baoli <baoli.zhang@intel.com>

total: 0 errors, 2 warnings, 0 checks, 8 lines checked

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* ✗ Fi.CI.BAT: failure for idea for optimize i915 initial time with eDP
  2018-09-20  8:49 [PATCH 0/1] idea for optimize i915 initial time with eDP ning.a.zhang
  2018-09-20  8:49 ` [PATCH 1/1] initial panel_power_off_time should be 0 ning.a.zhang
  2018-09-20  9:35 ` ✗ Fi.CI.CHECKPATCH: warning for idea for optimize i915 initial time with eDP Patchwork
@ 2018-09-20 10:00 ` Patchwork
  2 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-09-20 10:00 UTC (permalink / raw)
  To: ning.a.zhang; +Cc: intel-gfx

== Series Details ==

Series: idea for optimize i915 initial time with eDP
URL   : https://patchwork.freedesktop.org/series/49952/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4848 -> Patchwork_10235 =

== Summary - FAILURE ==

  Serious unknown changes coming with Patchwork_10235 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_10235, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/49952/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in Patchwork_10235:

  === IGT changes ===

    ==== Possible regressions ====

    igt@drm_mm@insert:
      {fi-skl-caroline}:  NOTRUN -> INCOMPLETE

    igt@drv_selftest@live_contexts:
      fi-bsw-n3050:       PASS -> DMESG-WARN

    
== Known issues ==

  Here are the changes found in Patchwork_10235 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_evict:
      fi-bsw-kefka:       PASS -> DMESG-WARN (fdo#107709)

    igt@gem_exec_suspend@basic-s4-devices:
      fi-blb-e6850:       PASS -> INCOMPLETE (fdo#107718)

    igt@kms_frontbuffer_tracking@basic:
      fi-hsw-peppy:       PASS -> DMESG-WARN (fdo#102614)
      fi-byt-clapper:     PASS -> FAIL (fdo#103167)

    igt@kms_pipe_crc_basic@hang-read-crc-pipe-b:
      fi-byt-clapper:     PASS -> FAIL (fdo#107362, fdo#103191)

    
    ==== Possible fixes ====

    igt@gem_exec_suspend@basic-s3:
      {fi-skl-caroline}:  INCOMPLETE (fdo#107556, fdo#104108) -> PASS

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
  fdo#107709 https://bugs.freedesktop.org/show_bug.cgi?id=107709
  fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718


== Participating hosts (53 -> 48) ==

  Missing    (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u 


== Build changes ==

    * Linux: CI_DRM_4848 -> Patchwork_10235

  CI_DRM_4848: 1c7ddc4315a85de031b58d1dfcfd4b144f942da5 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4647: ae8187922d8de2bc739519da3bd40cf5f03f5e4f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10235: 32ea43a57a0bf9f24e75cbd43b3e4d62dabd0c99 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

32ea43a57a0b initial panel_power_off_time should be 0

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10235/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] initial panel_power_off_time should be 0
  2018-09-20  8:49 ` [PATCH 1/1] initial panel_power_off_time should be 0 ning.a.zhang
@ 2018-09-25  9:55   ` Jani Nikula
  2018-09-25 14:53     ` Ville Syrjälä
  0 siblings, 1 reply; 7+ messages in thread
From: Jani Nikula @ 2018-09-25  9:55 UTC (permalink / raw)
  To: chris, joonas.lahtinen; +Cc: intel-gfx, Zhang Ning

On Thu, 20 Sep 2018, ning.a.zhang@intel.com wrote:
> From: Zhang Ning <ning.a.zhang@intel.com>
>
> 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@intel.com>
> Reviewed-off-by: Zhang, Baoli <baoli.zhang@intel.com>

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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] initial panel_power_off_time should be 0
  2018-09-25  9:55   ` Jani Nikula
@ 2018-09-25 14:53     ` Ville Syrjälä
  2018-09-26  2:03       ` Zhang, Ning A
  0 siblings, 1 reply; 7+ messages in thread
From: Ville Syrjälä @ 2018-09-25 14:53 UTC (permalink / raw)
  To: Jani Nikula; +Cc: ning.a.zhang, intel-gfx

On Tue, Sep 25, 2018 at 12:55:04PM +0300, Jani Nikula wrote:
> On Thu, 20 Sep 2018, ning.a.zhang@intel.com wrote:
> > From: Zhang Ning <ning.a.zhang@intel.com>
> >
> > 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@intel.com>
> > Reviewed-off-by: Zhang, Baoli <baoli.zhang@intel.com>
> 
> 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.

It sure likes enabling the vdd. But I guess it usually leaves it on even
if it decided to light up an external display instead. Not 100% sure
though.

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

I think currently we may even just leave the panel on when unloading.

However...

3) S3. I don't think we wait for the power cycle delay when suspending
   so if resume happens fast enough we'll violate the power cycle delay.
   Seems more likely than the other cases.

Probably the best solution for all the self inflicted cases would be
to wait for the power cycle delay before
suspending/unloading/rebooting/whatever. We only do the reboot thing
in vlv/chv for some random reason. I tried to add a global reboot
notifier here: https://patchwork.freedesktop.org/patch/102739/
but I never managed to finish that work. IIRC it was suggested that
we'd probably want a full blown suspend on reboot anwyay.

For the GOP turned the vdd on and off again case we have no solution
other than to a) trust the GOP not to do that, b) keep doing the
pessimistic thing we do now.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/1] initial panel_power_off_time should be 0
  2018-09-25 14:53     ` Ville Syrjälä
@ 2018-09-26  2:03       ` Zhang, Ning A
  0 siblings, 0 replies; 7+ messages in thread
From: Zhang, Ning A @ 2018-09-26  2:03 UTC (permalink / raw)
  To: ville.syrjala, jani.nikula; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 3236 bytes --]

Thank you very much for getting involved.




在 2018-09-25二的 17:53 +0300,Ville Syrjälä写道:

On Tue, Sep 25, 2018 at 12:55:04PM +0300, Jani Nikula wrote:


On Thu, 20 Sep 2018, ning.a.zhang@intel.com<mailto:ning.a.zhang@intel.com> wrote:


From: Zhang Ning <ning.a.zhang@intel.com<mailto:ning.a.zhang@intel.com>>

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@intel.com<mailto:ning.a.zhang@intel.com>>
Reviewed-off-by: Zhang, Baoli <baoli.zhang@intel.com<mailto:baoli.zhang@intel.com>>



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.


enable GOP is not possible for Golden peak, due the size of SPI NOR flash.




It sure likes enabling the vdd. But I guess it usually leaves it on even
if it decided to light up an external display instead. Not 100% sure
though.




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



I think currently we may even just leave the panel on when unloading.


I much care about i915 module first load, or built-in, if i915
unnecessarily wait on eDP panel, that means longer boot time.



However...

3) S3. I don't think we wait for the power cycle delay when suspending
   so if resume happens fast enough we'll violate the power cycle delay.
   Seems more likely than the other cases.

Probably the best solution for all the self inflicted cases would be
to wait for the power cycle delay before
suspending/unloading/rebooting/whatever. We only do the reboot thing
in vlv/chv for some random reason. I tried to add a global reboot
notifier here: https://patchwork.freedesktop.org/patch/102739/
but I never managed to finish that work. IIRC it was suggested that
we'd probably want a full blown suspend on reboot anwyay.

For the GOP turned the vdd on and off again case we have no solution
other than to a) trust the GOP not to do that, b) keep doing the
pessimistic thing we do now.



[-- Attachment #1.2: Type: text/html, Size: 4096 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-09-26  2:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-20  8:49 [PATCH 0/1] idea for optimize i915 initial time with eDP ning.a.zhang
2018-09-20  8:49 ` [PATCH 1/1] initial panel_power_off_time should be 0 ning.a.zhang
2018-09-25  9:55   ` Jani Nikula
2018-09-25 14:53     ` Ville Syrjälä
2018-09-26  2:03       ` Zhang, Ning A
2018-09-20  9:35 ` ✗ Fi.CI.CHECKPATCH: warning for idea for optimize i915 initial time with eDP Patchwork
2018-09-20 10:00 ` ✗ Fi.CI.BAT: failure " Patchwork

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.