Intel-XE Archive on lore.kernel.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>, <jouni.hogander@intel.com>
Subject: Re: [PATCH 5/5] drm/i915/alpm: Allow LOBF only if window1 > alpm check_entry lines
Date: Thu, 30 Oct 2025 18:45:38 +0530	[thread overview]
Message-ID: <9a1dcb42-3baf-4e76-865d-1ca07bb6427c@intel.com> (raw)
In-Reply-To: <aQM_VK0wTlEiub9O@intel.com>


On 10/30/2025 4:05 PM, Ville Syrjälä wrote:
> On Thu, Oct 30, 2025 at 10:47:55AM +0530, Ankit Nautiyal wrote:
>> LOBF must be disabled if the number of lines within Window 1 is not greater
>> than ALPM_CTL[ALPM Entry Check]
>>
>> Bspec:71041
>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> ---
>>   drivers/gpu/drm/i915/display/intel_alpm.c | 13 +++++++++++++
>>   1 file changed, 13 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c
>> index 1c240dd8d668..58cd0d2a4395 100644
>> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
>> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
>> @@ -255,6 +255,7 @@ void intel_alpm_lobf_compute_config_late(struct intel_dp *intel_dp,
>>   	struct intel_display *display = to_intel_display(intel_dp);
>>   	struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
>>   	int waketime_in_lines, first_sdp_position;
>> +	int window1;
>>   
>>   	if (intel_dp->alpm.lobf_disable_debug) {
>>   		drm_dbg_kms(display->drm, "LOBF is disabled by debug flag\n");
>> @@ -287,6 +288,18 @@ void intel_alpm_lobf_compute_config_late(struct intel_dp *intel_dp,
>>   	if (!intel_alpm_compute_params(intel_dp, crtc_state))
>>   		return;
>>   
>> +	/*
>> +	 * LOBF must be disabled if the number of lines within Window 1 is not
>> +	 * greater than ALPM_CTL[ALPM Entry Check]
>> +	 */
>> +	window1 = adjusted_mode->crtc_vtotal -
>> +		  (adjusted_mode->crtc_vdisplay +
>> +		   crtc_state->vrr.guardband +
>> +		   crtc_state->set_context_latency);
> vdisplay+guardband+scl isn't a value that means anything.
> So the extra parentheses make this rather confusing.

Yes true, vdisplay+guardband+scl doesnt make any sense in itself. What I 
intended was:

vblank = (adjusted_mode->crtc_vtotal - adjusted_mode->crtc_vdisplay);
window1 = vblank - (crtc_state->vrr.guardband + 
crtc_state->set_context_latency);

>
> This also doesn't account for the case where SCL would start already
> in vertical active on PTL+. I know we don't do that currently, but we
> should probably write this in a way that accounts for that so that we
> don't have to rewrite this yet again.

Fair point. Then something like:

vblank = (adjusted_mode->crtc_vtotal - adjusted_mode->crtc_vdisplay);

scl_gb_region = min(vblank, crtc_state->vrr.guardband + 
crtc_state->set_context_latency)
window1 = vblank - scl_gb_region;

>
> Apparently this lobf stuff depends on actually having a window1,
> which means it can only be used if we're using the VRR timing generator
> with an optimized guardband. That means it never did anything (or it
> did things wrong) until you enabled the optimized guardband.

Yeah right. Without optimized guardband, window1 would be always 0 so no 
scope to use this.


>
> It sort of looks like intel_alpm_{pre,post}_plane_update() might
> allow us to enable this even for the 'vrr.enable==true &&
> always_use_vrr_tg()==false' case. Either that or we should just
> enable it for the always_use_vrr_tg()==true case. Whatever the
> case, we definitely seem to be missing some kind of a VRR check
> here.

I was just short of adding check for always_use_vrr_tg() && 
intel_vrr_is_fixed_rr()

Bspec says that lobf can be enabled only with fixed refresh rate and 
mentions flipline = vmin =vmax.

I was not sure if its implicit to enable this only with VRR TG and not 
with legacy timing generator.

Makes sense to replace the existing check with for flipline=vmin=vmax with:

intel_vrr_always_use_vrr_tg() && intel_vrr_is_fixed_rr()


>
> I'm also 90% sure that alpm pre/post plane stuff isn't handling
> DRRS/LRR/etc correctly...

Hmm... 。oO( need to check how DRRS and LRR interact with ALPM pre/post 
plane handling... )


Regards,

Ankit

>
>> +
>> +	if (window1 <= crtc_state->alpm_state.check_entry_lines)
>> +		return;
>> +
>>   	/*
>>   	 * LOBF can only be enabled if the time from the start of the SCL+Guardband
>>   	 * window to the position of the first SDP is greater than the time it takes
>> -- 
>> 2.45.2

      reply	other threads:[~2025-10-30 13:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-30  5:17 [PATCH 0/5] Fix Adaptive Sync SDP for Panel Replay Ankit Nautiyal
2025-10-30  5:17 ` [PATCH 1/5] drm/i915/dp: Fix readback for target_rr in Adaptive Sync SDP Ankit Nautiyal
2025-10-30  8:18   ` Ville Syrjälä
2025-10-30  9:28     ` Nautiyal, Ankit K
2025-10-30  5:17 ` [PATCH 2/5] drm/i915/dp: Allow AS_SDP only if panel replay + auxless alpm is supported Ankit Nautiyal
2025-10-30  8:23   ` Ville Syrjälä
2025-10-30  9:32     ` Nautiyal, Ankit K
2025-10-30  5:17 ` [PATCH 3/5] drm/i915/display: Take into account AS SDP in intel_dp_sdp_min_guardband Ankit Nautiyal
2025-10-30  5:17 ` [PATCH 4/5] drm/i915/alpm: Compute LOBF late after guardband is already determined Ankit Nautiyal
2025-10-30  5:17 ` [PATCH 5/5] drm/i915/alpm: Allow LOBF only if window1 > alpm check_entry lines Ankit Nautiyal
2025-10-30 10:35   ` Ville Syrjälä
2025-10-30 13:15     ` Nautiyal, Ankit K [this message]

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=9a1dcb42-3baf-4e76-865d-1ca07bb6427c@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jouni.hogander@intel.com \
    --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