Skip to content

Commit 5422b37

Browse files
committed
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. Cc: Dhinakaran Pandiyan <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]> Reviewed-by: José Roberto de Souza <[email protected]> Reviewed-by: Dhinakaran Pandiyan <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a2bbf71 commit 5422b37

File tree

3 files changed

+8
-25
lines changed

3 files changed

+8
-25
lines changed

drivers/gpu/drm/i915/i915_debugfs.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2660,8 +2660,6 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
26602660
seq_printf(m, "Enabled: %s\n", yesno((bool)dev_priv->psr.enabled));
26612661
seq_printf(m, "Busy frontbuffer bits: 0x%03x\n",
26622662
dev_priv->psr.busy_frontbuffer_bits);
2663-
seq_printf(m, "Re-enable work scheduled: %s\n",
2664-
yesno(work_busy(&dev_priv->psr.work.work)));
26652663

26662664
if (dev_priv->psr.psr2_enabled)
26672665
enabled = I915_READ(EDP_PSR2_CTL) & EDP_PSR2_ENABLE;

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ struct i915_psr {
613613
bool sink_support;
614614
struct intel_dp *enabled;
615615
bool active;
616-
struct delayed_work work;
616+
struct work_struct work;
617617
unsigned busy_frontbuffer_bits;
618618
bool sink_psr2_support;
619619
bool link_standby;

drivers/gpu/drm/i915/intel_psr.c

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -671,21 +671,7 @@ void intel_psr_enable(struct intel_dp *intel_dp,
671671
dev_priv->psr.enable_source(intel_dp, crtc_state);
672672
dev_priv->psr.enabled = intel_dp;
673673

674-
if (INTEL_GEN(dev_priv) >= 9) {
675-
intel_psr_activate(intel_dp);
676-
} else {
677-
/*
678-
* FIXME: Activation should happen immediately since this
679-
* function is just called after pipe is fully trained and
680-
* enabled.
681-
* However on some platforms we face issues when first
682-
* activation follows a modeset so quickly.
683-
* - On HSW/BDW we get a recoverable frozen screen until
684-
* next exit-activate sequence.
685-
*/
686-
schedule_delayed_work(&dev_priv->psr.work,
687-
msecs_to_jiffies(intel_dp->panel_power_cycle_delay * 5));
688-
}
674+
intel_psr_activate(intel_dp);
689675

690676
unlock:
691677
mutex_unlock(&dev_priv->psr.lock);
@@ -768,8 +754,6 @@ void intel_psr_disable(struct intel_dp *intel_dp,
768754

769755
dev_priv->psr.enabled = NULL;
770756
mutex_unlock(&dev_priv->psr.lock);
771-
772-
cancel_delayed_work_sync(&dev_priv->psr.work);
773757
}
774758

775759
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)
805789
static void intel_psr_work(struct work_struct *work)
806790
{
807791
struct drm_i915_private *dev_priv =
808-
container_of(work, typeof(*dev_priv), psr.work.work);
792+
container_of(work, typeof(*dev_priv), psr.work);
809793

810794
mutex_lock(&dev_priv->psr.lock);
811795

796+
if (!dev_priv->psr.enabled)
797+
goto unlock;
798+
812799
/*
813800
* We have to make sure PSR is ready for re-enable
814801
* otherwise it keeps disabled until next full enable/disable cycle.
@@ -949,9 +936,7 @@ void intel_psr_flush(struct drm_i915_private *dev_priv,
949936
}
950937

951938
if (!dev_priv->psr.active && !dev_priv->psr.busy_frontbuffer_bits)
952-
if (!work_busy(&dev_priv->psr.work.work))
953-
schedule_delayed_work(&dev_priv->psr.work,
954-
msecs_to_jiffies(100));
939+
schedule_work(&dev_priv->psr.work);
955940
mutex_unlock(&dev_priv->psr.lock);
956941
}
957942

@@ -998,7 +983,7 @@ void intel_psr_init(struct drm_i915_private *dev_priv)
998983
dev_priv->psr.link_standby = false;
999984
}
1000985

1001-
INIT_DELAYED_WORK(&dev_priv->psr.work, intel_psr_work);
986+
INIT_WORK(&dev_priv->psr.work, intel_psr_work);
1002987
mutex_init(&dev_priv->psr.lock);
1003988

1004989
dev_priv->psr.enable_source = hsw_psr_enable_source;

0 commit comments

Comments
 (0)