Quoting Matt Roper (2025-11-03 19:48:27-03:00)
>On Mon, Nov 03, 2025 at 02:18:10PM -0300, Gustavo Sousa wrote:
>> The Windows driver is rejecting non-monotonic ranges latency values for
>> Xe3.  Let's make sure that we do not call make_wm_latency_monotonic()
>> for Xe3 and beyond.
>
>So is Windows just refusing to drive the display at all if the latencies
>look invalid?  If we're trying to match their behavior and avoid
>supporting bogus BIOS values, should we be propagating an error up the
>call stack and failing the display initialization?
>
>If that's too drastic and we want to try to forge onward anyway after
>raising the error message, then is there a reason to also avoid doing
>the value adjustment?  I think the goal was to make sure we weren't
>letting bad settings go through silently, but once we've taken care of
>that it still seems like doing the adjustment might give us a higher
>chance of having a working display output?

When I read Ville's initial feedback (see the discussion at [1]), I
interpreted "reject" possibly as simply refusing to use them and use
only the ones from the initial valid subsequence.  I think Ville might
clarify this.

That said, I believe Ville had a different view of how we should handle
that.  I might have misunderstood something and this patch might not
fully reflect the feedback, though.

Ville, thoughts?

[1] https://lore.kernel.org/all/[email protected]/

--
Gustavo Sousa

>
>
>Matt
>
>> 
>> Also, because of that, let's add a check at the end of
>> adjust_wm_latency() to ensure we raise a warning if the final list of
>> latency values is not monotonic.
>> 
>> Cc: Ville Syrjälä <[email protected]>
>> Suggested-by: Ville Syrjälä <[email protected]>
>> Signed-off-by: Gustavo Sousa <[email protected]>
>> ---
>>  drivers/gpu/drm/i915/display/skl_watermark.c | 17 ++++++++++++++++-
>>  1 file changed, 16 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c 
>> b/drivers/gpu/drm/i915/display/skl_watermark.c
>> index d20c88ebe919..e13324af7afb 100644
>> --- a/drivers/gpu/drm/i915/display/skl_watermark.c
>> +++ b/drivers/gpu/drm/i915/display/skl_watermark.c
>> @@ -3211,6 +3211,18 @@ static void make_wm_latency_monotonic(struct 
>> intel_display *display)
>>          }
>>  }
>>  
>> +static bool is_wm_latency_monotonic(struct intel_display *display)
>> +{
>> +        u16 *wm = display->wm.skl_latency;
>> +        int level, num_levels = display->wm.num_levels;
>> +
>> +        for (level = 1; level < num_levels; level++)
>> +                if (wm[level] < wm[level - 1])
>> +                        return false;
>> +
>> +        return true;
>> +}
>> +
>>  static void
>>  adjust_wm_latency(struct intel_display *display)
>>  {
>> @@ -3221,7 +3233,8 @@ adjust_wm_latency(struct intel_display *display)
>>  
>>          sanitize_wm_latency(display);
>>  
>> -        make_wm_latency_monotonic(display);
>> +        if (DISPLAY_VER(display) < 30)
>> +                make_wm_latency_monotonic(display);
>>  
>>          /*
>>           * WaWmMemoryReadLatency
>> @@ -3241,6 +3254,8 @@ adjust_wm_latency(struct intel_display *display)
>>           */
>>          if (need_16gb_dimm_wa(display))
>>                  increase_wm_latency(display, 1);
>> +
>> +        drm_WARN_ON(display->drm, !is_wm_latency_monotonic(display));
>>  }
>>  
>>  static void mtl_read_wm_latency(struct intel_display *display)
>> 
>> -- 
>> 2.51.0
>> 
>
>-- 
>Matt Roper
>Graphics Software Engineer
>Linux GPU Platform Enablement
>Intel Corporation

Reply via email to