On 5/15/2026 4:00 PM, Jani Nikula wrote:
On Fri, 15 May 2026, Ankit Nautiyal <[email protected]> wrote:
The SCL condition checks can be combined into one expression.
needs_sel_update is common for both display version branches, so check it
once and keep the version specific checks together.

Signed-off-by: Ankit Nautiyal <[email protected]>
---
  drivers/gpu/drm/i915/display/intel_psr.c | 13 +++++--------
  1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c 
b/drivers/gpu/drm/i915/display/intel_psr.c
index 8f70b7dcd881..5bf1d782188c 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -1477,15 +1477,12 @@ int _intel_psr_min_set_context_latency(const struct 
intel_crtc_state *crtc_state
         * SRD_STATUS is used by PSR1 and Panel Replay DP on LunarLake.
         */
- if (DISPLAY_VER(display) >= 30 && (needs_panel_replay ||
-                                          needs_sel_update))
+       if (needs_sel_update ||
+           (DISPLAY_VER(display) >= 30 && needs_panel_replay) ||
+           (DISPLAY_VER(display) < 30 && intel_crtc_has_type(crtc_state, 
INTEL_OUTPUT_EDP)))
                return 0;
-       else if (DISPLAY_VER(display) < 30 && (needs_sel_update ||
-                                              intel_crtc_has_type(crtc_state,
-                                                                  
INTEL_OUTPUT_EDP)))
-               return 0;
-       else
-               return 1;
The function has a bunch of simple "if foo return bar" statements.

Please don't combine more stuff together, but rather split them up.

        if (needs_sel_update)
                return 0;

        if (DISPLAY_VER(display) < 30 && intel_crtc_has_type(crtc_state, 
INTEL_OUTPUT_EDP))
                return 0;

        if (DISPLAY_VER(display) >= 30 && needs_panel_reply)
                return 0;

Please consider which one is easier and faster to read and understand.

Yes, you're absolutely right.

This approach is clearer, aligns better with the rest of the function, and improves maintainability.

I'll make the suggested changes and send a new revision.

Regards,
Ankit

BR,
Jani.


+
+       return 1;
  }
static bool _wake_lines_fit_into_vblank(const struct intel_crtc_state *crtc_state,

Reply via email to