]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/dp: Verify valid pipe BPP range
authorImre Deak <imre.deak@intel.com>
Mon, 9 Feb 2026 13:38:17 +0000 (15:38 +0200)
committerImre Deak <imre.deak@intel.com>
Tue, 10 Feb 2026 09:12:02 +0000 (11:12 +0200)
Ensure that the pipe BPP range is valid after calculating the minimum
and maximum pipe BPP values separately.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260209133817.395823-2-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_dp.c

index 7fd20df10f26f7e2841a844f4488fd52b4524801..48845899298e4e3abc86e2df66a87af9403001f7 100644 (file)
@@ -2745,6 +2745,15 @@ intel_dp_compute_config_limits(struct intel_dp *intel_dp,
                                                                     crtc_state)));
        }
 
+       if (limits->pipe.min_bpp <= 0 ||
+           limits->pipe.min_bpp > limits->pipe.max_bpp) {
+               drm_dbg_kms(display->drm, "[CONNECTOR:%d:%s] Invalid pipe bpp range: %d-%d\n",
+                           connector->base.base.id, connector->base.name,
+                           limits->pipe.min_bpp, limits->pipe.max_bpp);
+
+               return false;
+       }
+
        if (dsc && !intel_dp_dsc_compute_pipe_bpp_limits(connector, limits))
                return false;