Commit 7229474d authored by Imre Deak's avatar Imre Deak
Browse files

drm/i915/dp: Verify valid pipe BPP range



Ensure that the pipe BPP range is valid after calculating the minimum
and maximum pipe BPP values separately.

Reviewed-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260209133817.395823-2-imre.deak@intel.com
parent 08b7ef16
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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;