public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 15/15] drm/i915/display: Use optimized guardband to set vblank start
Date: Wed, 1 Oct 2025 18:46:19 +0530	[thread overview]
Message-ID: <3093e04d-36a6-4f1e-be99-600ce3b85c20@intel.com> (raw)
In-Reply-To: <aN0aNFjModmYJ3Lf@intel.com>


On 10/1/2025 5:40 PM, Ville Syrjälä wrote:
> On Wed, Oct 01, 2025 at 04:04:37PM +0530, Nautiyal, Ankit K wrote:
>> On 9/29/2025 2:15 PM, Ville Syrjälä wrote:
>>> On Sun, Sep 28, 2025 at 12:35:40PM +0530, Ankit Nautiyal wrote:
>>>> +static void intel_crtc_vblank_delay(struct intel_atomic_state *state,
>>>> +				    struct intel_crtc *crtc)
>>>> +{
>>>> +	struct intel_crtc_state *crtc_state =
>>>> +		intel_atomic_get_new_crtc_state(state, crtc);
>>>> +	struct drm_display_mode *adjusted_mode =
>>>> +		&crtc_state->hw.adjusted_mode;
>>>> +	int vblank_delay = 0;
>>>> +
>>>> +	vblank_delay = intel_crtc_min_guardband_delay(state, crtc);
>>>> +
>>>> +	adjusted_mode->crtc_vblank_start += vblank_delay;
>>> The situation with crtc_vblank_start is already kinda broken,
>>> and I think we need to fix that first somehow.
>>>
>>> Currently crtc_vblank_start is assumed to be the vblank_start
>>> for the fixed refresh rate case. That value can be different
>>> from the variable refresh rate case whenever
>>> always_use_vrr_tg()==false. On icl/tgl it's always different
>>> due to the extra vblank delay, and also on adl+ it could be
>>> different if we were to use an optimized guardband.
>>>
>>> I think there are a few options how we might solve this:
>>> 1. keep crtc_vblank_start as is, and make sure every user of it
>>>      gets adjusted to also deal with the vrr case correctly
>>
>> Alright, so we avoid changing the vblank_start.
>> It means for platforms with always_use_vrr_tg()==true we directly set
>> the value for guardband. (Currently I was getting it from vmin_vtotal -
>> vblank_start)
>> For platforms ADL+ with always always_use_vrr_tg()== false for the fixed
>> refresh rate case, guardband is full vblank_length for variable refresh
>> rate set the guardband directly.
> I think we could just use something like this:
>
> something_something_vblank_len()
> {
> 	if (crtc_state->vrr.enable)
> 		return crtc_state->vrr.guardband;
> 	else
> 		return adjuste_mode.crtc_vtotal -
> 			adjusted_mode.crtc_vblank_start;
> }
>
> That should work fine for for both values of always_use_vrr_tg().

Yep I had something similar in mind.


>
>> As you have mentioned need to check which all places we need vblank_start.
>>
>> For ICL/TGL we do not use optimization for now, right?
> Effectively we do, because of intel_vrr_extra_vblank_delay().
> The VRR guardband is always one line less than the fixed refresh
> rate guardband. And if we run into the max pipeline full limit
> then the difference would be even larger.

Oh ok, got it.


>
>> The extra_vblank_delay quirk is already handled while filling the
>> registers.
>>
>>
>>> 2. enable always_use_vrr_tg() whenever there might be switch
>>>      between vrr and fixed refresh rate, which I think would mean
>>>      crtc_state->vrr.in_range==true.
>> I think I didnt get this part:
>> Do you mean later at some point we move to option 2:
>> always_use_vrr_tg()==true for all platforms.(Need to check if we can do
>> it for ICL, TGL).
> I'm pretty sure I tested always_use_vrr_tg()==true briefly on
> TGL and ADL and it seemed to be working fine.
>
> But I'm a bit concerned becase we originally enabled the VRR timing
> generator earlier during the modeset (but not from the very start IIRC),
> and that wasn't working all that well on some systems. So later I
> changed things to keep running with the legacy TG for the modeset and
> only switch to the VRR TG at the very end. It might have been some MTL
> system where we had these problems actually...
>
> It's of course possible that we've since fixed whatever was the
> underlying cause there. Or maybe the problem really was that we
> started to use the VRR timings already during the modeset. With the
> current always_use_vrr_tg()==true code we will still use the fixed
> refresh rate timings for the modeset, and switch to the VRR timings
> only at the very end.

Hmm I think PSR was giving problem with fixed refresh rate mode for TGL 
when I had tried that, but it was long back.

Need to recheck that.

Thanks for clearing things up.

Regards,

Ankit

>

  reply	other threads:[~2025-10-01 13:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-28  7:05 [PATCH 00/15] Optimize vrr.guardband and fix LRR Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 01/15] drm/i915/vrr: Use crtc_vsync_start/end for computing vrr.vsync_start/end Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 02/15] drm/i915/skl_watermark: Fix the scaling factor for chroma subsampling Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 03/15] drm/i915/skl_watermark: Pass linetime as argument to latency helpers Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 04/15] drm/i915/skl_scaler: Introduce helper for chroma downscale factor Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 05/15] drm/i915/display: Extract helpers to set dsc/scaler prefill latencies Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 06/15] drm/i915/dp: Add SDP latency computation helper Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 07/15] drm/i915/alpm: Add function to compute max link-wake latency Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 08/15] drm/i915/display: Add guardband check for feature latencies Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 09/15] drm/i915/skl_watermark: Remove redundant latency checks from vblank validation Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 10/15] drm/i915/vrr: Introduce helper to compute min static guardband Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 11/15] drm/i915/vrr: Use optimized guardband when VRR TG is active Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 12/15] drm/i915/vrr: Prepare for movement of vblank start for optimized guardband Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 13/15] drm/i915/display: Recompute crtc_vblank_start " Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 14/15] drm/i915/display: s/allow_vblank_delay_fastset/allow_vblank_delay_fastset_lrr Ankit Nautiyal
2025-09-28  7:05 ` [PATCH 15/15] drm/i915/display: Use optimized guardband to set vblank start Ankit Nautiyal
2025-09-29  8:45   ` Ville Syrjälä
2025-09-29  9:09     ` Ville Syrjälä
2025-09-29  9:21     ` Ville Syrjälä
2025-10-01 10:34     ` Nautiyal, Ankit K
2025-10-01 12:10       ` Ville Syrjälä
2025-10-01 13:16         ` Nautiyal, Ankit K [this message]
2025-09-29  9:00   ` Ville Syrjälä
2025-10-01 10:41     ` Nautiyal, Ankit K
2025-10-01 12:12       ` Ville Syrjälä
2025-10-01 13:17         ` Nautiyal, Ankit K
2025-09-28  8:07 ` ✗ i915.CI.BAT: failure for Optimize vrr.guardband and fix LRR (rev12) Patchwork

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=3093e04d-36a6-4f1e-be99-600ce3b85c20@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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