]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/i915/dp: Clamp the connector max_bpc request to the valid pipe bpp range
authorImre Deak <imre.deak@intel.com>
Wed, 11 Feb 2026 11:58:11 +0000 (13:58 +0200)
committerImre Deak <imre.deak@intel.com>
Thu, 12 Feb 2026 16:02:55 +0000 (18:02 +0200)
commit59dbcb6fc389850c23066373e1e88ffdf8abb896
treefc605f456f71b21581ab9982bad773fc6a8604f8
parent9f77d4c363f7f487f53da63f040a3d81f27f5c7e
drm/i915/dp: Clamp the connector max_bpc request to the valid pipe bpp range

The user's request for a maximum BPC - via the max-bpc connector
property - determines the pipe BPP selected by the encoder, which is in
turn used either as the uncompressed output BPP or as the input BPP for
the DSC engine. This user-requested BPC->BPP can be outside of the
source/sink's supported valid min/max pipe BPP range and atm such an
out-of-bound request will be rejected by the encoder's state
computation.

As opposed to the above, the semantics for the max-bpc connector
property - which the user may reasonably expect - should not be to
fail the modeset in case of an out-of-bound max BPC request, but rather
to adjust the request, clamping it to the valid BPP range.

Based on the above, calculate the baseline (i.e. the non-DP specific
platform/EDID) _maximum_ pipe BPP, storing it in
intel_crtc_state::max_pipe_bpp, separately from the baseline _target_
pipe BPP (which is the lower BPP of the baseline maximum and requested
maximum BPP, stored in intel_crtc_state::pipe_bpp). This allows the
encoder state computation to use the baseline maximum pipe BPP as a hard
limit for the selected pipe BPP, while also letting it use the baseline
target pipe BPP only as a preference, clamping this target BPP to the
valid DP pipe BPP range.

v2:
- Fix typos in the commit message. (Michał)
- Clarify code comment's reference to the baseline max BPP value.
  (Ankit)

Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260211115811.508496-2-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_display_types.h
drivers/gpu/drm/i915/display/intel_dp.c