From: sashiko-bot@kernel.org
To: "Ankit Nautiyal" <ankit.k.nautiyal@intel.com>,
intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v5 10/15] drm/i915/dp: Compute the PCON DSC encoder parameters
Date: Fri, 04 Dec 2026 09:52:56 +0000 [thread overview]
Message-ID: <sashiko-outbox-249546@kernel.org> (raw)
In-Reply-To: <20261204085746.391918-11-ankit.k.nautiyal@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/i915/dp: missing PCON and sink DSC capability checks in
compute
--
commit 436e850e3ddf87d0b01bc7a145ea30594fd044f0
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
drm/i915/dp: Compute the PCON DSC encoder parameters
This commit moves computation of the PCON DSC encoder slice height, slice
width, and compressed bpp from enable time to compute config, storing the
parameters in the crtc state for intel_dp_pcon_dsc_configure() to program.
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index ca218481182fd..272837cc6efa4 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1232,6 +1232,69 @@ intel_dp_pcon_sink_support_frl(struct intel_dp *intel_dp)
> intel_dp_hdmi_sink_max_frl(intel_dp);
> }
>
> +static bool intel_dp_pcon_can_encode_dsc(struct intel_dp *intel_dp)
> +{
> + struct intel_connector *connector = intel_dp->attached_connector;
> +
> + return intel_dp_is_hdmi_2_1_sink(intel_dp) &&
> + connector->base.display_info.hdmi.dsc_cap.v_1p2 &&
> + drm_dp_pcon_enc_is_dsc_1_2(intel_dp->pcon_dsc_dpcd);
> +}
> +
> +/*
> + * Compute the PCON DSC encoder parameters for the stream sent to the HDMI
> + * sink, which is in @sink_format. @enc can be NULL to only check feasibility.
> + */
> +static bool
> +intel_dp_pcon_dsc_enc_compute(struct intel_dp *intel_dp,
> + const struct drm_display_mode *mode, int pixel_clock,
> + int bpc, enum intel_output_format sink_format,
> + struct intel_pcon_dsc_enc_config *enc)
> +{
> + struct intel_connector *connector = intel_dp->attached_connector;
> + const struct drm_display_info *info = &connector->base.display_info;
> + int pcon_max_slices = drm_dp_pcon_dsc_max_slices(intel_dp->pcon_dsc_dpcd);
> + int pcon_max_slice_width = drm_dp_pcon_dsc_max_slice_width(intel_dp->pcon_dsc_dpcd);
> + int slice_height, num_slices, slice_width, max_link_dsc_bpp, bpp_x16;
> +
> + if (!intel_dp_pcon_can_encode_dsc(intel_dp))
> + return false;
> +
> + slice_height = intel_hdmi_dsc_get_slice_height(mode->vdisplay);
> + if (!slice_height)
> + return false;
> +
> + num_slices = intel_hdmi_dsc_get_num_slices(mode, pixel_clock, sink_format,
> + pcon_max_slices, pcon_max_slice_width,
> + info->hdmi.dsc_cap.max_slices,
> + info->hdmi.dsc_cap.clk_per_slice);
> + if (!num_slices)
> + return false;
> +
> + slice_width = DIV_ROUND_UP(mode->hdisplay, num_slices);
> +
> + /* The compressed stream has to fit the FRL link */
> + max_link_dsc_bpp = intel_dp_hdmi_frl_payload_bw(intel_dp) / pixel_clock;
> + if (!max_link_dsc_bpp)
> + return false;
> +
> + bpp_x16 = intel_hdmi_dsc_get_bpp(drm_dp_pcon_dsc_bpp_incr(intel_dp->pcon_dsc_dpcd),
> + slice_width, num_slices, sink_format, bpc,
> + info->hdmi.dsc_cap.all_bpp,
> + info->hdmi.dsc_cap.total_chunk_kbytes * 1024,
> + max_link_dsc_bpp);
> + if (!bpp_x16)
> + return false;
> +
> + if (enc) {
> + enc->slice_height = slice_height;
> + enc->slice_width = slice_width;
> + enc->bpp_x16 = bpp_x16;
> + }
> +
> + return true;
> +}
[Severity: Medium]
Should intel_dp_pcon_can_encode_dsc() and intel_dp_pcon_dsc_enc_compute()
validate the PCON and HDMI sink DSC capabilities before accepting a mode?
intel_dp_pcon_can_encode_dsc() checks only the DSC 1.2 version flags and
skips DP_PCON_DSC_ENCODER_SUPPORTED and DP_PCON_DSC_PPS_ENC_OVERRIDE in
DP_PCON_DSC_ENCODER, even though intel_dp_pcon_dsc_configure()
unconditionally writes PPS override parameters.
intel_dp_pcon_dsc_enc_compute() also skips validating sink_format against
info->hdmi.dsc_cap.native_420 (for INTEL_OUTPUT_FORMAT_YCBCR420) and
DP_PCON_DSC_ENC_COLOR_FMT_CAP.
Similarly, bpc is not checked against info->hdmi.dsc_cap.bpc_supported
(which drm_parse_dsc_info() defaults to 8 bpc independently of
uncompressed deep-color support) or DP_PCON_DSC_ENC_COLOR_DEPTH_CAP.
On a PCON or HDMI 2.1 sink whose DSC capabilities are narrower than its
uncompressed ones (for example, 10 bpc uncompressed but only 8 bpc with
DSC), intel_dp_pcon_compute_config() will accept the mode and program
unsupported parameters, causing blank or corrupted display output.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204085746.391918-1-ankit.k.nautiyal@intel.com?part=10
next prev parent reply other threads:[~2026-12-04 9:53 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
2026-12-04 8:57 ` [PATCH v5 01/15] drm/i915/dp: Forget the PCON FRL training state on a long HPD Ankit Nautiyal
2026-12-04 9:45 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 02/15] drm/i915/dp: Account for FRL 16b/18b encoding overhead Ankit Nautiyal
2026-12-04 9:36 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 03/15] drm/i915/hdmi: Clamp the target_bpp only when it equals the link bpp Ankit Nautiyal
2026-12-04 8:57 ` [PATCH v5 04/15] drm/i915/dp: Add PCON DSC state to crtc_state Ankit Nautiyal
2026-12-04 9:43 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 05/15] drm/dp: Add a helper to disable the PCON DSC encoder Ankit Nautiyal
2026-12-04 8:57 ` [PATCH v5 06/15] drm/i915/dp: Compute the PCON DSC operation Ankit Nautiyal
2026-12-04 9:38 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 07/15] drm/i915/dp: Disable the PCON DSC encoder unless it is needed Ankit Nautiyal
2026-12-04 9:38 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 08/15] drm/i915/dp: Clamp PCON DSC bpp to the FRL link bandwidth Ankit Nautiyal
2026-12-04 9:33 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 09/15] drm/i915/dp: Add a helper for the FRL payload bandwidth Ankit Nautiyal
2026-12-04 8:57 ` [PATCH v5 10/15] drm/i915/dp: Compute the PCON DSC encoder parameters Ankit Nautiyal
2026-12-04 9:52 ` sashiko-bot [this message]
2026-12-04 8:57 ` [PATCH v5 11/15] drm/i915/dp: Retrain the PCON FRL link from the link check work Ankit Nautiyal
2026-12-04 9:52 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 12/15] drm/i915/dp: Store the PCON FRL rate in the crtc state Ankit Nautiyal
2026-12-04 8:57 ` [PATCH v5 13/15] drm/i915/dp: Use the FRL rate of the stream on the HDMI link Ankit Nautiyal
2026-12-04 8:57 ` [PATCH v5 14/15] drm/i915/dp: Pick the bpc for a PCON DSC stream Ankit Nautiyal
2026-12-04 8:57 ` [PATCH v5 15/15] drm/i915/dp: Allow PCON DSC modes through the FRL bw check Ankit Nautiyal
2026-12-04 9:53 ` sashiko-bot
2026-12-04 9:31 ` ✓ CI.KUnit: success for DP-HDMI PCON DSC fixes (rev5) 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=sashiko-outbox-249546@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ankit.k.nautiyal@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/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