public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Nemesa Garg <nemesa.garg@intel.com>,
	<intel-gfx@lists.freedesktop.org>,
	<intel-xe@lists.freedesktop.org>,
	<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 2/2] drm/i915/dp: Decode DSC max delta bpp from sink DPCD
Date: Tue, 21 Apr 2026 16:20:46 +0530	[thread overview]
Message-ID: <badcf396-5d48-41f1-b949-36aebcd840fc@intel.com> (raw)
In-Reply-To: <20260420112611.1481530-3-nemesa.garg@intel.com>


On 4/20/2026 4:56 PM, Nemesa Garg 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. The helper decodes RGB/YCbCr444 delta range and
> YCbCr420 delta range from DP_DSC_MAX_BPP_DELTA.


Looking from the spec, i think we need to check this support first, so 
overall to get the maximum compressed bpp supported for an output format:

Step 1: check if format specific range is given, if given use that for 
getting the max compressed bpp based on the output format. (DPCD 0x6E-6F)

Step 2: if above is not present, check for the maximum compressed bpp 
supported by sink and use that. (DPCD 0x67-68)

Step 3: if both of the above are not there, then go with the mandatory 
supported range given in the Table 2-157.


>
> Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_dp.c | 40 +++++++++++++++++++++++++
>   1 file changed, 40 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 35b8fb5740aa..7cc760aedd59 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -2169,6 +2169,41 @@ 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;
> +
> +	if (dsc_dpcd[DP_DSC_MAX_BITS_PER_PIXEL_HI - DP_DSC_SUPPORT] &
> +	    DP_DSC_MAX_BPP_DELTA_AVAILABILITY) {


I think we can return early from here.


> +		int max_bpp_delta = 0;

Perhaps just use max_bpp.


> +
> +		switch (output_format) {
> +		case INTEL_OUTPUT_FORMAT_RGB:
> +		case INTEL_OUTPUT_FORMAT_YCBCR444:
> +			max_bpp_delta = dsc_dpcd[DP_DSC_MAX_BPP_DELTA - DP_DSC_SUPPORT] &

This can be kept in a variable to avoid computing samething again:

u8 max_bpp_delta_v1 = dsc_dpcd[DP_DSC_MAX_BPP_DELTA  - DP_DSC_SUPPORT];


> +				DP_DSC_RGB_YCbCr444_MAX_BPP_DELTA_MASK;
> +			if (max_bpp_delta >= 1 && max_bpp_delta <= 21)
> +				max_bpp_delta =  max_bpp_delta + MIN_DSC_BPP_DELTA_444 - 1;
> +			break;
> +		case INTEL_OUTPUT_FORMAT_YCBCR420:
> +			max_bpp_delta = (dsc_dpcd[DP_DSC_MAX_BPP_DELTA - DP_DSC_SUPPORT] &
> +					DP_DSC_RGB_YCbCr420_MAX_BPP_DELTA_MASK) >>
> +					BPP_DELTA_SHIFT_420;
> +			if (max_bpp_delta >= 1 && max_bpp_delta <= 7)
> +				max_bpp_delta = max_bpp_delta + MIN_DSC_BPP_DELTA_420 - 1;
> +			break;
> +		default:
> +			MISSING_CASE(output_format);
> +			return 0;
> +		}
> +
> +		return max_bpp_delta << 4;
> +	}
> +
> +	return 0;
> +}
> +
>   static
>   u16 intel_dp_dsc_max_sink_compressed_bppx16(const struct intel_connector *connector,
>   					    enum intel_output_format output_format,
> @@ -2176,6 +2211,11 @@ u16 intel_dp_dsc_max_sink_compressed_bppx16(const struct intel_connector *connec
>   {
>   	u16 max_bppx16 = drm_edp_dsc_sink_output_bpp(connector->dp.dsc_dpcd);
>   
> +	if (max_bppx16)
> +		return max_bppx16;
> +
> +	max_bppx16 = intel_dp_dsc_max_delta_bppx16(connector, output_format);


As mentioned, read this first, then fallback to the 
drm_edp_dsc_sink_output_bpp() and at last fall back to the table.

Also need to update the comment below.


Regards,

Ankit

> +
>   	if (max_bppx16)
>   		return max_bppx16;
>   	/*

  reply	other threads:[~2026-04-21 10:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20 11:26 [PATCH 0/2] DSC max delta bpp support Nemesa Garg
2026-04-20 11:26 ` [PATCH 1/2] drm/dp: Define DSC bpp delta DPCD fields Nemesa Garg
2026-04-21  6:34   ` Nautiyal, Ankit K
2026-04-20 11:26 ` [PATCH 2/2] drm/i915/dp: Decode DSC max delta bpp from sink DPCD Nemesa Garg
2026-04-21 10:50   ` Nautiyal, Ankit K [this message]
2026-04-20 22:34 ` ✓ CI.KUnit: success for DSC max delta bpp support Patchwork
2026-04-20 23:21 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-21  2:15 ` ✗ Xe.CI.FULL: failure " Patchwork

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=badcf396-5d48-41f1-b949-36aebcd840fc@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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