drm/i915: Improve PSR activation timing
The current PSR code has a two call sites that each schedule delayed
work to activate PSR. As far as I can tell, each call site intends
to keep PSR inactive for the given amount of time and then allow it
to be activated.
The call sites are:
- intel_psr_enable(), which explicitly states in a comment that
it's trying to keep PSR off a short time after the dispay is
initialized as a workaround.
- intel_psr_flush(). There isn't an explcit explanation, but the
intent is presumably to keep PSR off until the display has been
idle for 100ms.
The current code doesn't actually accomplish either of these goals.
Rather than keeping PSR inactive for the given amount of time, it
will schedule PSR for activation after the given time, with the
earliest target time in such a request winning.
In other words, if intel_psr_enable() is immediately followed by
intel_psr_flush(), then PSR will be activated after 100ms even if
intel_psr_enable() wanted a longer delay. And, if the screen is
being constantly updated so that intel_psr_flush() is called once
per frame at 60Hz, PSR will still be activated once every 100ms.
Rewrite the code so that it does what was intended. This adds
a new function intel_psr_schedule(), which will enable PSR after
the requested time but no sooner.
Signed-off-by: Andy Lutomirski <luto@kernel.org>
3 files changed