Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ankit Nautiyal" <ankit.k.nautiyal@intel.com>
Cc: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v6 12/13] drm/i915/dp: Adjust SDP guardband requirement for CMN_SDP_TL
Date: Sun, 13 Sep 2026 15:25:39 +0000	[thread overview]
Message-ID: <20260913152540.04AF51F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260913145649.3240904-13-ankit.k.nautiyal@intel.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [Medium] intel_dp_get_lines_for_cmn_sdp_tl() fails to handle DP_SDP_VSC, returning 0 instead of the documented 3 setup lines.

Pre-existing issues:
- [High] intel_dp_sdp_min_guardband() fails to query guardband requirements for DP_SDP_VSC and DP_SDP_VSC_EXT_VESA/CEA.
--

commit 9c43291671903e078a3be3eca84c33bbdb51d4ac
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

    drm/i915/dp: Adjust SDP guardband requirement for CMN_SDP_TL

This commit adjusts the SDP guardband requirements when CMN_SDP_TL is enabled.
It introduces intel_dp_get_lines_for_cmn_sdp_tl() to anchor SDPs like GMP, PPS,
VSC, and VSC_EXT relative to CMN_SDP_TL instead of the old per-packet sizing.

> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 8c3a324e164ec..02e73ae9e34a0 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
[ ... ]
> @@ -7348,9 +7349,55 @@ int intel_dp_compute_config_late(struct intel_encoder *encoder,
>  	return 0;
>  }
>  
> +static
> +int intel_dp_get_lines_for_cmn_sdp_tl(u32 type)
> +{
> +	u32 stagger_val;
> +
> +	/*
> +	 * Since we are using default stagger values similar to the case
> +	 * where CMN SDP TL is not set, the different SDP transmission
> +	 * lines are:
> +	 * base : 2nd line of delayed vblank:
> +	 * GMP : 2 + GMP_STAGGER
> +	 * VSC_EXT: 2 + VSC_EXT_STAGGER
> +	 * VSC : 2
> +	 * PPS : 2 + PPS_STAGGER
> +	 *
> +	 * SDP Setup = 1 + MAX(GMP, VSC_EXT, VSC, PPS setup lines)
> +	 *
> +	 * For EMP_AS_SDP_TL guardband should be more than vrr.vsync_start.
> +	 */
> +
> +	switch (type) {
> +	case DP_SDP_VSC_EXT_VESA:
> +	case DP_SDP_VSC_EXT_CEA:
> +		stagger_val = VSC_EXT_STAGGER_DEFAULT;
> +		break;
> +	case HDMI_PACKET_TYPE_GAMUT_METADATA:
> +		stagger_val = GMP_STAGGER_DEFAULT;
> +		break;
> +	case DP_SDP_PPS:
> +		stagger_val = PPS_STAGGER_DEFAULT;
> +		break;
> +	default:
> +		return 0;
> +	}

[Severity: Medium]
Does this switch statement intentionally omit a case for DP_SDP_VSC?

The comment block above explicitly lists VSC as requiring 2 lines, but
because it is missing from the switch cases, this function falls through to
the default case and returns 0. Returning 0 instead of the documented 3
setup lines (1 + 2 + 0 stagger) for the DP_SDP_VSC guardband requirement
leads to an incorrectly calculated guardband when VSC SDPs are evaluated,
which could potentially cause missing SDPs or display corruption.

> +
> +	return 1 + 2 + stagger_val;
> +}
> +
>  static
>  int intel_dp_get_lines_for_sdp(const struct intel_crtc_state *crtc_state, u32 type)
>  {
> +	struct intel_display *display = to_intel_display(crtc_state);
> +
> +	if (type == DP_SDP_ADAPTIVE_SYNC)
> +		return crtc_state->vrr.vsync_start + 1;
> +
> +	if (HAS_COMMON_SDP_TL(display))
> +		return intel_dp_get_lines_for_cmn_sdp_tl(type);
> +
>  	switch (type) {
>  	case DP_SDP_VSC_EXT_VESA:
>  	case DP_SDP_VSC_EXT_CEA:
> @@ -7359,8 +7406,6 @@ int intel_dp_get_lines_for_sdp(const struct intel_crtc_state *crtc_state, u32 ty
>  		return 8;
>  	case DP_SDP_PPS:
>  		return 7;

[Severity: High]
This is a pre-existing issue, but I noticed that intel_dp_sdp_min_guardband()
never actually queries DP_SDP_VSC or DP_SDP_VSC_EXT_VESA/CEA.

While this patch explicitly adds logic to handle VSC_EXT and VSC sizes (both
in the new CMN mode and legacy paths), intel_dp_sdp_min_guardband() only
queries GMP, PPS, and AS SDPs when calculating the maximum guardband:

drivers/gpu/drm/i915/display/intel_dp.c:intel_dp_sdp_min_guardband() {
	...
	if (assume_all_enabled ||
	    crtc_state->infoframes.enable &
	    intel_hdmi_infoframe_enable(HDMI_PACKET_TYPE_GAMUT_METADATA))
		sdp_guardband = max(sdp_guardband,
				    intel_dp_get_lines_for_sdp(crtc_state,
							       HDMI_PACKET_TYPE_GAMUT_METADATA));

	if (assume_all_enabled ||
	    crtc_state->dsc.compression_enable)
		sdp_guardband = max(sdp_guardband,
				    intel_dp_get_lines_for_sdp(crtc_state, DP_SDP_PPS));
	...
}

Does this leave the VSC_EXT switch cases in intel_dp_get_lines_for_sdp() and
intel_dp_get_lines_for_cmn_sdp_tl() as dead code? Since the guardband
calculation completely ignores the setup line requirements for VSC and
VSC_EXT packets, could programming a guardband smaller than the required
SDP transmission time lead to hardware failures or corrupted VBLANK timing?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260913145649.3240904-1-ankit.k.nautiyal@intel.com?part=12

  reply	other threads:[~2026-09-13 15:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-13 14:56 [PATCH v6 00/13] Add support for Common SDP Transmission Line Ankit Nautiyal
2026-09-13 14:56 ` [PATCH v6 01/13] drm/i915/dip: Add new file to handle Data Island Packet hardware Ankit Nautiyal
2026-09-13 14:56 ` [PATCH v6 02/13] drm/i915/vrr: Use the helper to write EMP_AS_SDP_TL register Ankit Nautiyal
2026-09-13 14:56 ` [PATCH v6 03/13] drm/i915/intel_dip: Add check for DP encoder Ankit Nautiyal
2026-09-13 14:56 ` [PATCH v6 04/13] drm/i915/dip: Add helper to get AS SDP Transmission Line Ankit Nautiyal
2026-09-13 14:56 ` [PATCH v6 05/13] drm/i915/display: Add crtc state for DIP transmission lines Ankit Nautiyal
2026-09-13 14:56 ` [PATCH v6 06/13] drm/i915/dip: Store and use AS SDP transmission line from crtc state Ankit Nautiyal
2026-09-13 15:30   ` sashiko-bot
2026-09-13 14:56 ` [PATCH v6 07/13] drm/i915/dip_regs: Add register definitions for common SDP Transmission Line Ankit Nautiyal
2026-09-13 14:56 ` [PATCH v6 08/13] drm/i915/dip: Add HAS_COMMON_SDP_TL macro Ankit Nautiyal
2026-09-13 14:56 ` [PATCH v6 09/13] drm/i915/dip: Store SDP transmission lines in crtc_state Ankit Nautiyal
2026-09-13 14:56 ` [PATCH v6 10/13] drm/i915/dp: Introduce helpers to enable/disable CMN SDP Transmission line Ankit Nautiyal
2026-09-13 14:56 ` [PATCH v6 11/13] drm/i915/dip: Enable Common " Ankit Nautiyal
2026-09-13 15:33   ` sashiko-bot
2026-09-13 14:56 ` [PATCH v6 12/13] drm/i915/dp: Adjust SDP guardband requirement for CMN_SDP_TL Ankit Nautiyal
2026-09-13 15:25   ` sashiko-bot [this message]
2026-09-13 14:56 ` [PATCH v6 13/13] drm/i915/display: Dump DIP Transmission lines Ankit Nautiyal
2026-09-13 16:12 ` ✗ i915.CI.BAT: failure for Add support for Common SDP Transmission Line (rev6) 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=20260913152540.04AF51F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ankit.k.nautiyal@intel.com \
    --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