From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
jouni.hogander@intel.com, animesh.manna@intel.com
Subject: Re: [PATCH 10/10] drm/i915/display: Prepare for vblank_delay for LRR
Date: Wed, 15 Oct 2025 18:00:29 +0300 [thread overview]
Message-ID: <aO-3DSHSHX4lD1cV@intel.com> (raw)
In-Reply-To: <20251015072217.1710717-11-ankit.k.nautiyal@intel.com>
On Wed, Oct 15, 2025 at 12:52:17PM +0530, Ankit Nautiyal wrote:
> Update allow_vblank_delay_fastset() to permit vblank delay adjustments
> during with LRR when VRR TG is always active.
>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index ceee5ae99c2c..65a7da694ef6 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -4958,9 +4958,15 @@ static bool allow_vblank_delay_fastset(const struct intel_crtc_state *old_crtc_s
> * Allow fastboot to fix up vblank delay (handled via LRR
> * codepaths), a bit dodgy as the registers aren't
> * double buffered but seems to be working more or less...
> + *
> + * Also allow this when the VRR timing generator is always on,
> + * and optimized guardband is used. In such cases,
> + * vblank delay may vary even without inherited state, but it's
> + * still safe as VRR guardband is still same.
> */
> - return HAS_LRR(display) && old_crtc_state->inherited &&
> - !intel_crtc_has_type(old_crtc_state, INTEL_OUTPUT_DSI);
> + return HAS_LRR(display) &&
> + (old_crtc_state->inherited || intel_vrr_always_use_vrr_tg(display)) &&
> + !intel_crtc_has_type(old_crtc_state, INTEL_OUTPUT_DSI);
I suppose this won't actually do anything until we get the fixed
guardband size in place. But with that I suppose it is the right
thing to do.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
However I was pondering about the place where do timing generator
reprogramming. Currently that is done from within the vblank evasion
critical section. But that is actually wrong because the VRR registers
aren't double buffered. So in the worst case we'll evade the previous
vblank start, and then reprogram the timing generator which could
move the vblank start to be just ahead of the current scanline and
then the commit will end up straddling the start of vblank (which is
exactly what the vblank evasion tried to prevent).
So I think we'll have to move the timing generator update to happen
after we've done all the double buffered register programming. I suppose
that might still be technically wrong as then the position of the
delayed vblank might still move before the double buffered registers
have been latched. I don't think that shouldn't cause any underruns/etc.
but in the worst case the start of vblank moves backwards past the
current scanline, and then the registers don't actually latch until the
next frame.
I wonder if we should use the vblank worker here to do the timing
generator update right after the delayed vblank? That would guarantee
that the current delayed vblank stays in place until the register have
been latched.
Though we may still end up in at least two weird scenarios:
- delayed vblank moves forward, and we might get two delayed vblank
events for the same frame
- vtotal gets reduced below the current delayed vblank start. Which
I suppose means the vtotal for the frame will not necessarily be
the old or new vtotal value, but something in between.
That's all assuming certain behaviours of the VRR timing generator
of course. I haven't actuall confirmed how the hardware behaves
in either case. We should probably do some more hw poking at some
point to really figure this stuff out...
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2025-10-15 15:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 7:22 [PATCH 00/10] Preparatory patches for guardband optimization Ankit Nautiyal
2025-10-15 7:22 ` [PATCH 01/10] drm/i915/vrr: Use crtc_vsync_start/end for computing vrr.vsync_start/end Ankit Nautiyal
2025-10-15 7:22 ` [PATCH 02/10] drm/i915/display: Move intel_dpll_crtc_compute_clock early Ankit Nautiyal
2025-10-15 7:22 ` [PATCH 03/10] drm/i915/vrr: s/intel_vrr_compute_config_late/intel_vrr_compute_guardband Ankit Nautiyal
2025-10-15 7:22 ` [PATCH 04/10] drm/i915/vblank: Add helper to get correct vblank length Ankit Nautiyal
2025-10-15 7:22 ` [PATCH 05/10] drm/i915/psr: Consider SCL lines when validating vblank for wake latency Ankit Nautiyal
2025-10-15 7:22 ` [PATCH 06/10] drm/i915/psr: Introduce helper intel_psr_set_non_psr_pipes() Ankit Nautiyal
2025-10-15 7:57 ` Hogander, Jouni
2025-10-15 7:22 ` [PATCH 07/10] drm/i915/display: Introduce dp/psr_compute_config_late() Ankit Nautiyal
2025-10-15 7:59 ` Hogander, Jouni
2025-10-15 7:22 ` [PATCH 08/10] drm/i915/psr: Check if final vblank is sufficient for PSR features Ankit Nautiyal
2025-10-15 8:23 ` Hogander, Jouni
2025-10-15 8:33 ` Hogander, Jouni
2025-10-15 9:14 ` Ankit Nautiyal
2025-10-15 9:32 ` Hogander, Jouni
2025-10-15 7:22 ` [PATCH 09/10] drm/i915/display: Add vblank_start adjustment logic for always-on VRR TG Ankit Nautiyal
2025-10-15 13:54 ` Ville Syrjälä
2025-10-15 7:22 ` [PATCH 10/10] drm/i915/display: Prepare for vblank_delay for LRR Ankit Nautiyal
2025-10-15 15:00 ` Ville Syrjälä [this message]
2025-10-15 11:07 ` ✓ i915.CI.BAT: success for Preparatory patches for guardband optimization (rev7) Patchwork
2025-10-15 17:12 ` ✗ i915.CI.Full: failure " Patchwork
2025-10-16 5:24 ` ✓ i915.CI.Full: success " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2025-10-16 5:54 [PATCH 00/10] Preparatory patches for guardband optimization Ankit Nautiyal
2025-10-16 5:54 ` [PATCH 10/10] drm/i915/display: Prepare for vblank_delay for LRR Ankit Nautiyal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aO-3DSHSHX4lD1cV@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=animesh.manna@intel.com \
--cc=ankit.k.nautiyal@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jouni.hogander@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox