Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Nemesa Garg <nemesa.garg@intel.com>,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: Nemesa Garg <nemesa.garg@intel.com>,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Subject: Re: [PATCH 4/4] drm/i915/dp: Decode dsc max delta bpp from sink dpcd
Date: Tue, 23 Jun 2026 12:13:52 +0300	[thread overview]
Message-ID: <111b5aa834e7e94cd9bd487f5583594b21afb803@intel.com> (raw)
In-Reply-To: <20260619113905.1413453-5-nemesa.garg@intel.com>

On Fri, 19 Jun 2026, Nemesa Garg <nemesa.garg@intel.com> wrote:
> Add intel_dp_dsc_max_delta_bppx16() to parse sink dsc max
> delta bpp from dpcd when DP_DSC_MAX_BPP_DELTA_AVAILABILITY
> is set. This helper decodes the delta range for both RGB/YCbCr444
> and YCbCr420 formats from DP_DSC_MAX_BPP_DELTA.
>
> With this addition, the flow becomes:
> 1. First, check for a format-specific range and use it to calculate
> max compressed bpp.
> 2. If not, check for sink supported max compressed bpp and
> use that
> 3. If this is also not there go with mandatory
> max range supported bpp.
>
> v2: Reorder the check flow for max_bpp. [Ankit]
> v3: Put RGB and YCbCr444 mask assignment in the same line. [Ankit]
> v4: Zero max_bpp for reserved RGB/YCbCr444 delta values. [sashiko]
>
> Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
> Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

Acked-by: Jani Nikula <jani.nikula@intel.com>

for merging via drm-misc-next

> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 43 +++++++++++++++++++++++--
>  1 file changed, 41 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 3569e61e7fee..28b887ee5cf1 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -2184,17 +2184,56 @@ static int dsc_compute_link_config(struct intel_dp *intel_dp,
>  	return -EINVAL;
>  }
>  
> +static u16 intel_dp_dsc_max_delta_bppx16(const struct intel_connector *connector,
> +					 enum intel_output_format output_format)
> +{
> +	const u8 *dsc_dpcd = connector->dp.dsc_dpcd;
> +	u8 max_bpp_delta_v1 = dsc_dpcd[DP_DSC_MAX_BPP_DELTA_VERSION_1 - DP_DSC_SUPPORT];
> +	int max_bpp;
> +
> +	if (!(dsc_dpcd[DP_DSC_MAX_BITS_PER_PIXEL_HI - DP_DSC_SUPPORT] &
> +	    DP_DSC_MAX_BPP_DELTA_AVAILABILITY))
> +		return 0;
> +
> +	switch (output_format) {
> +	case INTEL_OUTPUT_FORMAT_RGB:
> +	case INTEL_OUTPUT_FORMAT_YCBCR444:
> +		max_bpp =  max_bpp_delta_v1 & DP_DSC_RGB_YCbCr444_MAX_BPP_DELTA_MASK;
> +		if (max_bpp >= 1 && max_bpp <= 21)
> +			max_bpp =  max_bpp + DP_DSC_BPP_DELTA_444 - 1;
> +		else
> +			max_bpp = 0;
> +		break;
> +	case INTEL_OUTPUT_FORMAT_YCBCR420:
> +		max_bpp = (max_bpp_delta_v1 & DP_DSC_NATIVE_YCbCr420_MAX_BPP_DELTA_MASK) >>
> +			  DP_DSC_BPP_DELTA_SHIFT_420;
> +		if (max_bpp >= 1 && max_bpp <= 7)
> +			max_bpp = max_bpp + DP_DSC_BPP_DELTA_420 - 1;
> +		break;
> +	default:
> +		MISSING_CASE(output_format);
> +		return 0;
> +	}
> +
> +	return max_bpp << 4;
> +}
> +
>  static
>  u16 intel_dp_dsc_max_sink_compressed_bppx16(const struct intel_connector *connector,
>  					    enum intel_output_format output_format,
>  					    int bpc)
>  {
> -	u16 max_bppx16 = drm_edp_dsc_sink_output_bpp(connector->dp.dsc_dpcd);
> +	u16 max_bppx16 = intel_dp_dsc_max_delta_bppx16(connector, output_format);
> +
> +	if (max_bppx16)
> +		return max_bppx16;
> +
> +	max_bppx16 = drm_edp_dsc_sink_output_bpp(connector->dp.dsc_dpcd);
>  
>  	if (max_bppx16)
>  		return max_bppx16;
>  	/*
> -	 * If support not given in DPCD 67h, 68h use the Maximum Allowed bit rate
> +	 * If support not given in DPCD 67h, 68h, 6Eh, 6Fh use the Maximum Allowed bit rate
>  	 * values as given in spec Table 2-157 DP v2.0
>  	 */
>  	switch (output_format) {

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-06-23  9:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19 11:39 [PATCH 0/4] DSC max delta bpp support Nemesa Garg
2026-06-19 11:39 ` [PATCH 1/4] drm/dp: Add DP_DSC_MAX_BPP_DELTA register Nemesa Garg
2026-06-19 11:39 ` [PATCH 2/4] drm/dp: Rename YCbCr420 bpp delta mask to native Nemesa Garg
2026-06-19 11:39 ` [PATCH 3/4] drm/dp: Add max bpp delta computation constants Nemesa Garg
2026-06-19 11:39 ` [PATCH 4/4] drm/i915/dp: Decode dsc max delta bpp from sink dpcd Nemesa Garg
2026-06-23  9:13   ` Jani Nikula [this message]
2026-06-19 12:17 ` ✓ CI.KUnit: success for DSC max delta bpp support (rev4) Patchwork
2026-06-19 13:20 ` ✓ Xe.CI.BAT: " Patchwork
2026-06-19 15:16 ` ✓ Xe.CI.FULL: " Patchwork
2026-06-23  5:00 ` [PATCH 0/4] DSC max delta bpp support Garg, Nemesa
2026-06-23  9:14   ` Jani Nikula
2026-06-23  9:27     ` Garg, Nemesa
  -- strict thread matches above, loose matches on Subject: below --
2026-05-27 11:08 Nemesa Garg
2026-05-27 11:08 ` [PATCH 4/4] drm/i915/dp: Decode dsc max delta bpp from sink dpcd Nemesa Garg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=111b5aa834e7e94cd9bd487f5583594b21afb803@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=nemesa.garg@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox