drm/i915/psr: Kill delays when activating psr back.
Subsystems (2)
Rodrigo Vivi
maintainerPATCH 1/1 drm/i915/psr: Kill delays when activating psr back.
The immediate enabling was actually not an issue for the HW perspective for core platforms that have HW tracking. HW will wait few identical idle frames before transitioning to actual psr active anyways.
Now that we removed VLV/CHV out of the picture completely we can safely remove any delays.
Note that this patch also remove the delayed activation on HSW and BDW introduced by commit 'd0ac896a477d ("drm/i915: Delay first PSR activation.")'. This was introduced to fix a blank screen on VLV/CHV and also masked some frozen screens on other core platforms. Probably the same that we are now properly hunting and fixing.
v2:(DK): Remove unnecessary WARN_ONs and make some other
VLV | CHV more readable.
v3: Do it regardless the timer rework.
v4: (DK/CI): Add VLV || CHV check on cancel work at psr_disable.
v5: Kill remaining items and fully rework activation functions.
v6: Rebase on top of VLV/CHV clean-up and keep the reactivation
on a regular non-delayed work to avoid extra delays on exit calls and allow us to add few more safety checks before real activation.
--- drivers/gpu/drm/i915/i915_debugfs.c | 2 -- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/intel_psr.c | 29 +++++++---------------------- 3 files changed, 8 insertions(+), 25 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +0 -2
@@ -2660,8 +2660,6 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)seq_printf (m,"Enabled: %s\n" ,yesno ((bool )dev_priv->psr.enabled));seq_printf (m,"Busy frontbuffer bits: 0x%03x\n" , dev_priv->psr.busy_frontbuffer_bits); -seq_printf (m,"Re-enable work scheduled: %s\n" , -yesno (work_busy (&dev_priv->psr.work.work)));if (dev_priv->psr.psr2_enabled) enabled =I915_READ (EDP_PSR2_CTL ) &EDP_PSR2_ENABLE ;
drivers/gpu/drm/i915/i915_drv.h +1 -1
@@ -613,7 +613,7 @@ struct i915_psr {bool sink_support;struct intel_dp *enabled;bool active; -struct delayed_work work; +struct work_struct work;unsigned busy_frontbuffer_bits;bool sink_psr2_support;bool link_standby;
drivers/gpu/drm/i915/intel_psr.c +7 -22
@@ -671,21 +671,7 @@ void intel_psr_enable(struct intel_dp *intel_dp, dev_priv->psr.enable_source (intel_dp, crtc_state); dev_priv->psr.enabled = intel_dp; -if (INTEL_GEN (dev_priv) >=9 ) { -intel_psr_activate (intel_dp); - }else { -/* -* FIXME: Activation should happen immediately since this -* function is just called after pipe is fully trained and -* enabled. -* However on some platforms we face issues when first -* activation follows a modeset so quickly. -* - On HSW/BDW we get a recoverable frozen screen until -* next exit-activate sequence. -*/ -schedule_delayed_work (&dev_priv->psr.work, -msecs_to_jiffies (intel_dp->panel_power_cycle_delay *5 )); - } +intel_psr_activate (intel_dp); unlock:mutex_unlock (&dev_priv->psr.lock);
@@ -768,8 +754,6 @@ void intel_psr_disable(struct intel_dp *intel_dp, dev_priv->psr.enabled =NULL ;mutex_unlock (&dev_priv->psr.lock); - -cancel_delayed_work_sync (&dev_priv->psr.work); }static bool psr_wait_for_idle (struct drm_i915_private *dev_priv)
@@ -805,10 +789,13 @@ static bool psr_wait_for_idle(struct drm_i915_private *dev_priv)static void intel_psr_work (struct work_struct *work) {struct drm_i915_private *dev_priv = -container_of (work,typeof (*dev_priv), psr.work.work); +container_of (work,typeof (*dev_priv), psr.work);mutex_lock (&dev_priv->psr.lock); +if (!dev_priv->psr.enabled) + goto unlock; +/* * We have to make sure PSR is ready for re-enable * otherwise it keeps disabled until next full enable/disable cycle.
@@ -949,9 +936,7 @@ void intel_psr_flush(struct drm_i915_private *dev_priv, }if (!dev_priv->psr.active && !dev_priv->psr.busy_frontbuffer_bits) -if (!work_busy (&dev_priv->psr.work.work)) -schedule_delayed_work (&dev_priv->psr.work, -msecs_to_jiffies (100 )); +schedule_work (&dev_priv->psr.work);mutex_unlock (&dev_priv->psr.lock); }
@@ -998,7 +983,7 @@ void intel_psr_init(struct drm_i915_private *dev_priv) dev_priv->psr.link_standby = false; } -INIT_DELAYED_WORK (&dev_priv->psr.work, intel_psr_work); +INIT_WORK (&dev_priv->psr.work, intel_psr_work);mutex_init (&dev_priv->psr.lock); dev_priv->psr.enable_source = hsw_psr_enable_source;
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915/psr: Kill delays when activating psr back.
== Series Details ==
== Series Details ==
Series: drm/i915/psr: Kill delays when activating psr back.
URL : https://patchwork.freedesktop.org/series/44715/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4311 -> Patchwork_9294 =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_9294 need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_9294, 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/44715/revisions/1/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_9294:
=== IGT changes ===
==== Warnings ====
igt@gem_exec_gttfill@basic:
fi-pnv-d510: PASS -> SKIP== Known issues ==
Here are the changes found in Patchwork_9294 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_module_reload@basic-reload-inject:
fi-glk-j4005: PASS -> DMESG-WARN (fdo#106725, fdo#106248)
igt@gem_exec_suspend@basic-s4-devices:
fi-kbl-7500u: PASS -> DMESG-WARN (fdo#105128)
igt@kms_flip@basic-flip-vs-modeset:
fi-glk-j4005: PASS -> DMESG-WARN (fdo#106000)
==== Possible fixes ====
igt@gem_ctx_create@basic-files:
fi-glk-j4005: DMESG-WARN (fdo#105719) -> PASS
igt@gem_exec_gttfill@basic:
fi-byt-n2820: FAIL (fdo#106744) -> PASS
igt@gem_exec_suspend@basic-s4-devices:
fi-glk-j4005: DMESG-WARN (fdo#106097) -> PASS
igt@kms_flip@basic-flip-vs-wf_vblank:
fi-cnl-psr: FAIL (fdo#100368) -> PASS
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
fi-bxt-dsi: INCOMPLETE (fdo#103927) -> PASS fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
fdo#105719 https://bugs.freedesktop.org/show_bug.cgi?id=105719
fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
fdo#106097 https://bugs.freedesktop.org/show_bug.cgi?id=106097
fdo#106248 https://bugs.freedesktop.org/show_bug.cgi?id=106248
fdo#106725 https://bugs.freedesktop.org/show_bug.cgi?id=106725
fdo#106744 https://bugs.freedesktop.org/show_bug.cgi?id=106744
== Participating hosts (43 -> 39) ==
Missing (4): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan
== Build changes ==
* Linux: CI_DRM_4311 -> Patchwork_9294
CI_DRM_4311: 875eebee4a444f5b7ba146754e91118ff3c11ad5 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4518: e4908004547b63131352fbc0ddcdb1d3d55480e0 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9294: 5191095d6bf24d10318f10ed6e2a01287730ae32 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
5191095d6bf2 drm/i915/psr: Kill delays when activating psr back.
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9294/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 15 lines · Rodrigo Vivi
The immediate enabling was actually not an issue for the HW perspective for core platforms that have HW tracking. HW will wait few identical idle frames before transitioning to actual psr active anyways.
Now that we removed VLV/CHV out of the picture completely we can safely remove any delays.
Note that this patch also remove the delayed activation on HSW and BDW introduced by commit '
d0ac896a477d("drm/i915: Delay first PSR activation.")'. This was introduced to fix a blank screen on VLV/CHV and also masked some frozen screens on other core platforms. Probably the same that we are now properly hunting and fixing.
Quoted 9 lines
v2:(DK): Remove unnecessary
WARN_ONsand make some other VLV | CHV more readable.
v3: Do it regardless the timer rework.
v4: (DK/CI): Add VLV || CHV check on cancel work atpsr_disable.
v5: Kill remaining items and fully rework activation functions.
v6: Rebase on top of VLV/CHV clean-up and keep the reactivation on a regular non-delayed work to avoid extra delays on exit calls and allow us to add few more safety checks before real activation.
We have to implement this bspec step in the disable sequence now that you are removing the delay -
"Wait for SRD_STATUS to show SRD is Idle. This will take up to one full frame time (1/refresh rate), plus SRD exit training time (max of 6ms), plus SRD aux channel handshake (max of 1.5ms)."
Otherwise, we can end up re-enabling right after a disable in psr_exit()
Quoted 93 lines
Cc Dhinakaran Pandiyan <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>---
drivers/gpu/drm/i915/i915_debugfs.c | 2 -- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/intel_psr.c | 29 +++++++------------------
----3 files changed, 8 insertions(+), 25 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +0
-0@@ -2660,8 +2660,6 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)seq_printf(m, "Enabled: %s\n", yesno((bool)dev_priv-
Quoted 1 line
psr.enabled));
seq_printf(m, "Busy frontbuffer bits: 0x%03x\n", dev_priv->psr.busy_frontbuffer_bits);drivers/gpu/drm/i915/i915_debugfs.c +0
-2-seq_printf (m,"Re-enable work scheduled: %s\n" , - yesno(work_busy(&dev_priv->psr.work.work)));
if (dev_priv->psr.psr2_enabled)
enabled =I915_READ(EDP_PSR2_CTL)&EDP_PSR2_ENABLE;drivers/gpu/drm/i915/i915_drv.h +1
-1@@ -613,7 +613,7 @@ struct i915_psr { bool sink_support; struct intel_dp *enabled; bool active; -struct delayed_work work; +struct work_struct work; unsigned busy_frontbuffer_bits; bool sink_psr2_support; bool link_standby;drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -671,21 +671,7 @@ void intel_psr_enable(struct intel_dp *intel_dp, dev_priv->psr.enable_source(intel_dp, crtc_state); dev_priv->psr.enabled = intel_dp;drivers/gpu/drm/i915/intel_psr.c +0
-5-if (INTEL_GEN (dev_priv) >=9 ) { -intel_psr_activate (intel_dp); - }else { -/* -* FIXME: Activation should happen immediately since this
drivers/gpu/drm/i915/intel_psr.c +0
-1- * function is just called after pipe is fullytrained and
drivers/gpu/drm/i915/intel_psr.c +0
-2- * enabled. - * However on some platforms we face issues whenfirst
drivers/gpu/drm/i915/intel_psr.c +0
-2- * activation follows a modeset so quickly. - * - On HSW/BDW we get a recoverable frozenscreen until
drivers/gpu/drm/i915/intel_psr.c +0
-4-* next exit-activate sequence. -*/ - schedule_delayed_work(&dev_priv->psr.work, - msecs_to_jiffies(intel_dp-Quoted 1 line
panel_power_cycle_delay* 5));drivers/gpu/drm/i915/intel_psr.c +1
-1- } +intel_psr_activate (intel_dp);
unlock:
mutex_unlock(&dev_priv->psr.lock);drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -768,8 +754,6 @@ void intel_psr_disable(struct intel_dp *intel_dp,
dev_priv->psr.enabled= NULL;
mutex_unlock(&dev_priv->psr.lock);drivers/gpu/drm/i915/intel_psr.c +0
-2- -cancel_delayed_work_sync (&dev_priv->psr.work);}
static boolpsr_wait_for_idle(struct drm_i915_private *dev_priv)drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -805,10 +789,13 @@ static bool psr_wait_for_idle(struct drm_i915_private *dev_priv) static void intel_psr_work(struct work_struct *work) {struct
drm_i915_private*dev_priv=drivers/gpu/drm/i915/intel_psr.c +0
-1- container_of(work, typeof(*dev_priv),psr.work.work);
drivers/gpu/drm/i915/intel_psr.c +1
-0+container_of (work,typeof (*dev_priv), psr.work);
mutex_lock(&dev_priv->psr.lock);
drivers/gpu/drm/i915/intel_psr.c static bool psr_wait_for_idle(struct drm_i915_private *dev_priv) · line 798
Quoted 3 lines
drivers/gpu/drm/i915/intel_psr.c +3
-0+if (!dev_priv->psr.enabled) + goto unlock; +
I thought flush_work() was missing in psr_disable(), but this check should take care of not enabling PSR after psr_disable()
Quoted 25 lines
/*
* We have to make sure PSR is ready for re-enable
* otherwise it keeps disabled until next full enable/disable cycle.drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -949,9 +936,7 @@ void intel_psr_flush(struct drm_i915_private *dev_priv, }
if (!dev_priv->psr.active && !dev_priv-Quoted 1 line
psr.busy_frontbuffer_bits)
drivers/gpu/drm/i915/intel_psr.c +0
-3-if (!work_busy (&dev_priv->psr.work.work)) -schedule_delayed_work (&dev_priv->psr.work, - msecs_to_jiffies(100));
drivers/gpu/drm/i915/intel_psr.c +1
-0+schedule_work (&dev_priv->psr.work);
mutex_unlock(&dev_priv->psr.lock);
}drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -998,7 +983,7 @@ void intel_psr_init(struct drm_i915_private *dev_priv) dev_priv->psr.link_standby = false; }drivers/gpu/drm/i915/intel_psr.c +1
-1-INIT_DELAYED_WORK (&dev_priv->psr.work, intel_psr_work); +INIT_WORK (&dev_priv->psr.work, intel_psr_work);
Quoted 3 lines
mutex_init(&dev_priv->psr.lock);
dev_priv->psr.enable_source=hsw_psr_enable_source;
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Souza, Jose
Reviewed-byQuoted 34 lines · Dhinakaran Pandiyan
Quoted 15 lines · Rodrigo Vivi
The immediate enabling was actually not an issue for the HW perspective for core platforms that have HW tracking. HW will wait few identical idle frames before transitioning to actual psr active anyways.
Now that we removed VLV/CHV out of the picture completely we can safely remove any delays.
Note that this patch also remove the delayed activation on HSW and BDW introduced by commit '
d0ac896a477d("drm/i915: Delay first PSR activation.")'. This was introduced to fix a blank screen on VLV/CHV and also masked some frozen screens on other core platforms. Probably the same that we are now properly hunting and fixing.Quoted 9 lines
v2:(DK): Remove unnecessary
WARN_ONsand make some other
VLV | CHV more readable.
v3: Do it regardless the timer rework.
v4: (DK/CI): Add VLV || CHV check on cancel work atpsr_disable.
v5: Kill remaining items and fully rework activation functions.
v6: Rebase on top of VLV/CHV clean-up and keep the reactivation
on a regular non-delayed work to avoid extra delays on exit calls and allow us to add few more safety checks before real activation.We have to implement this bspec step in the disable sequence now that you are removing the delay -
"Wait forSRD_STATUSto show SRD is Idle. This will take up to one full
frame time (1/refresh rate), plus SRD exit training time (max of 6ms),
plus SRD aux channel handshake (max of 1.5ms)."
Quoted 2 lines
Otherwise, we can end up re-enabling right after a disable in
psr_exit()
It is still waiting PSR idle before renable.
Quoted 6 lines
Quoted 6 lines
Cc Dhinakaran Pandiyan <[email protected]>
Quoted 135 lines
Quoted 91 lines
Signed-off-by Rodrigo Vivi <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 2 -- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/intel_psr.c | 29 +++++++------------------ ---- 3 files changed, 8 insertions(+), 25 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +0
-0@@ -2660,8 +2660,6 @@ static int i915_edp_psr_status(struct
seq_file
*m, void *data)
seq_printf(m, "Enabled: %s\n", yesno((bool)dev_priv-Quoted 1 line
psr.enabled));
drivers/gpu/drm/i915/i915_debugfs.c +0
-2seq_printf (m,"Busy frontbuffer bits: 0x%03x\n" , dev_priv->psr.busy_frontbuffer_bits); -seq_printf (m,"Re-enable work scheduled: %s\n" , -yesno (work_busy (&dev_priv->psr.work.work)));if (dev_priv->psr.psr2_enabled) enabled = I915_READ(EDP_PSR2_CTL) &
EDP_PSR2_ENABLE;drivers/gpu/drm/i915/i915_drv.h +1
-1@@ -613,7 +613,7 @@ struct i915_psr {bool sink_support;struct intel_dp *enabled;bool active; -struct delayed_work work; +struct work_struct work;unsigned busy_frontbuffer_bits;bool sink_psr2_support;bool link_standby;drivers/gpu/drm/i915/intel_psr.c +0
-5@@ -671,21 +671,7 @@ void intel_psr_enable(struct intel_dp *intel_dp, dev_priv->psr.enable_source (intel_dp, crtc_state); dev_priv->psr.enabled = intel_dp; -if (INTEL_GEN (dev_priv) >=9 ) { -intel_psr_activate (intel_dp); - }else { -/* -* FIXME: Activation should happen immediately since
thisdrivers/gpu/drm/i915/intel_psr.c +0
-1-* function is just called after pipe is fully trained and
drivers/gpu/drm/i915/intel_psr.c +0
-2-* enabled. -* However on some platforms we face issues when first
drivers/gpu/drm/i915/intel_psr.c +0
-2-* activation follows a modeset so quickly. -* - On HSW/BDW we get a recoverable frozen screen until
drivers/gpu/drm/i915/intel_psr.c +0
-4-* next exit-activate sequence. -*/ - schedule_delayed_work(&dev_priv->psr.work, - msecs_to_jiffies(intel_dp-Quoted 1 line
panel_power_cycle_delay* 5));drivers/gpu/drm/i915/intel_psr.c +1
-3- } +intel_psr_activate (intel_dp); unlock:mutex_unlock (&dev_priv->psr.lock);@@ -768,8 +754,6 @@ void intel_psr_disable(struct intel_dp *intel_dp, dev_priv->psr.enabled =NULL ;mutex_unlock (&dev_priv->psr.lock); - -cancel_delayed_work_sync (&dev_priv->psr.work); }static bool
psr_wait_for_idle(struct drm_i915_private *dev_priv)drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -805,10 +789,13 @@ static bool psr_wait_for_idle(struct drm_i915_private *dev_priv)static void intel_psr_work (struct work_struct *work) {drivers/gpu/drm/i915/intel_psr.c static bool psr_wait_for_idle(struct · line 800
Quoted 10 lines
drivers/gpu/drm/i915/intel_psr.c +4
-1struct drm_i915_private *dev_priv = -container_of (work,typeof (*dev_priv), psr.work.work); +container_of (work,typeof (*dev_priv), psr.work);mutex_lock (&dev_priv->psr.lock); +if (!dev_priv->psr.enabled) + goto unlock; +I thought
flush_work()was missing inpsr_disable(), but this check should take care of not enabling PSR afterpsr_disable()Quoted 29 lines
drivers/gpu/drm/i915/intel_psr.c +0
-0/* drivers/gpu/drm/i915/intel_psr.c +0
-0* We have to make sure PSR is ready for re-enable * otherwise it keeps disabled until next full enable/disable cycle.
drivers/gpu/drm/i915/intel_psr.c +0
-3@@ -949,9 +936,7 @@ void intel_psr_flush(struct drm_i915_private *dev_priv, }if (!dev_priv->psr.active && !dev_priv- > psr.busy_frontbuffer_bits) -if (!work_busy (&dev_priv->psr.work.work)) - schedule_delayed_work(&dev_priv->psr.work, - msecs_to_jiffies(100))
;drivers/gpu/drm/i915/intel_psr.c +2
-1+schedule_work (&dev_priv->psr.work);mutex_unlock (&dev_priv->psr.lock); }@@ -998,7 +983,7 @@ void intel_psr_init(struct drm_i915_private *dev_priv) dev_priv->psr.link_standby = false; } -INIT_DELAYED_WORK (&dev_priv->psr.work, intel_psr_work); +INIT_WORK (&dev_priv->psr.work, intel_psr_work);mutex_init (&dev_priv->psr.lock);
Quoted 6 lines
Quoted 1 line
dev_priv->psr.enable_source=hsw_psr_enable_source;_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Dhinakaran Pandiyan
Reviewed-byQuoted 37 lines · Jose
Quoted 36 lines · Dhinakaran Pandiyan
Quoted 16 lines · Rodrigo Vivi
The immediate enabling was actually not an issue for the HW perspective for core platforms that have HW tracking. HW will wait few identical idle frames before transitioning to actual psr active anyways.
Now that we removed VLV/CHV out of the picture completely we can safely remove any delays.
Note that this patch also remove the delayed activation on HSW and BDW introduced by commit '
d0ac896a477d("drm/i915: Delay first PSR activation.")'. This was introduced to fix a blank screen on VLV/CHV and also masked some frozen screens on other core platforms. Probably the same that we are now properly hunting and fixing.Quoted 9 lines
v2:(DK): Remove unnecessary
WARN_ONsand make some other VLV | CHV more readable.
v3: Do it regardless the timer rework.
v4: (DK/CI): Add VLV || CHV check on cancel work atpsr_disable.
v5: Kill remaining items and fully rework activation functions.
v6: Rebase on top of VLV/CHV clean-up and keep the reactivation on a regular non-delayed work to avoid extra delays on exit calls and allow us to add few more safety checks before real activation.We have to implement this bspec step in the disable sequence now that
you are removing the delay -
"Wait forSRD_STATUSto show SRD is Idle. This will take up to one full
frame time (1/refresh rate), plus SRD exit training time (max of 6ms),
plus SRD aux channel handshake (max of 1.5ms)."
Quoted 3 lines
Quoted 2 lines
Otherwise, we can end up re-enabling right after a disable in
psr_exit()It is still waiting PSR idle before renable.
Oh yeah, we do wait in psr_activate.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 148 lines
Quoted 1 line
Quoted 1 line
Cc Dhinakaran Pandiyan <[email protected]>Reviewed-by José Roberto de Souza <[email protected]>Quoted 145 lines
Quoted 101 lines
Signed-off-by Rodrigo Vivi <[email protected]>---
drivers/gpu/drm/i915/i915_debugfs.c | 2 -- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/intel_psr.c | 29 +++++++--------------
----
----3 files changed, 8 insertions(+), 25 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +0
-0@@ -2660,8 +2660,6 @@ static int i915_edp_psr_status(struct
seq_file
*m, void *data)
seq_printf(m, "Enabled: %s\n", yesno((bool)dev_priv-Quoted 2 lines
psr.enabled));
seq_printf(m, "Busy frontbuffer bits: 0x%03x\n", dev_priv->psr.busy_frontbuffer_bits);drivers/gpu/drm/i915/i915_debugfs.c +0
-2-seq_printf (m,"Re-enable work scheduled: %s\n" , - yesno(work_busy(&dev_priv->psr.work.work)));
if (dev_priv->psr.psr2_enabled) enabled =I915_READ(EDP_PSR2_CTL)&EDP_PSR2_ENABLE;drivers/gpu/drm/i915/i915_drv.h +1
-1@@ -613,7 +613,7 @@ struct i915_psr { bool sink_support; struct intel_dp *enabled; bool active; -struct delayed_work work; +struct work_struct work; unsigned busy_frontbuffer_bits; bool sink_psr2_support; bool link_standby;drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -671,21 +671,7 @@ void intel_psr_enable(struct intel_dp *intel_dp, dev_priv->psr.enable_source(intel_dp, crtc_state); dev_priv->psr.enabled = intel_dp;drivers/gpu/drm/i915/intel_psr.c +0
-5-if (INTEL_GEN (dev_priv) >=9 ) { -intel_psr_activate (intel_dp); - }else { -/* -* FIXME: Activation should happen immediately since
thisdrivers/gpu/drm/i915/intel_psr.c +0
-1- * function is just called after pipe is fullytrained and
drivers/gpu/drm/i915/intel_psr.c +0
-2- * enabled. - * However on some platforms we face issues whenfirst
drivers/gpu/drm/i915/intel_psr.c +0
-2- * activation follows a modeset so quickly. - * - On HSW/BDW we get a recoverable frozenscreen until
drivers/gpu/drm/i915/intel_psr.c +0
-4-* next exit-activate sequence. -*/ - schedule_delayed_work(&dev_priv->psr.work, - msecs_to_jiffies(intel_dp-Quoted 2 lines
panel_power_cycle_delay* 5));drivers/gpu/drm/i915/intel_psr.c +1
-1- } +intel_psr_activate (intel_dp);
unlock:
mutex_unlock(&dev_priv->psr.lock);drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -768,8 +754,6 @@ void intel_psr_disable(struct intel_dp *intel_dp,
dev_priv->psr.enabled= NULL;
mutex_unlock(&dev_priv->psr.lock);drivers/gpu/drm/i915/intel_psr.c +0
-2- -cancel_delayed_work_sync (&dev_priv->psr.work);}
static boolpsr_wait_for_idle(struct drm_i915_private *dev_priv)drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -805,10 +789,13 @@ static bool psr_wait_for_idle(struct drm_i915_private *dev_priv) static void intel_psr_work(struct work_struct *work) {struct
drm_i915_private*dev_priv=drivers/gpu/drm/i915/intel_psr.c +0
-1- container_of(work, typeof(*dev_priv),psr.work.work);
drivers/gpu/drm/i915/intel_psr.c +1
-0+container_of (work,typeof (*dev_priv), psr.work);
mutex_lock(&dev_priv->psr.lock);drivers/gpu/drm/i915/intel_psr.c static bool psr_wait_for_idle(struct drm_i915_private *dev_priv) · line 798
Quoted 3 lines
drivers/gpu/drm/i915/intel_psr.c +3
-0+if (!dev_priv->psr.enabled) + goto unlock; +I thought
flush_work()was missing inpsr_disable(), but this check should take care of not enabling PSR afterpsr_disable()Quoted 30 lines
/*
* We have to make sure PSR is ready for re-enable
* otherwise it keeps disabled until next full enable/disable cycle.drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -949,9 +936,7 @@ void intel_psr_flush(struct drm_i915_private *dev_priv, }
if (!dev_priv->psr.active && !dev_priv-Quoted 2 lines
psr.busy_frontbuffer_bits)
drivers/gpu/drm/i915/intel_psr.c +0
-2-if (!work_busy (&dev_priv->psr.work.work)) - schedule_delayed_work(&dev_priv-Quoted 1 line
psr.work,
drivers/gpu/drm/i915/intel_psr.c +0
-1- msecs_to_jiffies(100
))
;drivers/gpu/drm/i915/intel_psr.c +1
-0+schedule_work (&dev_priv->psr.work);
mutex_unlock(&dev_priv->psr.lock);
}drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -998,7 +983,7 @@ void intel_psr_init(struct drm_i915_private *dev_priv) dev_priv->psr.link_standby = false; }drivers/gpu/drm/i915/intel_psr.c +1
-1-INIT_DELAYED_WORK (&dev_priv->psr.work, intel_psr_work); +INIT_WORK (&dev_priv->psr.work, intel_psr_work);Quoted 3 lines
mutex_init(&dev_priv->psr.lock);
dev_priv->psr.enable_source=hsw_psr_enable_source;_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 38 lines · Dhinakaran Pandiyan
Quoted 37 lines · Jose
Quoted 36 lines · Dhinakaran Pandiyan
Quoted 16 lines · Rodrigo Vivi
The immediate enabling was actually not an issue for the HW perspective for core platforms that have HW tracking. HW will wait few identical idle frames before transitioning to actual psr active anyways.
Now that we removed VLV/CHV out of the picture completely we can safely remove any delays.
Note that this patch also remove the delayed activation on HSW and BDW introduced by commit '
d0ac896a477d("drm/i915: Delay first PSR activation.")'. This was introduced to fix a blank screen on VLV/CHV and also masked some frozen screens on other core platforms. Probably the same that we are now properly hunting and fixing.Quoted 9 lines
v2:(DK): Remove unnecessary
WARN_ONsand make some other VLV | CHV more readable.
v3: Do it regardless the timer rework.
v4: (DK/CI): Add VLV || CHV check on cancel work atpsr_disable.
v5: Kill remaining items and fully rework activation functions.
v6: Rebase on top of VLV/CHV clean-up and keep the reactivation on a regular non-delayed work to avoid extra delays on exit calls and allow us to add few more safety checks before real activation.We have to implement this bspec step in the disable sequence now that
you are removing the delay -
"Wait forSRD_STATUSto show SRD is Idle. This will take up to one full
frame time (1/refresh rate), plus SRD exit training time (max of 6ms),
plus SRD aux channel handshake (max of 1.5ms)."
Quoted 18 lines
Quoted 3 lines
Quoted 2 lines
Otherwise, we can end up re-enabling right after a disable in
psr_exit()It is still waiting PSR idle before renable.
Oh yeah, we do wait in
psr_activate.Reviewed-by Dhinakaran Pandiyan <[email protected]>Quoted 10 lines
Quoted 9 lines
Quoted 9 lines
Cc Dhinakaran Pandiyan <[email protected]>Reviewed-by José Roberto de Souza <[email protected]>
pushed to dinq, thank you both for reviewing.
Quoted 138 lines
Quoted 138 lines
Quoted 138 lines
Quoted 102 lines
Signed-off-by Rodrigo Vivi <[email protected]>---
drivers/gpu/drm/i915/i915_debugfs.c | 2 -- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/intel_psr.c | 29 +++++++--------------
----
----3 files changed, 8 insertions(+), 25 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +0
-0@@ -2660,8 +2660,6 @@ static int i915_edp_psr_status(struct
seq_file
*m, void *data)
seq_printf(m, "Enabled: %s\n", yesno((bool)dev_priv-Quoted 2 lines
psr.enabled));
seq_printf(m, "Busy frontbuffer bits: 0x%03x\n", dev_priv->psr.busy_frontbuffer_bits);drivers/gpu/drm/i915/i915_debugfs.c +0
-2-seq_printf (m,"Re-enable work scheduled: %s\n" , - yesno(work_busy(&dev_priv->psr.work.work)));
if (dev_priv->psr.psr2_enabled) enabled =I915_READ(EDP_PSR2_CTL)&EDP_PSR2_ENABLE;drivers/gpu/drm/i915/i915_drv.h +1
-1@@ -613,7 +613,7 @@ struct i915_psr { bool sink_support; struct intel_dp *enabled; bool active; -struct delayed_work work; +struct work_struct work; unsigned busy_frontbuffer_bits; bool sink_psr2_support; bool link_standby;drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -671,21 +671,7 @@ void intel_psr_enable(struct intel_dp *intel_dp, dev_priv->psr.enable_source(intel_dp, crtc_state); dev_priv->psr.enabled = intel_dp;drivers/gpu/drm/i915/intel_psr.c +0
-5-if (INTEL_GEN (dev_priv) >=9 ) { -intel_psr_activate (intel_dp); - }else { -/* -* FIXME: Activation should happen immediately since
thisdrivers/gpu/drm/i915/intel_psr.c +0
-1- * function is just called after pipe is fullytrained and
drivers/gpu/drm/i915/intel_psr.c +0
-2- * enabled. - * However on some platforms we face issues whenfirst
drivers/gpu/drm/i915/intel_psr.c +0
-2- * activation follows a modeset so quickly. - * - On HSW/BDW we get a recoverable frozenscreen until
drivers/gpu/drm/i915/intel_psr.c +0
-4-* next exit-activate sequence. -*/ - schedule_delayed_work(&dev_priv->psr.work, - msecs_to_jiffies(intel_dp-Quoted 2 lines
panel_power_cycle_delay* 5));drivers/gpu/drm/i915/intel_psr.c +1
-1- } +intel_psr_activate (intel_dp);
unlock:
mutex_unlock(&dev_priv->psr.lock);drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -768,8 +754,6 @@ void intel_psr_disable(struct intel_dp *intel_dp,
dev_priv->psr.enabled= NULL;
mutex_unlock(&dev_priv->psr.lock);drivers/gpu/drm/i915/intel_psr.c +0
-2- -cancel_delayed_work_sync (&dev_priv->psr.work);}
static boolpsr_wait_for_idle(struct drm_i915_private *dev_priv)drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -805,10 +789,13 @@ static bool psr_wait_for_idle(struct drm_i915_private *dev_priv) static void intel_psr_work(struct work_struct *work) {struct
drm_i915_private*dev_priv=drivers/gpu/drm/i915/intel_psr.c +0
-1- container_of(work, typeof(*dev_priv),psr.work.work);
drivers/gpu/drm/i915/intel_psr.c +1
-0+container_of (work,typeof (*dev_priv), psr.work);
mutex_lock(&dev_priv->psr.lock);drivers/gpu/drm/i915/intel_psr.c static bool psr_wait_for_idle(struct drm_i915_private *dev_priv) · line 798
Quoted 3 lines
drivers/gpu/drm/i915/intel_psr.c +3
-0+if (!dev_priv->psr.enabled) + goto unlock; +I thought
flush_work()was missing inpsr_disable(), but this check should take care of not enabling PSR afterpsr_disable()Quoted 29 lines
/*
* We have to make sure PSR is ready for re-enable
* otherwise it keeps disabled until next full enable/disable cycle.drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -949,9 +936,7 @@ void intel_psr_flush(struct drm_i915_private *dev_priv, }
if (!dev_priv->psr.active && !dev_priv-Quoted 2 lines
psr.busy_frontbuffer_bits)
drivers/gpu/drm/i915/intel_psr.c +0
-2-if (!work_busy (&dev_priv->psr.work.work)) - schedule_delayed_work(&dev_priv-Quoted 1 line
psr.work,
drivers/gpu/drm/i915/intel_psr.c +0
-1- msecs_to_jiffies(100
))
;drivers/gpu/drm/i915/intel_psr.c +1
-0+schedule_work (&dev_priv->psr.work);
mutex_unlock(&dev_priv->psr.lock);
}drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -998,7 +983,7 @@ void intel_psr_init(struct drm_i915_private *dev_priv) dev_priv->psr.link_standby = false; }drivers/gpu/drm/i915/intel_psr.c +0
-1-INIT_DELAYED_WORK (&dev_priv->psr.work, intel_psr_work);
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
drivers/gpu/drm/i915/intel_psr.c +1
-0+INIT_WORK (&dev_priv->psr.work, intel_psr_work);
mutex_init(&dev_priv->psr.lock);
dev_priv->psr.enable_source=hsw_psr_enable_source;_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 136 lines · Dhinakaran Pandiyan
Quoted 16 lines · Rodrigo Vivi
The immediate enabling was actually not an issue for the HW perspective for core platforms that have HW tracking. HW will wait few identical idle frames before transitioning to actual psr active anyways.
Now that we removed VLV/CHV out of the picture completely we can safely remove any delays.
Note that this patch also remove the delayed activation on HSW and BDW introduced by commit '
d0ac896a477d("drm/i915: Delay first PSR activation.")'. This was introduced to fix a blank screen on VLV/CHV and also masked some frozen screens on other core platforms. Probably the same that we are now properly hunting and fixing.Quoted 9 lines
v2:(DK): Remove unnecessary
WARN_ONsand make some other VLV | CHV more readable.
v3: Do it regardless the timer rework.
v4: (DK/CI): Add VLV || CHV check on cancel work atpsr_disable.
v5: Kill remaining items and fully rework activation functions.
v6: Rebase on top of VLV/CHV clean-up and keep the reactivation on a regular non-delayed work to avoid extra delays on exit calls and allow us to add few more safety checks before real activation.We have to implement this bspec step in the disable sequence now that you are removing the delay -
"Wait forSRD_STATUSto show SRD is Idle. This will take up to one full
frame time (1/refresh rate), plus SRD exit training time (max of 6ms),
plus SRD aux channel handshake (max of 1.5ms)."Otherwise, we can end up re-enabling right after a disable in
psr_exit()Quoted 98 lines
Cc Dhinakaran Pandiyan <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>---
drivers/gpu/drm/i915/i915_debugfs.c | 2 -- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/intel_psr.c | 29 +++++++------------------
----3 files changed, 8 insertions(+), 25 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +0
-0@@ -2660,8 +2660,6 @@ static int i915_edp_psr_status(struct
seq_file
*m, void *data)
seq_printf(m, "Enabled: %s\n", yesno((bool)dev_priv-Quoted 2 lines
psr.enabled));
seq_printf(m, "Busy frontbuffer bits: 0x%03x\n", dev_priv->psr.busy_frontbuffer_bits);drivers/gpu/drm/i915/i915_debugfs.c +0
-2-seq_printf (m,"Re-enable work scheduled: %s\n" , - yesno(work_busy(&dev_priv->psr.work.work)));
if (dev_priv->psr.psr2_enabled) enabled =I915_READ(EDP_PSR2_CTL)&EDP_PSR2_ENABLE;drivers/gpu/drm/i915/i915_drv.h +1
-1@@ -613,7 +613,7 @@ struct i915_psr { bool sink_support; struct intel_dp *enabled; bool active; -struct delayed_work work; +struct work_struct work; unsigned busy_frontbuffer_bits; bool sink_psr2_support; bool link_standby;drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -671,21 +671,7 @@ void intel_psr_enable(struct intel_dp *intel_dp, dev_priv->psr.enable_source(intel_dp, crtc_state); dev_priv->psr.enabled = intel_dp;drivers/gpu/drm/i915/intel_psr.c +0
-5-if (INTEL_GEN (dev_priv) >=9 ) { -intel_psr_activate (intel_dp); - }else { -/* -* FIXME: Activation should happen immediately since
thisdrivers/gpu/drm/i915/intel_psr.c +0
-1- * function is just called after pipe is fullytrained and
drivers/gpu/drm/i915/intel_psr.c +0
-2- * enabled. - * However on some platforms we face issues whenfirst
drivers/gpu/drm/i915/intel_psr.c +0
-2- * activation follows a modeset so quickly. - * - On HSW/BDW we get a recoverable frozenscreen until
drivers/gpu/drm/i915/intel_psr.c +0
-4-* next exit-activate sequence. -*/ - schedule_delayed_work(&dev_priv->psr.work, - msecs_to_jiffies(intel_dp-Quoted 2 lines
panel_power_cycle_delay* 5));drivers/gpu/drm/i915/intel_psr.c +1
-1- } +intel_psr_activate (intel_dp);
unlock:
mutex_unlock(&dev_priv->psr.lock);drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -768,8 +754,6 @@ void intel_psr_disable(struct intel_dp *intel_dp,
dev_priv->psr.enabled= NULL;
mutex_unlock(&dev_priv->psr.lock);drivers/gpu/drm/i915/intel_psr.c +0
-2- -cancel_delayed_work_sync (&dev_priv->psr.work);}
static boolpsr_wait_for_idle(struct drm_i915_private *dev_priv)drivers/gpu/drm/i915/intel_psr.c +0
-0@@ -805,10 +789,13 @@ static bool psr_wait_for_idle(struct drm_i915_private *dev_priv) static void intel_psr_work(struct work_struct *work) {struct
drm_i915_private*dev_priv=drivers/gpu/drm/i915/intel_psr.c +0
-1- container_of(work, typeof(*dev_priv),psr.work.work);
drivers/gpu/drm/i915/intel_psr.c +1
-0+container_of (work,typeof (*dev_priv), psr.work);
Quoted 9 lines
drivers/gpu/drm/i915/intel_psr.c static bool psr_wait_for_idle(struct drm_i915_private *dev_priv) · line 798
Quoted 6 lines
mutex_lock(&dev_priv->psr.lock);drivers/gpu/drm/i915/intel_psr.c +3
-0+if (!dev_priv->psr.enabled) + goto unlock; +I thought
flush_work()was missing inpsr_disable(), but this check should take care of not enabling PSR afterpsr_disable()
Looks like a cancel_work_sync() is still needed,
https://bugs.freedesktop.org/show_bug.cgi?id=106948
If the work item was already scheduled and is followed by psr_disable -> psr_enable, we'll end up hitting the psr.active warning.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915/psr: Kill delays when activating psr back.
In reply to Rodrigo Vivi== Series Details ==
== Series Details ==
Series: drm/i915/psr: Kill delays when activating psr back.
URL : https://patchwork.freedesktop.org/series/44715/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4311_full -> Patchwork_9294_full =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_9294_full need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_9294_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_9294_full:
=== IGT changes ===
==== Warnings ====
igt@gem_mocs_settings@mocs-rc6-bsd2:
shard-kbl: PASS -> SKIP
igt@gem_mocs_settings@mocs-rc6-ctx-dirty-render:
shard-kbl: SKIP -> PASS
igt@pm_rc6_residency@rc6-accuracy:
shard-snb: SKIP -> PASS== Known issues ==
Here are the changes found in Patchwork_9294_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@gem_ppgtt@blt-vs-render-ctx0:
shard-kbl: PASS -> INCOMPLETE (fdo#106023, fdo#103665)
igt@gem_wait@await-bsd2:
shard-snb: SKIP -> INCOMPLETE (fdo#105411)
igt@kms_vblank@pipe-c-ts-continuation-idle:
shard-glk: PASS -> DMESG-WARN (fdo#106247)
==== Possible fixes ====
igt@kms_flip@2x-plain-flip-fb-recreate-interruptible:
shard-glk: FAIL (fdo#100368) -> PASS +1
igt@kms_flip@2x-plain-flip-ts-check:
shard-hsw: FAIL (fdo#100368) -> PASS
igt@kms_flip_tiling@flip-x-tiled:
shard-glk: FAIL (fdo#104724, fdo#103822) -> PASS
igt@kms_setmode@basic:
shard-apl: FAIL (fdo#99912) -> PASS
==== Warnings ====
igt@drv_selftest@live_gtt:
shard-kbl: FAIL (fdo#105347) -> INCOMPLETE (fdo#103665) fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#105347 https://bugs.freedesktop.org/show_bug.cgi?id=105347
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
fdo#106247 https://bugs.freedesktop.org/show_bug.cgi?id=106247
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (5 -> 5) ==
No changes in participating hosts
== Build changes ==
* Linux: CI_DRM_4311 -> Patchwork_9294
CI_DRM_4311: 875eebee4a444f5b7ba146754e91118ff3c11ad5 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4518: e4908004547b63131352fbc0ddcdb1d3d55480e0 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9294: 5191095d6bf24d10318f10ed6e2a01287730ae32 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9294/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx