Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	<intel-xe@lists.freedesktop.org>,
	<intel-gfx@lists.freedesktop.org>
Cc: stable@vger.kernel.org, "Suraj Kandpal" <suraj.kandpal@intel.com>,
	"Xiao Lu" <xiaolu.xie@intel.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Subject: Re: [PATCH v2] drm/i915/dip: Write the DIP header last
Date: Wed, 18 Nov 2026 14:12:35 +0530	[thread overview]
Message-ID: <55f8ef22-9581-416e-a446-59660390818e@intel.com> (raw)
In-Reply-To: <20261113074849.30768-1-chaitanya.kumar.borah@intel.com>


On 11/13/2026 1:18 PM, Chaitanya Kumar Borah wrote:
> On platforms with SDP transmission line registers, the packets anchored
> to them are double buffered in the transcoder (TC) clock domain. The packet
> registers are in the core display (CD) clock domain and the whole packet is
> clock crossed on the write of the header (dword 0), so Bspec requires the
> data to be programmed first and the header last.
>
> hsw_write_infoframe() writes the header first, so the packet is crossed
> before its payload is in place and the previous payload keeps being sent.
> This hits the AS SDP, and the VSC SDP whenever an AS SDP is enabled, which
> is whenever VRR is possible since commit 6a1712052859 ("drm/i915/dp: Enable
> AS SDP whenever VRR is possible or PR !async"). With CMN_SDP_TL, enabled by
> commit bfa597238073 ("drm/i915/dip: Enable Common SDP Transmission line"),
> it also hits the GMP and VSC SDPs: on NVL, entering HDR on an eDP panel
> leaves the image discoloured and scaled until the headers are rewritten.
>
> Write the payload, including the ECC zero fill, first and the header last
> for all packets. Packets double buffered in the CD domain have no ordering
> requirement and Bspec recommends using the same order for all packets, so
> use it on all platforms.
>
> v2: Always write the header last, without the platform check. (Ville)
>
> Bspec: 75640, 71197, 74384
> Fixes: e1123e617e51 ("drm/i915/vrr: Program EMP_AS_SDP_TL for DP AS SDP")
> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/17732
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/9746
> Cc: <stable@vger.kernel.org> # v6.17+
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Cc: Suraj Kandpal <suraj.kandpal@intel.com>
> Cc: Xiao Lu <xiaolu.xie@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>


LGTM.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

Thanks Chaitanya and Xiao Lu for finding this out.


As per the discussion in the V1 version 
(https://patchwork.freedesktop.org/patch/768289/) :

Xiao Lu, the VSC_SELECT clearing is a good catch on its own. It can go 
as a separate patch on top of this one.

It may not be needed for the gitlab issue, but seems like a correct 
cleanup to me.

Regards,

Ankit

> ---
>
> Notes:
>      The same ordering change was posted earlier by Xiao Lu
>      (https://patchwork.freedesktop.org/patch/763779/), for xe issue 9693[1].
>      
>      Fixes tag rationale
>      
>      The Fixes tag points at commit e1123e617e51 ("drm/i915/vrr: Program
>      EMP_AS_SDP_TL for DP AS SDP"). The AS SDP has been written header first
>      since it was added by commit 8845021b7331 ("drm/i915/display: Read/Write
>      Adaptive Sync SDP"), but EMP_AS_SDP_TL, which holds the double buffer
>      point and the transmission line of the AS SDP on BMG and LNL+, was only
>      programmed from that commit on. From then on the driver relies on that
>      register to anchor the AS SDP, and the VSC SDP whenever an AS SDP is
>      enabled, and the programming note of the register asks for the packet
>      data first and the header last. The two later commits cited in the commit
>      message only widened the exposure: the first enabled the AS SDP whenever
>      VRR is possible and the second added CMN_SDP_TL for the GMP and VSC SDPs.
>      
>      Alternatives considered:
>       - 6a1712052859 (v7.2): AS SDP on whenever VRR is possible. A PTL report
>         [2] is fixed by reverting it. Narrower than the spec argument, as it
>         only covers v7.2 and later.
>       - bfa597238073 (7.4): CMN_SDP_TL. The NVL regression, verified on
>         hardware, but covered by the older tag as every kernel with it also
>         has e1123e617e51.
>       - 8845021b7331 (v6.10): first header first AS SDP write, but
>         EMP_AS_SDP_TL was not programmed until e1123e617e51, so exposure
>         before it could not be shown.
>      
>      Not verified:
>       - The failure was observed locally on NVL with CMN_SDP_TL (rewriting the
>         GMP and VSC headers makes the panel recover). The AS SDP and the VSC
>         SDP with an AS SDP on BMG, LNL and PTL follow from the Bspec
>         requirement and were not reproduced here.
>       - No reproduction on kernels older than v7.2.
>       - The HDR test on NVL was done with v1, which only differs by the
>         platform check; NVL takes the same path in both versions.
>      
>      [1] https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/9693
>      [2] https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/9746
>
>   drivers/gpu/drm/i915/display/intel_hdmi.c | 17 +++++++++++++----
>   1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index 4ec0db8d93fb..66149aff7993 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -535,18 +535,27 @@ void hsw_write_infoframe(struct intel_encoder *encoder,
>   	val &= ~hsw_infoframe_enable(type);
>   	intel_de_write(display, ctl_reg, val);
>   
> -	for (i = 0; i < len; i += 4) {
> +	/* Program the payload first, the header (dword 0) is written last. */
> +	for (i = 4; i < len; i += 4)
>   		intel_de_write(display,
>   			       hsw_dip_data_reg(display, cpu_transcoder, type, i >> 2),
> -			       *data);
> -		data++;
> -	}
> +			       data[i >> 2]);
>   	/* Write every possible data byte to force correct ECC calculation. */
>   	for (; i < data_size; i += 4)
>   		intel_de_write(display,
>   			       hsw_dip_data_reg(display, cpu_transcoder, type, i >> 2),
>   			       0);
>   
> +	/*
> +	 * Packets double buffered in the transcoder clock domain are clock
> +	 * crossed on the write of the header, so it has to come after the
> +	 * payload. Packets double buffered in the core display clock domain
> +	 * have no ordering requirement, so use the same order for all of them.
> +	 */
> +	intel_de_write(display,
> +		       hsw_dip_data_reg(display, cpu_transcoder, type, 0),
> +		       data[0]);
> +
>   	/* Wa_14013475917 */
>   	if (!(IS_DISPLAY_VER(display, 13, 14) && crtc_state->has_psr &&
>   	      !crtc_state->has_panel_replay && type == DP_SDP_VSC))

      reply	other threads:[~2026-11-18  8:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13  7:48 [PATCH v2] drm/i915/dip: Write the DIP header last Chaitanya Kumar Borah
2026-11-18  8:42 ` Nautiyal, Ankit K [this message]

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=55f8ef22-9581-416e-a446-59660390818e@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=chaitanya.kumar.borah@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=stable@vger.kernel.org \
    --cc=suraj.kandpal@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    --cc=xiaolu.xie@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