intel_alpm_lobf_compute_config_late() selected the main-link wake time
with the two cases inverted: when aux-less wake was supported it used the
aux-wake io_wake_lines, and otherwise the aux_less_wake_lines. This is the
opposite of the mapping used in intel_psr_compute_config_late() and of the
underlying meaning of the two values.

As a result the LOBF enable decision (scl + guardband > first_sdp_position
+ waketime_in_lines) was computed against the wrong wake time, so LOBF
could be enabled or rejected incorrectly.

Use aux_less_wake_lines when aux-less wake is supported and io_wake_lines
otherwise, matching the PSR path.

Cc: Jouni Högander <[email protected]>
Cc: Ankit Nautiyal <[email protected]
Cc: [email protected]
Fixes: 9090fa44a6d45 ("drm/i915/alpm: Compute LOBF late after guardband is 
already determined")
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Animesh Manna <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_alpm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c 
b/drivers/gpu/drm/i915/display/intel_alpm.c
index f1383764b702..559fe6d14c01 100644
--- a/drivers/gpu/drm/i915/display/intel_alpm.c
+++ b/drivers/gpu/drm/i915/display/intel_alpm.c
@@ -314,9 +314,9 @@ void intel_alpm_lobf_compute_config_late(struct intel_dp 
*intel_dp,
         */
        first_sdp_position = adjusted_mode->crtc_vtotal - 
adjusted_mode->crtc_vsync_start;
        if (intel_alpm_aux_less_wake_supported(intel_dp))
-               waketime_in_lines = crtc_state->alpm_state.io_wake_lines;
-       else
                waketime_in_lines = crtc_state->alpm_state.aux_less_wake_lines;
+       else
+               waketime_in_lines = crtc_state->alpm_state.io_wake_lines;
 
        crtc_state->has_lobf = (crtc_state->set_context_latency + 
crtc_state->vrr.guardband) >
                               (first_sdp_position + waketime_in_lines);
-- 
2.29.0

Reply via email to