[PATCH] drm/i915/display: Fix RGB limited range handling for DP

Jani Nikula jani.nikula at linux.intel.com
Wed Jul 2 08:42:59 UTC 2025


On Tue, 01 Jul 2025, Uma Shankar <uma.shankar at intel.com> wrote:
> RGB limited range should be selected only if explicitly asked by
> userspace by the broadcast RGB property with LIMITED_RANGE. This
> is mostly enabled in case of CEA modes.
>
> Display port by default uses Full Range, fixed the same. This will help
> set correct MSA information for colorimetry. Fixes a CTS issue wrt
> colorimetry.

If we decide to go this way, the commit message *must* capture the
history precisely, and not pretend this is the only way and everything
that was before was wrong. And that we're primarily doing it to pass
CTS.

> Signed-off-by: Uma Shankar <uma.shankar at intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index f48912f308df..8758b9d60d5e 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -2708,8 +2708,6 @@ bool intel_dp_limited_color_range(const struct intel_crtc_state *crtc_state,
>  {
>  	const struct intel_digital_connector_state *intel_conn_state =
>  		to_intel_digital_connector_state(conn_state);
> -	const struct drm_display_mode *adjusted_mode =
> -		&crtc_state->hw.adjusted_mode;
>  
>  	/*
>  	 * Our YCbCr output is always limited range.
> @@ -2721,18 +2719,13 @@ bool intel_dp_limited_color_range(const struct intel_crtc_state *crtc_state,
>  	if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB)
>  		return false;
>  
> -	if (intel_conn_state->broadcast_rgb == INTEL_BROADCAST_RGB_AUTO) {
> -		/*
> -		 * See:
> -		 * CEA-861-E - 5.1 Default Encoding Parameters
> -		 * VESA DisplayPort Ver.1.2a - 5.1.1.1 Video Colorimetry
> -		 */
> -		return crtc_state->pipe_bpp != 18 &&
> -			drm_default_rgb_quant_range(adjusted_mode) ==
> -			HDMI_QUANTIZATION_RANGE_LIMITED;
> -	} else {
> -		return intel_conn_state->broadcast_rgb ==
> -			INTEL_BROADCAST_RGB_LIMITED;
> +	switch (intel_conn_state->broadcast_rgb) {
> +	case INTEL_BROADCAST_RGB_LIMITED:
> +		return true;
> +	case INTEL_BROADCAST_RGB_FULL:
> +	case INTEL_BROADCAST_RGB_AUTO:
> +	default:
> +		return false;
>  	}

That's just:

	return intel_conn_state->broadcast_rgb == INTEL_BROADCAST_RGB_LIMITED;


>  }

-- 
Jani Nikula, Intel


More information about the Intel-gfx mailing list