]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/i915/psr: Panel Replay SU cap dpcd read return value
authorJouni Högander <jouni.hogander@intel.com>
Wed, 27 Aug 2025 06:08:09 +0000 (09:08 +0300)
committerJouni Högander <jouni.hogander@intel.com>
Mon, 8 Sep 2025 07:25:32 +0000 (10:25 +0300)
Currently return value of drm_dpcd_readb is not checked when reading sink
Panel Replay Selective Update capabilities.

Fix this and switch to drm_dpcd_read_byte.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Link: https://lore.kernel.org/r/20250827060809.2461725-1-jouni.hogander@intel.com
drivers/gpu/drm/i915/display/intel_psr.c

index 1aa4a127afaf08f877f748fafd063ddd845e9990..01bf304c705fec437485c34c12c85e43189659d4 100644 (file)
@@ -495,12 +495,14 @@ static u8 intel_dp_get_su_capability(struct intel_dp *intel_dp)
 {
        u8 su_capability = 0;
 
-       if (intel_dp->psr.sink_panel_replay_su_support)
-               drm_dp_dpcd_readb(&intel_dp->aux,
-                                 DP_PANEL_REPLAY_CAP_CAPABILITY,
-                                 &su_capability);
-       else
+       if (intel_dp->psr.sink_panel_replay_su_support) {
+               if (drm_dp_dpcd_read_byte(&intel_dp->aux,
+                                         DP_PANEL_REPLAY_CAP_CAPABILITY,
+                                         &su_capability) < 0)
+                       return 0;
+       } else {
                su_capability = intel_dp->psr_dpcd[1];
+       }
 
        return su_capability;
 }