* [PATCH 01/14] drm/i915/dp: Add the MSA placement Data M/N WA computation
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
@ 2026-11-30 4:32 ` Chaitanya Kumar Borah
2026-11-30 4:32 ` [PATCH 02/14] drm/i915/kunit: Export the MSA placement WA Data M/N helper for testing Chaitanya Kumar Borah
` (14 subsequent siblings)
15 siblings, 0 replies; 21+ messages in thread
From: Chaitanya Kumar Borah @ 2026-11-30 4:32 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: Chaitanya Kumar Borah
Some legacy TCONs can't handle an Audio SDP followed immediately by the
MSA. With the pixel based timing generator the active data, paced by the
Data M/N, ends before the end of line of the timing generator, paced by
the Link M/N. This leaves a window in which an SDP can be inserted right
before the MSA.
Bspec describes a workaround adjusting the Data M/N so that either there
is no such window, or there is a gap between the Audio SDP and the MSA:
- Find the end of line of the timing and data DDAs in the last TU.
- Shift the data end of line right, towards the timing end of line or
into the next TU, by lowering the Data M.
- If H. Blank can't support basic audio after that, shift the data end
of line left instead, by raising the Data M. This requires the Data M/N
ratio not to exceed 1.0, and the Audio Hblank Early programming to be
adjusted, which needs an H. Active larger than 512 pixels.
Add a helper computing the adjusted Data M/N for a given link
configuration, based on the bits transmitted per active line, and
tracking in the link M/N state whether the end of line was shifted left.
Unlike intel_link_compute_m_n(), which rounds the Data M down, round it
up in all cases, following the Bspec CEILING in the fixed N math and its
recommendation to round M up. The helper will be used by follow-up
changes.
Bspec: 68922
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
.../drm/i915/display/intel_crtc_state_dump.c | 5 +-
.../drm/i915/display/intel_display_types.h | 5 +
drivers/gpu/drm/i915/display/intel_dp.c | 444 ++++++++++++++++++
drivers/gpu/drm/i915/display/intel_dp.h | 4 +
4 files changed, 456 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
index 57e64dda79c1..708b07075bcb 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
@@ -37,11 +37,12 @@ intel_dump_m_n_config(struct drm_printer *p,
const struct intel_link_m_n *m_n)
{
drm_printf(p,
- "%s: lanes: %i; data_m: %u, data_n: %u, link_m: %u, link_n: %u, tu: %u, bypass_m_n_ratio_limit: %s\n",
+ "%s: lanes: %i; data_m: %u, data_n: %u, link_m: %u, link_n: %u, tu: %u, bypass_m_n_ratio_limit: %s, msa_wa_shift_left: %s\n",
id, lane_count,
m_n->data_m, m_n->data_n,
m_n->link_m, m_n->link_n, m_n->tu,
- str_yes_no(m_n->bypass_m_n_ratio_limit));
+ str_yes_no(m_n->bypass_m_n_ratio_limit),
+ str_yes_no(m_n->msa_wa_shift_left));
}
static void
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 514ca067e139..d1d775314d6d 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -977,6 +977,11 @@ struct intel_link_m_n {
u32 link_n;
/* Wa_14021768792 for linkm/n ratio > 10 */
bool bypass_m_n_ratio_limit;
+ /*
+ * Wa_14027342164: Data end of line shifted left, requiring the
+ * Audio Hblank Early adjustment. Computed only, not read out.
+ */
+ bool msa_wa_shift_left;
};
struct intel_csc_matrix {
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index ef164a797618..bd79de7df049 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -30,6 +30,7 @@
#include <linux/iopoll.h>
#include <linux/log2.h>
#include <linux/math.h>
+#include <linux/math64.h>
#include <linux/notifier.h>
#include <linux/seq_buf.h>
#include <linux/slab.h>
@@ -1354,6 +1355,449 @@ void intel_dp_check_m_n_ratio(const struct intel_crtc_state *crtc_state,
m_n_ratio, max_m_n_ratio);
}
+/*
+ * Wa_14027342164: MSA placement Data M/N workaround
+ *
+ * Some legacy TCONs can't handle an Audio SDP followed immediately by the
+ * MSA. With the pixel based timing generator the active data (Data M/N)
+ * ends before the end of line of the timing generator (Link M/N), leaving
+ * a window in which an SDP can be inserted right before the MSA. Adjust the
+ * Data M/N so that there is either no such window, or there is a gap between
+ * the Audio SDP and the MSA. See Bspec 68922 "Calculating Data M and Data N
+ * to Avoid Back-to-Back SDP followed by MSA in SST". The first line of each
+ * formula chain below is the Bspec's, the following lines are rearrangements.
+ *
+ * Notation:
+ * L = 8 * lanes, the bits carried per link symbol clock on all lanes
+ * (bits_per_clk)
+ * M, N = the Data M/N, N being MSA_WA_DATA_N
+ * Alloc = 64 * M / N, the number of data slots in each TU
+ * shift = the symbol clocks the data end of line is moved by
+ * _xN = scaled by N, _q16 = scaled by 2^16, to stay in integer math
+ * guard band = 2 symbol clocks, added to the shift right, to Total_Clks_Reqd
+ * before the shift left (on top of the 2 it already includes for the gap
+ * after the Audio SDP), and to the shift left case 2
+ *
+ * Where the line ends
+ *
+ * A TU is 64 link symbol clocks. The first Alloc of them, the data region,
+ * carry data and the rest, the idle part, don't. A line's bits fill whole TUs
+ * and a last, partly filled one. In the last TU, T_DDA_eol is where the timing
+ * generator ends the line, where the MSA goes out, and D_DDA_eol is where the
+ * data ends, always before T_DDA_eol:
+ *
+ * |dddddddddddddddddddddddddd........| d: data slot, .: idle slot
+ * D T
+ *
+ * Total_TUs = active_bits / (Alloc * L)
+ * = active_bits * N / (64 * L * M) substitute Alloc, multiply by N / N
+ * = tu_alloc_num_xN / tu_alloc_den_xN tu_alloc_num_xN = active_bits * N,
+ * tu_alloc_den_xN = 64 * L * M
+ *
+ * tu_alloc_num_xN = full_tus * tu_alloc_den_xN + rem_xN
+ * integer division: the whole TUs and the
+ * line's bits in the last TU
+ * Total_TUs = full_tus + rem_xN / tu_alloc_den_xN divide by tu_alloc_den_xN
+ *
+ * Last_Partial_TU = Total_TUs - FLOOR(Total_TUs)
+ * = rem_xN / tu_alloc_den_xN FLOOR(Total_TUs) = full_tus
+ *
+ * E.g. Total_TUs = 40.5: full_tus = 40, Last_Partial_TU = 0.5. If rem_xN is 0 the
+ * last TU is full: Last_Partial_TU = 1, so rem_xN = tu_alloc_den_xN.
+ *
+ * T_DDA_eol = Last_Partial_TU * 64
+ * = rem_xN / (L * M) substitute Last_Partial_TU,
+ * tu_alloc_den_xN
+ * D_DDA_eol = T_DDA_eol * M / N
+ * = rem_xN / (L * N) substitute T_DDA_eol
+ * Alloc = 64 * M / N
+ * = tu_alloc_den_xN / (L * N) 64 * M = tu_alloc_den_xN / L
+ *
+ * Shift right (WA_Delay_Right)
+ *
+ * Move the data end of line later, so that no SDP can precede the MSA. It has to
+ * land on a data slot at or after T_DDA_eol, plus a guard band of 2 clocks.
+ *
+ * Case 1: T_DDA_eol < Alloc T_DDA_eol in the data region: move the
+ * data end up to it
+ * rem_xN * N < tu_alloc_den_xN * M substitute, cross-multiply
+ * shift = T_DDA_eol - D_DDA_eol
+ * = rem_xN * (N - M) / (L * M * N) substitute, common denominator
+ *
+ * Case 2: otherwise T_DDA_eol in the idle part: move the data
+ * end to the end of the data region
+ * shift = Alloc - D_DDA_eol
+ * = (tu_alloc_den_xN - rem_xN) / (L * N) substitute
+ *
+ * The shift is rounded up, then shift += 2. In case 2 the guard band carries the
+ * data end from the end of the data region into the next TU. The shift is applied
+ * on the line's bits, new_bits = active_bits - shift * L (WA_Adjusted_BPP): a
+ * smaller Data M spreads the same bits over a bit more link time, moving the data
+ * end later.
+ *
+ * Audio check
+ *
+ * The shifted data end uses up H. Blank past T_DDA_eol. The new Data M, for the
+ * shifted bits, gives the new end of line for the original active_bits, with
+ * New_D_DDA_eol = new_rem_xN / (L * N) in the new last TU. Original_Clks_in_HBLNK
+ * are the clocks in H. Blank.
+ *
+ * Total_Clks_Reqd, the clocks H. Blank has to hold, is for basic audio (48 kHz, up to 2
+ * samples), the BS symbols and the FEC symbols (with FEC), plus a 2 clock gap after the
+ * Audio SDP. Higher audio rates are not accounted for.
+ *
+ * Total_Clks_Reqd = Basic_Audio + BS_Symbols + FEC + 2
+ *
+ * The lost clocks:
+ *
+ * Case 1: new_full_tus == full_tus the data end stayed in the last TU: the
+ * clocks lost are its distance past
+ * T_DDA_eol
+ * Clks_Lost_in_HBLNK = New_D_DDA_eol - T_DDA_eol
+ *
+ * Case 2: new_full_tus == full_tus + 1 the data end moved to the next TU: the
+ * clocks lost are the rest of the TU after
+ * T_DDA_eol plus its distance into the next
+ * TU
+ * Clks_Lost_in_HBLNK = (64 - T_DDA_eol) + New_D_DDA_eol
+ *
+ * Clks_Remaining_in_HBLNK > Total_Clks_Reqd what is left of H. Blank exceeds the
+ * audio's needs: the shift right is enough
+ * Original_Clks_in_HBLNK - Clks_Lost_in_HBLNK > Total_Clks_Reqd
+ * substitute Clks_Remaining_in_HBLNK
+ * hblank_clks_q16 > lost_q16 + (clks_reqd << 16) move Clks_Lost_in_HBLNK, in Q16
+ *
+ * Shift left (WA_Delay_Left)
+ *
+ * If the audio does not fit, move the data end of line earlier instead, and
+ * adjust the Audio Hblank Early programming accordingly.
+ * Total_Clks_Reqd is first increased by 2, to keep a gap between the SDP and the
+ * MSA. No data can end in a TU's idle part and it carries no data, so it doesn't
+ * count in the shift.
+ *
+ * Case 1: Total_Clks_Reqd < D_DDA_eol stays in the last TU: move the data end
+ * left by the required clocks
+ * Total_Clks_Reqd * L * N < rem_xN substitute D_DDA_eol, multiply by L * N
+ * shift = Total_Clks_Reqd
+ *
+ * Case 2: Total_Clks_Reqd - D_DDA_eol < 64 - Alloc reaches the previous idle part: move the
+ * data end to the end of the previous data
+ * region, plus the guard band
+ * Total_Clks_Reqd * L * N < rem_xN + 64 * (L * N - L * M)
+ * substitute D_DDA_eol, Alloc,
+ * tu_alloc_den_xN, multiply by L * N
+ * shift = D_DDA_eol + 2
+ * = rem_xN / (L * N) + 2 substitute D_DDA_eol
+ *
+ * Case 3: otherwise reaches the previous data region: move the
+ * data end there
+ * shift = Total_Clks_Reqd - (64 - Alloc)
+ * = (Total_Clks_Reqd * N - 64 * N + 64 * M) / N
+ * substitute Alloc, common denominator
+ *
+ * The shift is rounded up. It is applied on the line's bits, new_bits =
+ * active_bits + shift * L, which gives a larger Data M, moving the data end
+ * earlier.
+ */
+#define MSA_WA_TU_SIZE 64ULL
+#define MSA_WA_DATA_N 0x800000ULL
+#define MSA_WA_FRAC_SHIFT 16
+/* Bspec Ovrhd_Symbol, the overhead symbols of a DSC line, in bits */
+#define MSA_WA_DSC_OVRHD_BITS (4 * 8)
+
+/* Where the line ends for a Data M, see msa_wa_end_of_line() */
+struct intel_dp_msa_wa_eol {
+ u64 m; /* the Data M */
+ u64 full_tus; /* the number of whole TUs of the line */
+ u64 rem_xN; /* the line's bits in the last TU, scaled by N */
+};
+
+/*
+ * Data M for a fixed Data N (Bspec fixed N math, without the SSC term), rounded
+ * up, also when recomputing it for the WA shifts.
+ *
+ * TODO: Account for the Bspec SSC efficiency. It is taken as 1 here, as in the
+ * regular 8b/10b SST Data M/N computation, i.e. the link is assumed to be
+ * spread-free.
+ */
+static u64 msa_wa_data_m(u64 hactive, u64 pixel_clock, int link_rate,
+ u64 lane_count, bool fec_enable, u64 active_bits)
+{
+ /* 8b/10b FEC overhead 2.4% */
+ u64 efficiency_x1000 = fec_enable ? 976 : 1000;
+
+ return mul_u64_u64_div_u64_roundup(pixel_clock * active_bits * 1000,
+ MSA_WA_DATA_N,
+ hactive * intel_dp_link_symbol_clock(link_rate) *
+ lane_count * 8 * efficiency_x1000);
+}
+
+/*
+ * Link symbol clocks required in H. Blank for basic audio, BS and FEC symbols,
+ * plus a gap after the Audio SDP (the Bspec Total_Clks_Reqd).
+ */
+static int msa_wa_hblank_clks_reqd(int htotal, int pixel_clock,
+ int lane_count, bool fec_enable)
+{
+ int samples, packets, clks;
+
+ /* 48000 / (Vtotal * Refresh_Rate) = 48 * htotal / pixel_clock, pixel clock in kHz */
+ samples = DIV_ROUND_UP(48 * htotal, pixel_clock);
+ packets = DIV_ROUND_UP(samples + 1, 2);
+
+ clks = (packets * 20 + 16) / lane_count; /* basic audio */
+ clks += 4 + 3 * (4 / lane_count); /* BS symbols */
+ if (fec_enable)
+ clks += lane_count == 1 ? 13 : 7; /* FEC symbols */
+
+ /* ensure there will be a gap after the Audio SDP */
+ return clks + 2;
+}
+
+/*
+ * Bits transmitted per active line, the Bspec "Hactive * bpp_with_Hblank_Increment"
+ * term for an 8b/10b SST stream: accounts for the H. Active padding without DSC
+ * and for the chunk padding, EOC and overhead symbols with DSC.
+ */
+static int intel_dp_msa_wa_active_bits(int hactive, int bpp_x16, int lane_count,
+ int dsc_slice_count)
+{
+ int bits_per_clk = 8 * lane_count;
+ int padded_hactive = ALIGN(hactive, 4);
+ int symbol_cycles;
+
+ if (!dsc_slice_count)
+ return fxp_q4_to_int_roundup(padded_hactive * bpp_x16);
+
+ symbol_cycles = drm_dp_link_symbol_cycles(lane_count, hactive, dsc_slice_count,
+ bpp_x16, 8, false);
+
+ return symbol_cycles * bits_per_clk + MSA_WA_DSC_OVRHD_BITS;
+}
+
+static u64 msa_wa_tu_alloc_bits_xN(u64 m, u64 bits_per_clk)
+{
+ return MSA_WA_TU_SIZE * bits_per_clk * m;
+}
+
+/*
+ * Where the line ends for the given Data M: fills @eol with the Data M, the
+ * number of whole TUs of the line and the line's bits in the last TU, scaled
+ * by N.
+ */
+static void msa_wa_end_of_line(struct intel_dp_msa_wa_eol *eol,
+ u64 active_bits, u64 m, u64 bits_per_clk)
+{
+ u64 tu_alloc_den_xN = msa_wa_tu_alloc_bits_xN(m, bits_per_clk);
+ u64 rem_xN;
+
+ eol->m = m;
+ eol->full_tus = div64_u64_rem(active_bits * MSA_WA_DATA_N, tu_alloc_den_xN, &rem_xN);
+
+ /* The last TU is full */
+ if (!rem_xN)
+ rem_xN = tu_alloc_den_xN;
+
+ eol->rem_xN = rem_xN;
+}
+
+/* Shift right: the symbol clocks to move the data end of line later by */
+static u64 msa_wa_shift_right(const struct intel_dp_msa_wa_eol *eol, u64 bits_per_clk)
+{
+ const u64 n = MSA_WA_DATA_N;
+ const u64 m = eol->m, rem_xN = eol->rem_xN;
+ u64 bits_per_clk_xN = bits_per_clk * n;
+ u64 tu_alloc_den_xN = msa_wa_tu_alloc_bits_xN(m, bits_per_clk);
+ u64 shift;
+
+ if (rem_xN * n < m * tu_alloc_den_xN) {
+ /* Shift right: Case 1 */
+ shift = DIV64_U64_ROUND_UP(rem_xN * (n - m), bits_per_clk_xN * m);
+ } else {
+ /* Shift right: Case 2 */
+ shift = DIV64_U64_ROUND_UP(tu_alloc_den_xN - rem_xN, bits_per_clk_xN);
+ }
+
+ return shift + 2;
+}
+
+/* The symbol clocks of H. Blank used up by the shifted data end of line, in Q16 */
+static u64 msa_wa_hblank_clks_lost_q16(const struct intel_dp_msa_wa_eol *eol,
+ const struct intel_dp_msa_wa_eol *new_eol,
+ u64 bits_per_clk, u64 hblank_clks_q16)
+{
+ const u64 m = eol->m, full_tus = eol->full_tus, rem_xN = eol->rem_xN;
+ const u64 new_full_tus = new_eol->full_tus, new_rem_xN = new_eol->rem_xN;
+ /* Round conservatively: T_DDA_eol down, New_D_DDA_eol up */
+ u64 t_eol_q16 = div64_u64(rem_xN << MSA_WA_FRAC_SHIFT, bits_per_clk * m);
+ u64 new_d_eol_q16 = DIV64_U64_ROUND_UP(new_rem_xN << MSA_WA_FRAC_SHIFT,
+ bits_per_clk * MSA_WA_DATA_N);
+
+ /* Audio check: Case 1 */
+ if (new_full_tus == full_tus) {
+ /*
+ * A line ending exactly on a TU boundary has a full last TU, with
+ * T_DDA_eol at its end (Last_Partial_TU = 1). The shifted data end
+ * spills into a new TU, but new_full_tus doesn't count it, as the
+ * Bspec TU counting counts the full TU both in full_tus and as the
+ * partial TU. The data end, a few clocks into the new TU, then
+ * looks like it is in the last TU before T_DDA_eol, which a shift
+ * right can't do otherwise. The clocks lost can't be trusted then,
+ * so force a shift left, by counting all of H. Blank as lost: it
+ * doesn't depend on them and is the conservative choice.
+ */
+ if (new_d_eol_q16 < t_eol_q16)
+ return hblank_clks_q16;
+
+ return new_d_eol_q16 - t_eol_q16;
+ }
+
+ /* Audio check: Case 2 */
+ if (new_full_tus == full_tus + 1)
+ return (MSA_WA_TU_SIZE << MSA_WA_FRAC_SHIFT) - t_eol_q16 + new_d_eol_q16;
+
+ /* Moved by more than a TU, not expected: all of H. Blank counts as lost */
+ return hblank_clks_q16;
+}
+
+/* The symbol clocks in H. Blank (Original_Clks_in_HBLNK), in Q16, rounded down */
+static u64 msa_wa_hblank_clks_q16(int hactive, int htotal, int pixel_clock, int link_rate)
+{
+ u64 hblank = htotal - hactive;
+
+ return div_u64(hblank * intel_dp_link_symbol_clock(link_rate) << MSA_WA_FRAC_SHIFT,
+ pixel_clock);
+}
+
+/* Does H. Blank still hold the audio after the shift right? */
+static bool msa_wa_audio_fits(const struct intel_dp_msa_wa_eol *eol,
+ const struct intel_dp_msa_wa_eol *new_eol,
+ u64 bits_per_clk, u64 hblank_clks_q16, u64 clks_reqd)
+{
+ u64 lost_q16 = msa_wa_hblank_clks_lost_q16(eol, new_eol, bits_per_clk, hblank_clks_q16);
+
+ return hblank_clks_q16 > lost_q16 + (clks_reqd << MSA_WA_FRAC_SHIFT);
+}
+
+/*
+ * Shift left: the symbol clocks to move the data end of line earlier by, if the
+ * audio does not fit
+ */
+static u64 msa_wa_shift_left(const struct intel_dp_msa_wa_eol *eol, u64 bits_per_clk, u64 clks_reqd)
+{
+ const u64 n = MSA_WA_DATA_N;
+ const u64 m = eol->m, rem_xN = eol->rem_xN;
+ u64 bits_per_clk_xN = bits_per_clk * n;
+
+ /* A guard band to ensure a gap between the SDP and the MSA */
+ clks_reqd += 2;
+
+ /* Shift left: Case 1 */
+ if (clks_reqd * bits_per_clk_xN < rem_xN)
+ return clks_reqd;
+
+ /* Shift left: Case 2 */
+ if (clks_reqd * bits_per_clk_xN <
+ rem_xN + MSA_WA_TU_SIZE * (bits_per_clk_xN - bits_per_clk * m))
+ return DIV64_U64_ROUND_UP(rem_xN, bits_per_clk_xN) + 2;
+
+ /* Shift left: Case 3 */
+ return DIV64_U64_ROUND_UP(clks_reqd * n + MSA_WA_TU_SIZE * m -
+ MSA_WA_TU_SIZE * n, n);
+}
+
+static int __intel_dp_msa_wa_compute_m_n(int hactive, int htotal, int pixel_clock,
+ int link_rate, int lane_count, int active_bits,
+ bool fec_enable, struct intel_link_m_n *m_n)
+{
+ const u64 n = MSA_WA_DATA_N;
+ u64 bits_per_clk = 8 * lane_count;
+ u64 active, m, new_m, hblank_clks_q16, clks_reqd, shift;
+ struct intel_dp_msa_wa_eol eol, new_eol;
+
+ if (!hactive || htotal <= hactive || !pixel_clock || !lane_count ||
+ active_bits <= 0)
+ return -EINVAL;
+
+ active = active_bits;
+
+ m = msa_wa_data_m(hactive, pixel_clock, link_rate, lane_count, fec_enable, active);
+ if (!m || m > n)
+ return -ERANGE;
+
+ msa_wa_end_of_line(&eol, active, m, bits_per_clk);
+
+ /*
+ * Shift right. The Bspec WA_Adjusted_BPP is applied on the bits: the new
+ * Data M is computed for the line with the shifted bits removed.
+ */
+ shift = msa_wa_shift_right(&eol, bits_per_clk);
+
+ /*
+ * Not expected for any real mode: the shift is a few tens of clocks at
+ * most. Don't let the unsigned subtraction below wrap for a line too
+ * short to carry it.
+ */
+ if (shift * bits_per_clk >= active)
+ return -EINVAL;
+
+ new_m = msa_wa_data_m(hactive, pixel_clock, link_rate, lane_count, fec_enable,
+ active - shift * bits_per_clk);
+
+ /* Check that H. Blank can still support audio */
+ msa_wa_end_of_line(&new_eol, active, new_m, bits_per_clk);
+ hblank_clks_q16 = msa_wa_hblank_clks_q16(hactive, htotal, pixel_clock, link_rate);
+ clks_reqd = msa_wa_hblank_clks_reqd(htotal, pixel_clock, lane_count, fec_enable);
+
+ if (msa_wa_audio_fits(&eol, &new_eol, bits_per_clk, hblank_clks_q16, clks_reqd)) {
+ m_n->msa_wa_shift_left = false;
+ goto out;
+ }
+
+ /* Shift left, the shifted bits are added to the line instead */
+ shift = msa_wa_shift_left(&eol, bits_per_clk, clks_reqd);
+ new_m = msa_wa_data_m(hactive, pixel_clock, link_rate, lane_count, fec_enable,
+ active + shift * bits_per_clk);
+
+ /* The shift left might make the Data M/N ratio exceed 1.0, reject */
+ if (new_m > n)
+ return -ERANGE;
+
+ /* The 128 pixel x4 Audio Hblank Early must be within H. Active, reject if not */
+ if (hactive <= 128 * 4)
+ return -ERANGE;
+
+ m_n->msa_wa_shift_left = true;
+out:
+ m_n->data_m = new_m;
+ m_n->data_n = n;
+
+ return 0;
+}
+
+/*
+ * Compute the MSA placement WA Data M/N for the given link configuration and
+ * link bpp, updating also msa_wa_shift_left in @m_n on success. Returns
+ * -ERANGE if the adjusted Data M/N ratio exceeds 1.0 or the WA's Audio Hblank
+ * Early programming isn't possible, -EINVAL for invalid parameters.
+ */
+int intel_dp_msa_wa_compute_m_n(const struct intel_crtc_state *crtc_state,
+ int link_rate, int lane_count, int link_bpp_x16,
+ bool dsc, struct intel_link_m_n *m_n)
+{
+ const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
+ int dsc_slice_count = dsc ? intel_dsc_line_slice_count(&crtc_state->dsc.slice_config) : 0;
+ int active_bits = intel_dp_msa_wa_active_bits(adjusted_mode->crtc_hdisplay,
+ link_bpp_x16, lane_count,
+ dsc_slice_count);
+
+ return __intel_dp_msa_wa_compute_m_n(adjusted_mode->crtc_hdisplay,
+ adjusted_mode->crtc_htotal,
+ adjusted_mode->crtc_clock,
+ link_rate, lane_count, active_bits,
+ crtc_state->fec_enable, m_n);
+}
+
static int intel_dp_mso_pixel_clock(struct intel_dp *intel_dp, int pixel_clock)
{
if (!intel_dp->mso_link_count)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
index 1f4a3aff9abe..4deb7acf39eb 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.h
+++ b/drivers/gpu/drm/i915/display/intel_dp.h
@@ -250,4 +250,8 @@ void intel_dp_link_cleanup(struct intel_dp *intel_dp);
void intel_dp_check_m_n_ratio(const struct intel_crtc_state *crtc_state,
struct intel_link_m_n *m_n);
+int intel_dp_msa_wa_compute_m_n(const struct intel_crtc_state *crtc_state,
+ int link_rate, int lane_count, int link_bpp_x16,
+ bool dsc, struct intel_link_m_n *m_n);
+
#endif /* __INTEL_DP_H__ */
--
2.50.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 02/14] drm/i915/kunit: Export the MSA placement WA Data M/N helper for testing
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
2026-11-30 4:32 ` [PATCH 01/14] drm/i915/dp: Add the MSA placement Data M/N WA computation Chaitanya Kumar Borah
@ 2026-11-30 4:32 ` Chaitanya Kumar Borah
2026-11-30 4:32 ` [PATCH 03/14] drm/i915/kunit: Add MSA placement WA Data M/N tests Chaitanya Kumar Borah
` (13 subsequent siblings)
15 siblings, 0 replies; 21+ messages in thread
From: Chaitanya Kumar Borah @ 2026-11-30 4:32 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: Chaitanya Kumar Borah
The KUnit tests added by a follow-up change need to call
intel_dp_msa_wa_compute_m_n(), which is otherwise used only within
intel_dp.c.
Export it through a test ops table instead of exporting the helper
directly, as done for the link caps and link training helpers. The
shared display code is built into both i915 and xe, so a single exported
symbol name would collide.
Name the table intel_dp_msa_wa_test_ops, not intel_dp_test_ops, as the
latter could be mistaken for part of the DP compliance test code in
intel_dp_test.c. The members are generated from a single list, so
exporting more intel_dp.c functions later is a matter of adding to it,
generalizing the name if they are unrelated to the MSA WA.
No functional changes.
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 31 +++++++++++++++++++++++++
drivers/gpu/drm/i915/display/intel_dp.h | 26 +++++++++++++++++++++
2 files changed, 57 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index bd79de7df049..396518ea8d66 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -39,6 +39,8 @@
#include <linux/types.h>
#include <asm/byteorder.h>
+#include <kunit/visibility.h>
+
#include <drm/display/drm_dp_helper.h>
#include <drm/display/drm_dp_tunnel.h>
#include <drm/display/drm_dsc_helper.h>
@@ -8199,3 +8201,32 @@ void intel_dp_link_cleanup(struct intel_dp *intel_dp)
intel_dp_link_caps_cleanup(intel_dp->link.caps);
intel_dp_link_training_cleanup(intel_dp->link.training);
}
+
+#if IS_ENABLED(CONFIG_KUNIT)
+
+#define __INIT_MEMBER(__name, __fn) \
+ .__name = __fn,
+
+#define INTEL_DP_MSA_WA_TEST_OPS_INIT \
+ INTEL_DP_MSA_WA_TEST_OPS_MEMBERS(__INIT_MEMBER)
+
+#ifdef I915
+
+const struct intel_dp_msa_wa_test_ops i915_display_dp_msa_wa_test_ops = {
+ INTEL_DP_MSA_WA_TEST_OPS_INIT
+};
+EXPORT_SYMBOL_IF_KUNIT(i915_display_dp_msa_wa_test_ops);
+
+#else
+
+const struct intel_dp_msa_wa_test_ops intel_display_dp_msa_wa_test_ops = {
+ INTEL_DP_MSA_WA_TEST_OPS_INIT
+};
+EXPORT_SYMBOL_IF_KUNIT(intel_display_dp_msa_wa_test_ops);
+
+#endif /* I915 */
+
+#undef INTEL_DP_MSA_WA_TEST_OPS_INIT
+#undef __INIT_MEMBER
+
+#endif /* CONFIG_KUNIT */
diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
index 4deb7acf39eb..71a505df647a 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.h
+++ b/drivers/gpu/drm/i915/display/intel_dp.h
@@ -254,4 +254,30 @@ int intel_dp_msa_wa_compute_m_n(const struct intel_crtc_state *crtc_state,
int link_rate, int lane_count, int link_bpp_x16,
bool dsc, struct intel_link_m_n *m_n);
+#if IS_ENABLED(CONFIG_KUNIT)
+
+#define INTEL_DP_MSA_WA_TEST_OPS_MEMBERS(__X) \
+ __X(msa_wa_compute_m_n, intel_dp_msa_wa_compute_m_n)
+
+#define __DECLARE_MEMBER(__name, __fn) \
+ typeof(__fn) *__name;
+
+#define INTEL_DP_MSA_WA_TEST_OPS_DECLARE \
+ INTEL_DP_MSA_WA_TEST_OPS_MEMBERS(__DECLARE_MEMBER)
+
+struct intel_dp_msa_wa_test_ops {
+ INTEL_DP_MSA_WA_TEST_OPS_DECLARE
+};
+
+#undef INTEL_DP_MSA_WA_TEST_OPS_DECLARE
+#undef __DECLARE_MEMBER
+
+#ifdef I915
+extern const struct intel_dp_msa_wa_test_ops i915_display_dp_msa_wa_test_ops;
+#else
+extern const struct intel_dp_msa_wa_test_ops intel_display_dp_msa_wa_test_ops;
+#endif /* I915 */
+
+#endif /* CONFIG_KUNIT */
+
#endif /* __INTEL_DP_H__ */
--
2.50.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 03/14] drm/i915/kunit: Add MSA placement WA Data M/N tests
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
2026-11-30 4:32 ` [PATCH 01/14] drm/i915/dp: Add the MSA placement Data M/N WA computation Chaitanya Kumar Borah
2026-11-30 4:32 ` [PATCH 02/14] drm/i915/kunit: Export the MSA placement WA Data M/N helper for testing Chaitanya Kumar Borah
@ 2026-11-30 4:32 ` Chaitanya Kumar Borah
2026-11-30 4:32 ` [PATCH 04/14] drm/xe/kunit: Build the MSA placement WA display tests Chaitanya Kumar Borah
` (12 subsequent siblings)
15 siblings, 0 replies; 21+ messages in thread
From: Chaitanya Kumar Borah @ 2026-11-30 4:32 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: Chaitanya Kumar Borah
Add KUnit tests for the MSA placement WA Data M/N computation, covering:
- shifting the data end of line right within the last TU
- shifting it right into the next TU
- shifting it left, for each of the Bspec cases
- DSC and non-DSC streams
- an H. Active not being a multiple of 4 pixels
- a line ending exactly on a TU boundary, expecting the conservative
shift left, as the Bspec TU counting doesn't handle a full last TU
- the error cases:
- a Data M/N above 1.0 before the shift left
- a Data M/N above 1.0 after the shift left
- an H. Active too small for the Audio Hblank Early programming
- an H. Total equal to the H. Active
The expected values are computed with a reference model of the Bspec
formulas, cross-checked against exact rational arithmetic, not taken
from hardware.
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
drivers/gpu/drm/i915/display/tests/Makefile | 3 +-
.../i915/display/tests/intel_dp_msa_wa_test.c | 189 ++++++++++++++++++
2 files changed, 191 insertions(+), 1 deletion(-)
create mode 100644 drivers/gpu/drm/i915/display/tests/intel_dp_msa_wa_test.c
diff --git a/drivers/gpu/drm/i915/display/tests/Makefile b/drivers/gpu/drm/i915/display/tests/Makefile
index ad250974160f..ebd6932beea4 100644
--- a/drivers/gpu/drm/i915/display/tests/Makefile
+++ b/drivers/gpu/drm/i915/display/tests/Makefile
@@ -4,4 +4,5 @@ subdir-ccflags-y += -I$(srctree)/drivers/gpu/drm/i915/display/
obj-$(CONFIG_DRM_I915_KUNIT_TEST) += i915_display_test.o
i915_display_test-y = \
- intel_dp_link_test.o
+ intel_dp_link_test.o \
+ intel_dp_msa_wa_test.o
diff --git a/drivers/gpu/drm/i915/display/tests/intel_dp_msa_wa_test.c b/drivers/gpu/drm/i915/display/tests/intel_dp_msa_wa_test.c
new file mode 100644
index 000000000000..ee775b18b546
--- /dev/null
+++ b/drivers/gpu/drm/i915/display/tests/intel_dp_msa_wa_test.c
@@ -0,0 +1,189 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2026 Intel Corporation
+ */
+
+#include <kunit/test.h>
+
+#include <linux/errno.h>
+#include <linux/string.h>
+
+#include "intel_display_types.h"
+#include "intel_dp.h"
+
+#define MSA_WA_TEST_DATA_N 0x800000
+
+struct msa_wa_test_case {
+ const char *name;
+ int hactive; /* pixels */
+ int htotal; /* pixels */
+ int clock; /* kHz */
+ int link_rate; /* 10 kbps units */
+ int lane_count;
+ int link_bpp_x16;
+ int dsc_slice_count; /* 0 for non-DSC, FEC is enabled with DSC */
+ int ret;
+ u32 data_m;
+ bool shift_left;
+};
+
+/*
+ * The expected values are computed with a reference model of the Bspec
+ * formulas, cross-checked against exact rational arithmetic, not taken from
+ * hardware. They include the conservative shift left for a line ending exactly
+ * on a TU boundary, which the Bspec TU counting doesn't handle.
+ */
+static const struct msa_wa_test_case msa_wa_test_cases[] = {
+ {
+ .name = "1920x1080@60, HBR2 x4, 24 bpp: shift right, same TU",
+ .hactive = 1920, .htotal = 2200, .clock = 148500,
+ .link_rate = 540000, .lane_count = 4, .link_bpp_x16 = 24 * 16,
+ .data_m = 1721740, .shift_left = false,
+ }, {
+ .name = "2560x1440@60 RB, HBR2 x4, 30 bpp: shift right, next TU",
+ .hactive = 2560, .htotal = 2720, .clock = 241500,
+ .link_rate = 540000, .lane_count = 4, .link_bpp_x16 = 30 * 16,
+ .data_m = 3490721, .shift_left = false,
+ }, {
+ .name = "1366x768@60, HBR x2, 24 bpp: H. Active not a multiple of 4",
+ .hactive = 1366, .htotal = 1792, .clock = 85500,
+ .link_rate = 270000, .lane_count = 2, .link_bpp_x16 = 24 * 16,
+ .data_m = 3959309, .shift_left = false,
+ }, {
+ .name = "1920x1080@144 RB2, HBR x4, 18 bpp: shift left, case 1",
+ .hactive = 1920, .htotal = 1960, .clock = 326551,
+ .link_rate = 270000, .lane_count = 4, .link_bpp_x16 = 18 * 16,
+ .data_m = 5812576, .shift_left = true,
+ }, {
+ .name = "640x480@60, HBR2 x4, 18 bpp: shift left, case 2",
+ .hactive = 640, .htotal = 800, .clock = 25200,
+ .link_rate = 540000, .lane_count = 4, .link_bpp_x16 = 18 * 16,
+ .data_m = 222036, .shift_left = true,
+ }, {
+ .name = "3840 wide, narrow H. Blank, RBR x2, 18 bpp: shift left, case 3",
+ .hactive = 3840, .htotal = 3876, .clock = 141629,
+ .link_rate = 162000, .lane_count = 2, .link_bpp_x16 = 18 * 16,
+ .data_m = 8328791, .shift_left = true,
+ }, {
+ .name = "3840x2160@60 RB2, HBR3 x4, DSC 12 bpp, 4 slices: shift right",
+ .hactive = 3840, .htotal = 3920, .clock = 537750,
+ .link_rate = 810000, .lane_count = 4, .link_bpp_x16 = 12 * 16,
+ .dsc_slice_count = 4,
+ .data_m = 2129367, .shift_left = false,
+ }, {
+ .name = "2560x1440@144 RB2, HBR2 x2, DSC 10 bpp, 1 slice: shift left",
+ .hactive = 2560, .htotal = 2600, .clock = 570960,
+ .link_rate = 540000, .lane_count = 2, .link_bpp_x16 = 10 * 16,
+ .dsc_slice_count = 1,
+ .data_m = 5828882, .shift_left = true,
+ }, {
+ .name = "1280x720@60, RBR x1, 18 bpp: Data M/N > 1.0",
+ .hactive = 1280, .htotal = 1650, .clock = 74250,
+ .link_rate = 162000, .lane_count = 1, .link_bpp_x16 = 18 * 16,
+ .ret = -ERANGE,
+ }, {
+ .name = "1440 wide, HBR x4, DSC 10 bpp, 8 slices: Data M/N > 1.0 after shift left",
+ .hactive = 1440, .htotal = 1519, .clock = 797511,
+ .link_rate = 270000, .lane_count = 4, .link_bpp_x16 = 10 * 16,
+ .dsc_slice_count = 8,
+ .ret = -ERANGE,
+ }, {
+ .name = "500 wide, HBR3 x4, 30 bpp: shift left with H. Active <= 512",
+ .hactive = 500, .htotal = 752, .clock = 34291,
+ .link_rate = 810000, .lane_count = 4, .link_bpp_x16 = 30 * 16,
+ .ret = -ERANGE,
+ }, {
+ .name = "1920 wide, HBR2 x4, 24 bpp, line ends on a TU boundary: shift left",
+ .hactive = 1920, .htotal = 2000, .clock = 360000,
+ .link_rate = 540000, .lane_count = 4, .link_bpp_x16 = 24 * 16,
+ .data_m = 4252559, .shift_left = true,
+ }, {
+ .name = "H. Total == H. Active: invalid",
+ .hactive = 1920, .htotal = 1920, .clock = 148500,
+ .link_rate = 540000, .lane_count = 4, .link_bpp_x16 = 24 * 16,
+ .ret = -EINVAL,
+ },
+};
+
+static void msa_wa_test_case_desc(const struct msa_wa_test_case *t, char *desc)
+{
+ strscpy(desc, t->name, KUNIT_PARAM_DESC_SIZE);
+}
+
+KUNIT_ARRAY_PARAM(msa_wa, msa_wa_test_cases, msa_wa_test_case_desc);
+
+static const struct intel_dp_msa_wa_test_ops *dp_ops;
+
+static void intel_dp_msa_wa_test_compute_m_n(struct kunit *test)
+{
+ const struct msa_wa_test_case *t = test->param_value;
+ const struct intel_link_m_n m_n_init = {
+ .tu = 64,
+ .data_m = 1, .data_n = 2,
+ .link_m = 3, .link_n = 4,
+ .msa_wa_shift_left = true,
+ };
+ struct intel_link_m_n m_n = m_n_init;
+ struct intel_crtc_state *crtc_state;
+ struct drm_display_mode *mode;
+ int ret;
+
+ crtc_state = kunit_kzalloc(test, sizeof(*crtc_state), GFP_KERNEL);
+ KUNIT_ASSERT_NOT_NULL(test, crtc_state);
+
+ mode = &crtc_state->hw.adjusted_mode;
+ mode->crtc_hdisplay = t->hactive;
+ mode->crtc_htotal = t->htotal;
+ mode->crtc_clock = t->clock;
+
+ crtc_state->fec_enable = !!t->dsc_slice_count;
+ crtc_state->dsc.slice_config.pipes_per_line = 1;
+ crtc_state->dsc.slice_config.streams_per_pipe = 1;
+ crtc_state->dsc.slice_config.slices_per_stream = t->dsc_slice_count;
+
+ ret = dp_ops->msa_wa_compute_m_n(crtc_state, t->link_rate, t->lane_count,
+ t->link_bpp_x16, t->dsc_slice_count, &m_n);
+ KUNIT_EXPECT_EQ(test, ret, t->ret);
+
+ if (ret) {
+ /* The M/N state must be left intact on failure. */
+ KUNIT_EXPECT_MEMEQ(test, &m_n, &m_n_init, sizeof(m_n));
+
+ return;
+ }
+
+ KUNIT_EXPECT_EQ(test, m_n.data_m, t->data_m);
+ KUNIT_EXPECT_EQ(test, m_n.data_n, MSA_WA_TEST_DATA_N);
+ KUNIT_EXPECT_EQ(test, m_n.msa_wa_shift_left, t->shift_left);
+
+ /* Only the Data M/N is adjusted. */
+ KUNIT_EXPECT_EQ(test, m_n.tu, m_n_init.tu);
+ KUNIT_EXPECT_EQ(test, m_n.link_m, m_n_init.link_m);
+ KUNIT_EXPECT_EQ(test, m_n.link_n, m_n_init.link_n);
+}
+
+static struct kunit_case intel_dp_msa_wa_test_cases[] = {
+ KUNIT_CASE_PARAM(intel_dp_msa_wa_test_compute_m_n, msa_wa_gen_params),
+ {}
+};
+
+static int intel_dp_msa_wa_test_suite_init(struct kunit_suite *test_suite)
+{
+#ifdef I915
+ dp_ops = &i915_display_dp_msa_wa_test_ops;
+#else
+ dp_ops = &intel_display_dp_msa_wa_test_ops;
+#endif
+
+ return 0;
+}
+
+static struct kunit_suite intel_dp_msa_wa_test_suite = {
+ .name = "intel_dp_msa_wa",
+ .suite_init = intel_dp_msa_wa_test_suite_init,
+ .test_cases = intel_dp_msa_wa_test_cases,
+};
+
+kunit_test_suites(&intel_dp_msa_wa_test_suite);
+
+MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING");
--
2.50.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 04/14] drm/xe/kunit: Build the MSA placement WA display tests
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
` (2 preceding siblings ...)
2026-11-30 4:32 ` [PATCH 03/14] drm/i915/kunit: Add MSA placement WA Data M/N tests Chaitanya Kumar Borah
@ 2026-11-30 4:32 ` Chaitanya Kumar Borah
2026-11-30 4:32 ` [PATCH 05/14] drm/i915/audio: Rename enable_audio_dsc_wa() Chaitanya Kumar Borah
` (11 subsequent siblings)
15 siblings, 0 replies; 21+ messages in thread
From: Chaitanya Kumar Borah @ 2026-11-30 4:32 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: Chaitanya Kumar Borah
Hook the shared i915 display MSA placement WA KUnit tests into the xe
display test build.
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
drivers/gpu/drm/xe/display/tests/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/display/tests/Makefile b/drivers/gpu/drm/xe/display/tests/Makefile
index c71686458072..924d5868b8db 100644
--- a/drivers/gpu/drm/xe/display/tests/Makefile
+++ b/drivers/gpu/drm/xe/display/tests/Makefile
@@ -10,4 +10,5 @@ $(obj)/i915-display/tests/%.o: $(srctree)/drivers/gpu/drm/i915/display/tests/%.c
obj-$(CONFIG_DRM_XE_KUNIT_TEST) += xe_display_test.o
xe_display_test-y = \
- i915-display/tests/intel_dp_link_test.o
+ i915-display/tests/intel_dp_link_test.o \
+ i915-display/tests/intel_dp_msa_wa_test.o
--
2.50.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 05/14] drm/i915/audio: Rename enable_audio_dsc_wa()
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
` (3 preceding siblings ...)
2026-11-30 4:32 ` [PATCH 04/14] drm/xe/kunit: Build the MSA placement WA display tests Chaitanya Kumar Borah
@ 2026-11-30 4:32 ` Chaitanya Kumar Borah
2026-11-30 4:32 ` [PATCH 06/14] drm/i915/audio: Program Hblank Early for the MSA WA shift left Chaitanya Kumar Borah
` (10 subsequent siblings)
15 siblings, 0 replies; 21+ messages in thread
From: Chaitanya Kumar Borah @ 2026-11-30 4:32 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: Chaitanya Kumar Borah
Besides applying the Audio WA for 4k DSC usecases, the function always
enables the Hblank Early indication for DP on display version 11 and
later, and it will also program the Hblank Early for the MSA placement
WA. Rename it to enable_audio_hblank_early() to reflect this.
No functional changes.
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
drivers/gpu/drm/i915/display/intel_audio.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
index 32f8c5e55319..e656f7cfd49e 100644
--- a/drivers/gpu/drm/i915/display/intel_audio.c
+++ b/drivers/gpu/drm/i915/display/intel_audio.c
@@ -506,8 +506,8 @@ static unsigned int calc_samples_room(const struct intel_crtc_state *crtc_state)
(pixel_clk * (48 / lanes + 2));
}
-static void enable_audio_dsc_wa(struct intel_encoder *encoder,
- const struct intel_crtc_state *crtc_state)
+static void enable_audio_hblank_early(struct intel_encoder *encoder,
+ const struct intel_crtc_state *crtc_state)
{
struct intel_display *display = to_intel_display(encoder);
enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
@@ -561,9 +561,9 @@ static void hsw_audio_codec_enable(struct intel_encoder *encoder,
mutex_lock(&display->audio.mutex);
- /* Enable Audio WA for 4k DSC usecases */
+ /* Hblank Early programming, including the Audio WA for 4k DSC */
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP))
- enable_audio_dsc_wa(encoder, crtc_state);
+ enable_audio_hblank_early(encoder, crtc_state);
intel_audio_sdp_split_update(crtc_state, true);
--
2.50.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 06/14] drm/i915/audio: Program Hblank Early for the MSA WA shift left
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
` (4 preceding siblings ...)
2026-11-30 4:32 ` [PATCH 05/14] drm/i915/audio: Rename enable_audio_dsc_wa() Chaitanya Kumar Borah
@ 2026-11-30 4:32 ` Chaitanya Kumar Borah
2026-11-30 5:14 ` sashiko-bot
2026-11-30 4:32 ` [PATCH 07/14] drm/i915/dp: Move intel_dp_has_audio() and intel_dp_port_has_audio() up Chaitanya Kumar Borah
` (9 subsequent siblings)
15 siblings, 1 reply; 21+ messages in thread
From: Chaitanya Kumar Borah @ 2026-11-30 4:32 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: Chaitanya Kumar Borah
When the MSA placement WA shifts the data end of line left, the Bspec
requires the Audio Hblank Early to be adjusted for a total of 512
pixels.
Add a helper to determine the need for the TRANS_CONF scaling, used
both by the enable and disable sequence, covering also the existing
Wa_1409098942 DSC case.
No functional change, since the MSA placement WA isn't enabled yet.
Bspec: 68922, 68943
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
drivers/gpu/drm/i915/display/intel_audio.c | 11 +++++++++++
drivers/gpu/drm/i915/display/intel_display.c | 20 ++++++++++++++------
2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
index e656f7cfd49e..6bde28d2627b 100644
--- a/drivers/gpu/drm/i915/display/intel_audio.c
+++ b/drivers/gpu/drm/i915/display/intel_audio.c
@@ -548,6 +548,17 @@ static void enable_audio_hblank_early(struct intel_encoder *encoder,
val |= NUMBER_SAMPLES_PER_LINE(cpu_transcoder, 0x0);
}
+ /*
+ * Wa_14027342164: With the MSA placement WA shifting the data end of
+ * line left, the Hblank Early must be 128 pixels, scaled by 4 via
+ * TRANS_CONF for a total of 512 pixels. With DSC this overrides only
+ * the Hblank Early start count computed above.
+ */
+ if (crtc_state->dp_m_n.msa_wa_shift_left) {
+ val &= ~HBLANK_START_COUNT_MASK(cpu_transcoder);
+ val |= HBLANK_START_COUNT(cpu_transcoder, HBLANK_START_COUNT_128);
+ }
+
intel_de_write(display, AUD_CONFIG_BE, val);
}
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 19caae633d29..9889fc869543 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -465,6 +465,18 @@ static void assert_planes_disabled(struct intel_crtc *crtc)
assert_plane_disabled(plane);
}
+static bool needs_audio_hblank_early_scaling(const struct intel_crtc_state *crtc_state)
+{
+ struct intel_display *display = to_intel_display(crtc_state);
+
+ /* Wa_1409098942:adlp+ */
+ if (DISPLAY_VER(display) >= 13 && crtc_state->dsc.compression_enable)
+ return true;
+
+ /* Wa_14027342164: x4 scaled Audio Hblank Early for the MSA WA shift left */
+ return crtc_state->dp_m_n.msa_wa_shift_left;
+}
+
void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state)
{
struct intel_display *display = to_intel_display(new_crtc_state);
@@ -521,9 +533,7 @@ void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state)
return;
}
- /* Wa_1409098942:adlp+ */
- if (DISPLAY_VER(display) >= 13 &&
- new_crtc_state->dsc.compression_enable) {
+ if (needs_audio_hblank_early_scaling(new_crtc_state)) {
val &= ~TRANSCONF_PIXEL_COUNT_SCALING_MASK;
val |= REG_FIELD_PREP(TRANSCONF_PIXEL_COUNT_SCALING_MASK,
TRANSCONF_PIXEL_COUNT_SCALING_X4);
@@ -575,9 +585,7 @@ void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state)
if (!display->platform.i830)
val &= ~TRANSCONF_ENABLE;
- /* Wa_1409098942:adlp+ */
- if (DISPLAY_VER(display) >= 13 &&
- old_crtc_state->dsc.compression_enable)
+ if (needs_audio_hblank_early_scaling(old_crtc_state))
val &= ~TRANSCONF_PIXEL_COUNT_SCALING_MASK;
intel_de_write(display, TRANSCONF(display, cpu_transcoder), val);
--
2.50.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH 06/14] drm/i915/audio: Program Hblank Early for the MSA WA shift left
2026-11-30 4:32 ` [PATCH 06/14] drm/i915/audio: Program Hblank Early for the MSA WA shift left Chaitanya Kumar Borah
@ 2026-11-30 5:14 ` sashiko-bot
0 siblings, 0 replies; 21+ messages in thread
From: sashiko-bot @ 2026-11-30 5:14 UTC (permalink / raw)
To: Chaitanya Kumar Borah, intel-xe, intel-gfx
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/i915/audio: stale HBLANK_START_COUNT_128 in
enable_audio_hblank_early()
--
commit 4f5298bec906485b8c1e0e09b9207132a3a80375
Author: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
drm/i915/audio: Program Hblank Early for the MSA WA shift left
This commit programs the audio Hblank Early start count to 128 pixels with
4x pixel count scaling in TRANS_CONF when the MSA placement workaround
shifts the data end of line left.
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
> index e656f7cfd49e6..6bde28d2627b4 100644
> --- a/drivers/gpu/drm/i915/display/intel_audio.c
> +++ b/drivers/gpu/drm/i915/display/intel_audio.c
> @@ -548,6 +548,17 @@ static void enable_audio_hblank_early(struct intel_encoder *encoder,
> val |= NUMBER_SAMPLES_PER_LINE(cpu_transcoder, 0x0);
> }
>
> + /*
> + * Wa_14027342164: With the MSA placement WA shifting the data end of
> + * line left, the Hblank Early must be 128 pixels, scaled by 4 via
> + * TRANS_CONF for a total of 512 pixels. With DSC this overrides only
> + * the Hblank Early start count computed above.
> + */
> + if (crtc_state->dp_m_n.msa_wa_shift_left) {
> + val &= ~HBLANK_START_COUNT_MASK(cpu_transcoder);
> + val |= HBLANK_START_COUNT(cpu_transcoder, HBLANK_START_COUNT_128);
> + }
> +
> intel_de_write(display, AUD_CONFIG_BE, val);
> }
[Severity: Medium]
Does this leave HBLANK_START_COUNT_128 programmed in AUD_CONFIG_BE on later
modesets where msa_wa_shift_left is false?
enable_audio_hblank_early() performs a read-modify-write on AUD_CONFIG_BE
and only clears HBLANK_START_COUNT_MASK(cpu_transcoder) when
msa_wa_shift_left is true or on 4K+ DSC modes, and
hsw_audio_codec_disable() does not clear it either. Unlike
TRANSCONF_PIXEL_COUNT_SCALING_MASK, which intel_disable_transcoder() clears
on disable, a subsequent modeset on the same transcoder with
msa_wa_shift_left == false and without 4K+ DSC will retain the stale
128-pixel start count (and on DISPLAY_VER >= 13 sub-4K DSC modes,
needs_audio_hblank_early_scaling() still enables 4x scaling, keeping the
full 512-pixel Hblank Early count active).
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261130043253.2165877-1-chaitanya.kumar.borah@intel.com?part=6
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 07/14] drm/i915/dp: Move intel_dp_has_audio() and intel_dp_port_has_audio() up
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
` (5 preceding siblings ...)
2026-11-30 4:32 ` [PATCH 06/14] drm/i915/audio: Program Hblank Early for the MSA WA shift left Chaitanya Kumar Borah
@ 2026-11-30 4:32 ` Chaitanya Kumar Borah
2026-11-30 4:32 ` [PATCH 08/14] drm/i915/dp: Account for the MSA WA in SST link config selection Chaitanya Kumar Borah
` (8 subsequent siblings)
15 siblings, 0 replies; 21+ messages in thread
From: Chaitanya Kumar Borah @ 2026-11-30 4:32 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: Chaitanya Kumar Borah
Move intel_dp_has_audio() and intel_dp_port_has_audio() before the MSA
placement WA helpers, so that the follow-up changes can use them while
selecting the link configuration and validating modes.
No functional changes.
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 56 ++++++++++++-------------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 396518ea8d66..4d871343b902 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1357,6 +1357,34 @@ void intel_dp_check_m_n_ratio(const struct intel_crtc_state *crtc_state,
m_n_ratio, max_m_n_ratio);
}
+static bool intel_dp_port_has_audio(struct intel_display *display, enum port port)
+{
+ if (display->platform.g4x)
+ return false;
+ if (DISPLAY_VER(display) < 12 && port == PORT_A)
+ return false;
+
+ return true;
+}
+
+static bool intel_dp_has_audio(struct intel_encoder *encoder,
+ const struct drm_connector_state *conn_state)
+{
+ struct intel_display *display = to_intel_display(encoder);
+ const struct intel_digital_connector_state *intel_conn_state =
+ to_intel_digital_connector_state(conn_state);
+ struct intel_connector *connector =
+ to_intel_connector(conn_state->connector);
+
+ if (!intel_dp_port_has_audio(display, encoder->port))
+ return false;
+
+ if (intel_conn_state->force_audio == HDMI_AUDIO_AUTO)
+ return connector->base.display_info.has_audio;
+ else
+ return intel_conn_state->force_audio == HDMI_AUDIO_ON;
+}
+
/*
* Wa_14027342164: MSA placement Data M/N workaround
*
@@ -3610,16 +3638,6 @@ bool intel_dp_limited_color_range(const struct intel_crtc_state *crtc_state,
}
}
-static bool intel_dp_port_has_audio(struct intel_display *display, enum port port)
-{
- if (display->platform.g4x)
- return false;
- if (DISPLAY_VER(display) < 12 && port == PORT_A)
- return false;
-
- return true;
-}
-
static void intel_dp_compute_vsc_colorimetry(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state,
struct drm_dp_vsc_sdp *vsc)
@@ -3947,24 +3965,6 @@ intel_dp_drrs_compute_config(struct intel_connector *connector,
pipe_config->dp_m2_n2.data_m *= pipe_config->splitter.link_count;
}
-static bool intel_dp_has_audio(struct intel_encoder *encoder,
- const struct drm_connector_state *conn_state)
-{
- struct intel_display *display = to_intel_display(encoder);
- const struct intel_digital_connector_state *intel_conn_state =
- to_intel_digital_connector_state(conn_state);
- struct intel_connector *connector =
- to_intel_connector(conn_state->connector);
-
- if (!intel_dp_port_has_audio(display, encoder->port))
- return false;
-
- if (intel_conn_state->force_audio == HDMI_AUDIO_AUTO)
- return connector->base.display_info.has_audio;
- else
- return intel_conn_state->force_audio == HDMI_AUDIO_ON;
-}
-
static int
intel_dp_compute_output_format(struct intel_encoder *encoder,
struct intel_crtc_state *crtc_state,
--
2.50.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 08/14] drm/i915/dp: Account for the MSA WA in SST link config selection
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
` (6 preceding siblings ...)
2026-11-30 4:32 ` [PATCH 07/14] drm/i915/dp: Move intel_dp_has_audio() and intel_dp_port_has_audio() up Chaitanya Kumar Borah
@ 2026-11-30 4:32 ` Chaitanya Kumar Borah
2026-11-30 5:06 ` sashiko-bot
2026-11-30 4:32 ` [PATCH 09/14] drm/i915/dp: Prune uncompressed modes failing the MSA WA Chaitanya Kumar Borah
` (7 subsequent siblings)
15 siblings, 1 reply; 21+ messages in thread
From: Chaitanya Kumar Borah @ 2026-11-30 4:32 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: Chaitanya Kumar Borah
Shifting the data end of line left for the MSA placement WA raises the
Data M/N, which may exceed 1.0 for a link configuration that has
otherwise enough bandwidth for the mode. Skip such link configurations
while selecting the link configuration, for both the uncompressed and
compressed cases.
The WA also fails if a shift left is needed with an H. Active too small
for the Audio Hblank Early programming. That doesn't depend on the link
configuration, so no link configuration passes then.
Add a helper determining whether the WA applies, returning false for now,
the WA being enabled by a follow-up change.
No functional changes.
Bspec: 68922
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 44 ++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 4d871343b902..4d286fef7748 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1828,6 +1828,36 @@ int intel_dp_msa_wa_compute_m_n(const struct intel_crtc_state *crtc_state,
crtc_state->fec_enable, m_n);
}
+/*
+ * The MSA placement WA applies only to 8b/10b SST streams. Callers must check
+ * separately that the stream has audio.
+ */
+static bool intel_dp_msa_wa_needed(struct intel_dp *intel_dp, bool is_mst,
+ int link_rate)
+{
+ /* Wa_14027342164: Enabled by a follow-up change. */
+ return false;
+}
+
+static bool intel_dp_msa_wa_link_config_valid(struct intel_dp *intel_dp,
+ const struct intel_crtc_state *crtc_state,
+ const struct drm_connector_state *conn_state,
+ int link_rate, int lane_count,
+ int link_bpp_x16, bool dsc)
+{
+ struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
+ struct intel_link_m_n m_n = {};
+
+ if (!intel_dp_msa_wa_needed(intel_dp,
+ intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST),
+ link_rate) ||
+ !intel_dp_has_audio(encoder, conn_state))
+ return true;
+
+ return intel_dp_msa_wa_compute_m_n(crtc_state, link_rate, lane_count,
+ link_bpp_x16, dsc, &m_n) == 0;
+}
+
static int intel_dp_mso_pixel_clock(struct intel_dp *intel_dp, int pixel_clock)
{
if (!intel_dp->mso_link_count)
@@ -2332,7 +2362,12 @@ intel_dp_compute_link_config_wide(struct intel_dp *intel_dp,
link_config.rate,
link_config.lane_count);
- if (mode_rate <= link_avail) {
+ if (mode_rate <= link_avail &&
+ intel_dp_msa_wa_link_config_valid(intel_dp, pipe_config,
+ conn_state,
+ link_config.rate,
+ link_config.lane_count,
+ link_bpp_x16, false)) {
pipe_config->lane_count = link_config.lane_count;
pipe_config->pipe_bpp = bpp;
pipe_config->port_clock = link_config.rate;
@@ -2590,6 +2625,13 @@ static int dsc_compute_link_config(struct intel_dp *intel_dp,
dsc_bpp_x16,
bw_overhead_flags))
continue;
+
+ if (!intel_dp_msa_wa_link_config_valid(intel_dp, pipe_config,
+ conn_state,
+ link_config.rate,
+ link_config.lane_count,
+ dsc_bpp_x16, true))
+ continue;
}
err = 0;
--
2.50.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH 08/14] drm/i915/dp: Account for the MSA WA in SST link config selection
2026-11-30 4:32 ` [PATCH 08/14] drm/i915/dp: Account for the MSA WA in SST link config selection Chaitanya Kumar Borah
@ 2026-11-30 5:06 ` sashiko-bot
0 siblings, 0 replies; 21+ messages in thread
From: sashiko-bot @ 2026-11-30 5:06 UTC (permalink / raw)
To: Chaitanya Kumar Borah, intel-xe, intel-gfx
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/i915/dp: unpopulated dsc.slice_config in
dsc_compute_link_config()
--
commit 176a3332a1936ecf21e99d8e8823baf30a8ec05e
Author: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
drm/i915/dp: Account for the MSA WA in SST link config selection
This commit skips SST link configurations where the MSA placement
workaround causes Data M/N to exceed 1.0, for both uncompressed and DSC
link configuration selection.
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 4d871343b902f..4d286fef7748e 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
[ ... ]
> @@ -2590,6 +2625,13 @@ static int dsc_compute_link_config(struct intel_dp *intel_dp,
> dsc_bpp_x16,
> bw_overhead_flags))
> continue;
> +
> + if (!intel_dp_msa_wa_link_config_valid(intel_dp, pipe_config,
> + conn_state,
> + link_config.rate,
> + link_config.lane_count,
> + dsc_bpp_x16, true))
> + continue;
> }
>
> err = 0;
[Severity: High]
Is pipe_config->dsc.slice_config populated when dsc_compute_link_config()
calls intel_dp_msa_wa_link_config_valid()?
intel_dp_dsc_compute_config() runs intel_dp_dsc_compute_pipe_bpp() ->
dsc_compute_compressed_bpp() -> dsc_compute_link_config() before calling
intel_dp_dsc_get_slice_config() to fill pipe_config->dsc.slice_config:
drivers/gpu/drm/i915/display/intel_dp.c:intel_dp_dsc_compute_config() {
...
if (!is_mst) {
ret = intel_dp_dsc_compute_pipe_bpp(intel_dp, pipe_config,
conn_state, limits);
if (ret) {
drm_dbg_kms(display->drm,
"No Valid pipe bpp for given mode ret = %d\n", ret);
return ret;
}
}
if (!intel_dp_dsc_get_slice_config(connector, adjusted_mode->crtc_clock,
adjusted_mode->crtc_hdisplay, num_joined_pipes,
&pipe_config->dsc.slice_config))
return -EINVAL;
...
}
Because pipe_config->dsc.slice_config is still zeroed here,
intel_dp_msa_wa_compute_m_n() computes dsc_slice_count == 0 and
intel_dp_msa_wa_active_bits() takes the uncompressed (!dsc_slice_count)
branch, omitting DSC symbol cycle padding and MSA_WA_DSC_OVRHD_BITS.
dsc_compute_link_config() can then accept a compressed bpp or link
configuration whose actual DSC Data M/N exceeds 1.0 once slice_config is
populated.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261130043253.2165877-1-chaitanya.kumar.borah@intel.com?part=8
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 09/14] drm/i915/dp: Prune uncompressed modes failing the MSA WA
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
` (7 preceding siblings ...)
2026-11-30 4:32 ` [PATCH 08/14] drm/i915/dp: Account for the MSA WA in SST link config selection Chaitanya Kumar Borah
@ 2026-11-30 4:32 ` Chaitanya Kumar Borah
2026-11-30 4:32 ` [PATCH 10/14] drm/i915/dp: Move intel_dp_mode_valid_format() and intel_dp_mode_valid() down Chaitanya Kumar Borah
` (6 subsequent siblings)
15 siblings, 0 replies; 21+ messages in thread
From: Chaitanya Kumar Borah @ 2026-11-30 4:32 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: Chaitanya Kumar Borah
Prune the uncompressed modes for which the MSA placement WA would fail
with the maximum link configuration, by raising the Data M/N above 1.0
or by needing more H. Active than the mode has for the Audio Hblank
Early.
Similarly to the link configuration selection, consider the mode
supported if the WA passes with any pipe bpp fitting the link
configuration. The WA result isn't monotonic in the bpp, as positioning
the end of line within the last TU depends on it, so the minimum bpp
failing the WA doesn't imply the same for a higher bpp.
Without an atomic state use the sink's audio capability to determine
whether the WA applies. The check doesn't depend on the number of joined
pipes, so do it only once, before iterating over the joiner candidates.
No functional changes, since the MSA placement WA isn't enabled yet.
Bspec: 68922
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 72 +++++++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 4d286fef7748..78b0ff0ae182 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1858,6 +1858,64 @@ static bool intel_dp_msa_wa_link_config_valid(struct intel_dp *intel_dp,
link_bpp_x16, dsc, &m_n) == 0;
}
+/* Without an atomic state use the sink's audio capability */
+static bool intel_dp_msa_wa_mode_needed(struct intel_dp *intel_dp,
+ const struct intel_connector *connector,
+ int link_rate)
+{
+ struct intel_display *display = to_intel_display(intel_dp);
+ struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
+
+ return intel_dp_msa_wa_needed(intel_dp, false, link_rate) &&
+ intel_dp_port_has_audio(display, encoder->port) &&
+ connector->base.display_info.has_audio;
+}
+
+static bool intel_dp_msa_wa_mode_config_valid(const struct drm_display_mode *mode,
+ int clock, int link_rate, int lane_count,
+ int link_bpp_x16, int dsc_slice_count)
+{
+ struct intel_link_m_n m_n = {};
+ int active_bits = intel_dp_msa_wa_active_bits(mode->hdisplay, link_bpp_x16,
+ lane_count, dsc_slice_count);
+
+ /* With DSC FEC is always enabled on 8b/10b */
+ return __intel_dp_msa_wa_compute_m_n(mode->hdisplay, mode->htotal, clock,
+ link_rate, lane_count, active_bits,
+ !!dsc_slice_count, &m_n) == 0;
+}
+
+/*
+ * Similarly to the link configuration selection, the uncompressed mode is
+ * valid if the WA passes with any pipe bpp fitting the link configuration.
+ */
+static bool intel_dp_msa_wa_mode_valid_uncompressed(struct intel_dp *intel_dp,
+ const struct intel_connector *connector,
+ const struct drm_display_mode *mode,
+ enum intel_output_format output_format,
+ int clock, int link_rate, int lane_count,
+ int max_rate)
+{
+ struct intel_display *display = to_intel_display(intel_dp);
+ int sink_bpc = connector->base.display_info.bpc ? : 8;
+ int max_bpp = min(intel_display_max_pipe_bpp(display), sink_bpc * 3);
+ int bpp;
+
+ for (bpp = intel_dp_min_bpp(output_format); bpp <= max_bpp; bpp += 2 * 3) {
+ int link_bpp_x16 = intel_dp_output_format_link_bpp_x16(output_format, bpp);
+
+ if (intel_dp_link_required(link_rate, lane_count, clock, mode->hdisplay,
+ link_bpp_x16, 0) > max_rate)
+ break;
+
+ if (intel_dp_msa_wa_mode_config_valid(mode, clock, link_rate, lane_count,
+ link_bpp_x16, 0))
+ return true;
+ }
+
+ return false;
+}
+
static int intel_dp_mso_pixel_clock(struct intel_dp *intel_dp, int pixel_clock)
{
if (!intel_dp->mso_link_count)
@@ -1941,6 +1999,8 @@ intel_dp_mode_valid_format(struct intel_connector *connector,
struct intel_dp_link_config max_bw_config;
u16 dsc_max_compressed_bpp = 0;
enum drm_mode_status status;
+ bool msa_wa_uncompressed_valid;
+ bool msa_wa_needed;
bool dsc = false;
int num_joined_pipes;
int link_bpp_x16;
@@ -1963,6 +2023,13 @@ intel_dp_mode_valid_format(struct intel_connector *connector,
target_clock, mode->hdisplay,
link_bpp_x16, 0);
+ msa_wa_needed = intel_dp_msa_wa_mode_needed(intel_dp, connector, max_link_clock);
+ msa_wa_uncompressed_valid = !msa_wa_needed ||
+ intel_dp_msa_wa_mode_valid_uncompressed(intel_dp, connector, mode,
+ output_format, target_clock,
+ max_link_clock, max_lanes,
+ max_rate);
+
/*
* We cannot determine the required pipe‑join count before knowing whether
* DSC is needed, nor can we determine DSC need without knowing the pipe
@@ -2026,6 +2093,11 @@ intel_dp_mode_valid_format(struct intel_connector *connector,
continue;
}
+ if (!dsc && !msa_wa_uncompressed_valid) {
+ status = MODE_CLOCK_HIGH;
+ continue;
+ }
+
status = intel_mode_valid_max_plane_size(display, mode, num_joined_pipes);
if (status != MODE_OK)
continue;
--
2.50.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 10/14] drm/i915/dp: Move intel_dp_mode_valid_format() and intel_dp_mode_valid() down
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
` (8 preceding siblings ...)
2026-11-30 4:32 ` [PATCH 09/14] drm/i915/dp: Prune uncompressed modes failing the MSA WA Chaitanya Kumar Borah
@ 2026-11-30 4:32 ` Chaitanya Kumar Borah
2026-11-30 4:32 ` [PATCH 11/14] drm/i915/dp: Account for the MSA WA in DSC mode validation Chaitanya Kumar Borah
` (5 subsequent siblings)
15 siblings, 0 replies; 21+ messages in thread
From: Chaitanya Kumar Borah @ 2026-11-30 4:32 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: Chaitanya Kumar Borah
Move intel_dp_mode_valid_format() and intel_dp_mode_valid() after the
DSC compressed bpp helpers, so that a follow-up change can validate the
MSA placement WA for DSC modes using these helpers, without a forward
declaration.
No functional changes.
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 398 ++++++++++++------------
1 file changed, 199 insertions(+), 199 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 78b0ff0ae182..0ba9f759f756 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1986,205 +1986,6 @@ static bool intel_dp_mode_valid_m_n(struct intel_dp *intel_dp, int pixel_clock)
return found;
}
-static enum drm_mode_status
-intel_dp_mode_valid_format(struct intel_connector *connector,
- const struct drm_display_mode *mode,
- int target_clock,
- enum intel_output_format sink_format)
-{
- struct intel_display *display = to_intel_display(connector);
- struct intel_dp *intel_dp = intel_attached_dp(connector);
- enum intel_output_format output_format;
- int max_rate, mode_rate, max_lanes, max_link_clock;
- struct intel_dp_link_config max_bw_config;
- u16 dsc_max_compressed_bpp = 0;
- enum drm_mode_status status;
- bool msa_wa_uncompressed_valid;
- bool msa_wa_needed;
- bool dsc = false;
- int num_joined_pipes;
- int link_bpp_x16;
-
- status = intel_dp_sink_format_valid(connector, mode, sink_format);
- if (status != MODE_OK)
- return status;
-
- output_format = intel_dp_output_format(connector, sink_format);
-
- intel_dp_link_caps_get_max_bw_config(intel_dp->link.caps, &max_bw_config);
- max_link_clock = max_bw_config.rate;
- max_lanes = max_bw_config.lane_count;
-
- max_rate = intel_dp_max_link_data_rate(intel_dp, max_link_clock, max_lanes);
-
- link_bpp_x16 = intel_dp_mode_min_link_bpp_x16(connector, mode,
- output_format);
- mode_rate = intel_dp_link_required(max_link_clock, max_lanes,
- target_clock, mode->hdisplay,
- link_bpp_x16, 0);
-
- msa_wa_needed = intel_dp_msa_wa_mode_needed(intel_dp, connector, max_link_clock);
- msa_wa_uncompressed_valid = !msa_wa_needed ||
- intel_dp_msa_wa_mode_valid_uncompressed(intel_dp, connector, mode,
- output_format, target_clock,
- max_link_clock, max_lanes,
- max_rate);
-
- /*
- * We cannot determine the required pipe‑join count before knowing whether
- * DSC is needed, nor can we determine DSC need without knowing the pipe
- * count.
- * Because of this dependency cycle, the only correct approach is to iterate
- * over candidate pipe counts and evaluate each combination.
- */
- status = MODE_CLOCK_HIGH;
- for_each_joiner_candidate(connector, mode, num_joined_pipes) {
- int dsc_slice_count = 0;
-
- status = intel_pfit_mode_valid(display, mode, output_format, num_joined_pipes);
- if (status != MODE_OK)
- continue;
-
- if (intel_dp_has_dsc(connector)) {
- int pipe_bpp;
-
- dsc_slice_count = intel_dp_dsc_get_slice_count(connector,
- target_clock,
- mode->hdisplay,
- num_joined_pipes);
-
- /*
- * TBD pass the connector BPC,
- * for now U8_MAX so that max BPC on that platform would be picked
- */
- pipe_bpp = intel_dp_dsc_compute_max_bpp(connector, U8_MAX);
-
- /*
- * Output bpp is stored in 6.4 format so right shift by 4 to get the
- * integer value since we support only integer values of bpp.
- */
- if (intel_dp_is_edp(intel_dp)) {
- dsc_max_compressed_bpp =
- drm_edp_dsc_sink_output_bpp(connector->dp.dsc_dpcd) >> 4;
-
- dsc = dsc_max_compressed_bpp && dsc_slice_count;
- } else if (drm_dp_sink_supports_fec(connector->dp.fec_capability)) {
- unsigned long bw_overhead_flags = 0;
-
- if (!drm_dp_is_uhbr_rate(max_link_clock))
- bw_overhead_flags |= DRM_DP_BW_OVERHEAD_FEC;
-
- dsc = intel_dp_mode_valid_with_dsc(connector,
- max_link_clock, max_lanes,
- target_clock, mode->hdisplay,
- num_joined_pipes,
- output_format, pipe_bpp,
- bw_overhead_flags);
- }
- }
-
- if (intel_dp_joiner_needs_dsc(display, num_joined_pipes) && !dsc) {
- status = MODE_CLOCK_HIGH;
- continue;
- }
-
- if (mode_rate > max_rate && !dsc) {
- status = MODE_CLOCK_HIGH;
- continue;
- }
-
- if (!dsc && !msa_wa_uncompressed_valid) {
- status = MODE_CLOCK_HIGH;
- continue;
- }
-
- status = intel_mode_valid_max_plane_size(display, mode, num_joined_pipes);
- if (status != MODE_OK)
- continue;
-
- if (!dsc)
- dsc_slice_count = 0;
-
- if (!intel_dp_dotclk_valid(display,
- target_clock,
- mode->htotal,
- dsc_slice_count,
- num_joined_pipes)) {
- status = MODE_CLOCK_HIGH;
- continue;
- }
-
- break;
- }
-
- if (status != MODE_OK)
- return status;
-
- return intel_dp_mode_valid_downstream(connector, mode,
- target_clock, sink_format);
-}
-
-static enum drm_mode_status
-intel_dp_mode_valid(struct drm_connector *_connector,
- const struct drm_display_mode *mode)
-{
- struct intel_display *display = to_intel_display(_connector->dev);
- struct intel_connector *connector = to_intel_connector(_connector);
- const struct drm_display_info *info = &connector->base.display_info;
- struct intel_dp *intel_dp = intel_attached_dp(connector);
- int target_clock = mode->clock;
- enum drm_mode_status status;
-
- status = intel_cpu_transcoder_mode_valid(display, mode);
- if (status != MODE_OK)
- return status;
-
- if (mode->flags & DRM_MODE_FLAG_DBLCLK)
- return MODE_H_ILLEGAL;
-
- if (mode->clock < 10000)
- return MODE_CLOCK_LOW;
-
- if (intel_dp_hdisplay_bad(display, mode->hdisplay))
- return MODE_H_ILLEGAL;
-
- if (intel_dp_is_edp(intel_dp)) {
- status = intel_panel_mode_valid(connector, mode, &target_clock);
- if (status != MODE_OK)
- return status;
- }
-
- if (!intel_dp_mode_valid_m_n(intel_dp, target_clock))
- return MODE_CLOCK_HIGH;
-
- /*
- * TODO: Even when using a 4:2:0 sink_format intel_dp_output_format()
- * will always choose a 4:4:4 output_format if the DFP can do the
- * 4:4:4->4:2:0 conversion for us. Thus a mode may still be rejected
- * if we only have enough DP link bandwidth for 4:2:0 but not for
- * 4:4:4. Another attempt with an explicit 4:2:0 output_format might
- * be needed here. intel_dp_compute_config() would need the same
- * logic, or else the actual modeset would still fail.
- *
- * Also a lot of the checks only depend on output_format but not
- * sink_format, so we are potentially doing redundant work by
- * testing the same output_format for two different sink_formats.
- */
- if (drm_mode_is_420_only(info, mode)) {
- status = intel_dp_mode_valid_format(connector, mode, target_clock,
- INTEL_OUTPUT_FORMAT_YCBCR420);
- } else {
- status = intel_dp_mode_valid_format(connector, mode, target_clock,
- INTEL_OUTPUT_FORMAT_RGB);
-
- if (status != MODE_OK && drm_mode_is_420_also(info, mode))
- status = intel_dp_mode_valid_format(connector, mode, target_clock,
- INTEL_OUTPUT_FORMAT_YCBCR420);
- }
-
- return status;
-}
-
bool intel_dp_source_supports_tps3(struct intel_display *display)
{
return DISPLAY_VER(display) >= 9 ||
@@ -3257,6 +3058,205 @@ bool intel_dp_mode_valid_with_dsc(struct intel_connector *connector,
bw_overhead_flags);
}
+static enum drm_mode_status
+intel_dp_mode_valid_format(struct intel_connector *connector,
+ const struct drm_display_mode *mode,
+ int target_clock,
+ enum intel_output_format sink_format)
+{
+ struct intel_display *display = to_intel_display(connector);
+ struct intel_dp *intel_dp = intel_attached_dp(connector);
+ enum intel_output_format output_format;
+ int max_rate, mode_rate, max_lanes, max_link_clock;
+ struct intel_dp_link_config max_bw_config;
+ u16 dsc_max_compressed_bpp = 0;
+ enum drm_mode_status status;
+ bool msa_wa_uncompressed_valid;
+ bool msa_wa_needed;
+ bool dsc = false;
+ int num_joined_pipes;
+ int link_bpp_x16;
+
+ status = intel_dp_sink_format_valid(connector, mode, sink_format);
+ if (status != MODE_OK)
+ return status;
+
+ output_format = intel_dp_output_format(connector, sink_format);
+
+ intel_dp_link_caps_get_max_bw_config(intel_dp->link.caps, &max_bw_config);
+ max_link_clock = max_bw_config.rate;
+ max_lanes = max_bw_config.lane_count;
+
+ max_rate = intel_dp_max_link_data_rate(intel_dp, max_link_clock, max_lanes);
+
+ link_bpp_x16 = intel_dp_mode_min_link_bpp_x16(connector, mode,
+ output_format);
+ mode_rate = intel_dp_link_required(max_link_clock, max_lanes,
+ target_clock, mode->hdisplay,
+ link_bpp_x16, 0);
+
+ msa_wa_needed = intel_dp_msa_wa_mode_needed(intel_dp, connector, max_link_clock);
+ msa_wa_uncompressed_valid = !msa_wa_needed ||
+ intel_dp_msa_wa_mode_valid_uncompressed(intel_dp, connector, mode,
+ output_format, target_clock,
+ max_link_clock, max_lanes,
+ max_rate);
+
+ /*
+ * We cannot determine the required pipe‑join count before knowing whether
+ * DSC is needed, nor can we determine DSC need without knowing the pipe
+ * count.
+ * Because of this dependency cycle, the only correct approach is to iterate
+ * over candidate pipe counts and evaluate each combination.
+ */
+ status = MODE_CLOCK_HIGH;
+ for_each_joiner_candidate(connector, mode, num_joined_pipes) {
+ int dsc_slice_count = 0;
+
+ status = intel_pfit_mode_valid(display, mode, output_format, num_joined_pipes);
+ if (status != MODE_OK)
+ continue;
+
+ if (intel_dp_has_dsc(connector)) {
+ int pipe_bpp;
+
+ dsc_slice_count = intel_dp_dsc_get_slice_count(connector,
+ target_clock,
+ mode->hdisplay,
+ num_joined_pipes);
+
+ /*
+ * TBD pass the connector BPC,
+ * for now U8_MAX so that max BPC on that platform would be picked
+ */
+ pipe_bpp = intel_dp_dsc_compute_max_bpp(connector, U8_MAX);
+
+ /*
+ * Output bpp is stored in 6.4 format so right shift by 4 to get the
+ * integer value since we support only integer values of bpp.
+ */
+ if (intel_dp_is_edp(intel_dp)) {
+ dsc_max_compressed_bpp =
+ drm_edp_dsc_sink_output_bpp(connector->dp.dsc_dpcd) >> 4;
+
+ dsc = dsc_max_compressed_bpp && dsc_slice_count;
+ } else if (drm_dp_sink_supports_fec(connector->dp.fec_capability)) {
+ unsigned long bw_overhead_flags = 0;
+
+ if (!drm_dp_is_uhbr_rate(max_link_clock))
+ bw_overhead_flags |= DRM_DP_BW_OVERHEAD_FEC;
+
+ dsc = intel_dp_mode_valid_with_dsc(connector,
+ max_link_clock, max_lanes,
+ target_clock, mode->hdisplay,
+ num_joined_pipes,
+ output_format, pipe_bpp,
+ bw_overhead_flags);
+ }
+ }
+
+ if (intel_dp_joiner_needs_dsc(display, num_joined_pipes) && !dsc) {
+ status = MODE_CLOCK_HIGH;
+ continue;
+ }
+
+ if (mode_rate > max_rate && !dsc) {
+ status = MODE_CLOCK_HIGH;
+ continue;
+ }
+
+ if (!dsc && !msa_wa_uncompressed_valid) {
+ status = MODE_CLOCK_HIGH;
+ continue;
+ }
+
+ status = intel_mode_valid_max_plane_size(display, mode, num_joined_pipes);
+ if (status != MODE_OK)
+ continue;
+
+ if (!dsc)
+ dsc_slice_count = 0;
+
+ if (!intel_dp_dotclk_valid(display,
+ target_clock,
+ mode->htotal,
+ dsc_slice_count,
+ num_joined_pipes)) {
+ status = MODE_CLOCK_HIGH;
+ continue;
+ }
+
+ break;
+ }
+
+ if (status != MODE_OK)
+ return status;
+
+ return intel_dp_mode_valid_downstream(connector, mode,
+ target_clock, sink_format);
+}
+
+static enum drm_mode_status
+intel_dp_mode_valid(struct drm_connector *_connector,
+ const struct drm_display_mode *mode)
+{
+ struct intel_display *display = to_intel_display(_connector->dev);
+ struct intel_connector *connector = to_intel_connector(_connector);
+ const struct drm_display_info *info = &connector->base.display_info;
+ struct intel_dp *intel_dp = intel_attached_dp(connector);
+ int target_clock = mode->clock;
+ enum drm_mode_status status;
+
+ status = intel_cpu_transcoder_mode_valid(display, mode);
+ if (status != MODE_OK)
+ return status;
+
+ if (mode->flags & DRM_MODE_FLAG_DBLCLK)
+ return MODE_H_ILLEGAL;
+
+ if (mode->clock < 10000)
+ return MODE_CLOCK_LOW;
+
+ if (intel_dp_hdisplay_bad(display, mode->hdisplay))
+ return MODE_H_ILLEGAL;
+
+ if (intel_dp_is_edp(intel_dp)) {
+ status = intel_panel_mode_valid(connector, mode, &target_clock);
+ if (status != MODE_OK)
+ return status;
+ }
+
+ if (!intel_dp_mode_valid_m_n(intel_dp, target_clock))
+ return MODE_CLOCK_HIGH;
+
+ /*
+ * TODO: Even when using a 4:2:0 sink_format intel_dp_output_format()
+ * will always choose a 4:4:4 output_format if the DFP can do the
+ * 4:4:4->4:2:0 conversion for us. Thus a mode may still be rejected
+ * if we only have enough DP link bandwidth for 4:2:0 but not for
+ * 4:4:4. Another attempt with an explicit 4:2:0 output_format might
+ * be needed here. intel_dp_compute_config() would need the same
+ * logic, or else the actual modeset would still fail.
+ *
+ * Also a lot of the checks only depend on output_format but not
+ * sink_format, so we are potentially doing redundant work by
+ * testing the same output_format for two different sink_formats.
+ */
+ if (drm_mode_is_420_only(info, mode)) {
+ status = intel_dp_mode_valid_format(connector, mode, target_clock,
+ INTEL_OUTPUT_FORMAT_YCBCR420);
+ } else {
+ status = intel_dp_mode_valid_format(connector, mode, target_clock,
+ INTEL_OUTPUT_FORMAT_RGB);
+
+ if (status != MODE_OK && drm_mode_is_420_also(info, mode))
+ status = intel_dp_mode_valid_format(connector, mode, target_clock,
+ INTEL_OUTPUT_FORMAT_YCBCR420);
+ }
+
+ return status;
+}
+
bool
intel_dp_get_connector_max_link_config(struct intel_connector *connector,
const struct link_config_limits *limits,
--
2.50.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 11/14] drm/i915/dp: Account for the MSA WA in DSC mode validation
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
` (9 preceding siblings ...)
2026-11-30 4:32 ` [PATCH 10/14] drm/i915/dp: Move intel_dp_mode_valid_format() and intel_dp_mode_valid() down Chaitanya Kumar Borah
@ 2026-11-30 4:32 ` Chaitanya Kumar Borah
2026-11-30 4:32 ` [PATCH 12/14] drm/i915/dp: Apply the MSA WA to the Data M/N Chaitanya Kumar Borah
` (4 subsequent siblings)
15 siblings, 0 replies; 21+ messages in thread
From: Chaitanya Kumar Borah @ 2026-11-30 4:32 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: Chaitanya Kumar Borah
The MSA placement WA can also fail for a mode using DSC. If the WA fails
for all the compressed bpps fitting the maximum link configuration,
consider the mode as not supported with DSC.
Start the check with the minimum compressed bpp, which the compressed bpp
can be lowered to while computing the link configuration and which is
the most likely to pass, checking the higher bpps only if it fails. The
WA result isn't monotonic in the bpp, as positioning the end of line
within the last TU depends on it, so the minimum bpp failing the WA
doesn't imply the same for a higher bpp. This keeps the cost of the
validation at a single check in most cases.
No functional changes, since the MSA placement WA isn't enabled yet.
Bspec: 68922
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 51 +++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 0ba9f759f756..75ddfa30a3c3 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3058,6 +3058,49 @@ bool intel_dp_mode_valid_with_dsc(struct intel_connector *connector,
bw_overhead_flags);
}
+/*
+ * Check the MSA placement WA for a DSC mode. Start with the minimum compressed
+ * bpp, the most likely to pass as a lower bpp lowers the Data M/N, checking the
+ * higher bpps fitting the link configuration only if it fails.
+ */
+static bool intel_dp_msa_wa_mode_valid_with_dsc(struct intel_connector *connector,
+ const struct drm_display_mode *mode,
+ int link_clock, int lane_count,
+ int mode_clock, int num_joined_pipes,
+ enum intel_output_format output_format,
+ int pipe_bpp, int dsc_slice_count)
+{
+ struct intel_dp *intel_dp = intel_attached_dp(connector);
+ int min_bpp_x16 = intel_dp_compute_min_compressed_bpp_x16(connector,
+ output_format);
+ int max_bpp_x16 = compute_max_compressed_bpp_x16(connector,
+ mode_clock, mode->hdisplay,
+ num_joined_pipes,
+ output_format,
+ pipe_bpp, INT_MAX);
+ int step_x16 = intel_dp_dsc_bpp_step_x16(connector);
+ int bpp_x16;
+
+ for (bpp_x16 = min_bpp_x16; bpp_x16 <= max_bpp_x16; bpp_x16 += step_x16) {
+ if (!intel_dp_dsc_valid_compressed_bpp(intel_dp, bpp_x16))
+ continue;
+
+ /* The WA applies only to 8b/10b, always using FEC with DSC */
+ if (!is_bw_sufficient_for_dsc_config(intel_dp, link_clock, lane_count,
+ mode_clock, mode->hdisplay,
+ dsc_slice_count, bpp_x16,
+ DRM_DP_BW_OVERHEAD_FEC))
+ break;
+
+ if (intel_dp_msa_wa_mode_config_valid(mode, mode_clock, link_clock,
+ lane_count, bpp_x16,
+ dsc_slice_count))
+ return true;
+ }
+
+ return false;
+}
+
static enum drm_mode_status
intel_dp_mode_valid_format(struct intel_connector *connector,
const struct drm_display_mode *mode,
@@ -3153,6 +3196,14 @@ intel_dp_mode_valid_format(struct intel_connector *connector,
output_format, pipe_bpp,
bw_overhead_flags);
}
+
+ if (dsc && msa_wa_needed)
+ dsc = intel_dp_msa_wa_mode_valid_with_dsc(connector, mode,
+ max_link_clock, max_lanes,
+ target_clock,
+ num_joined_pipes,
+ output_format, pipe_bpp,
+ dsc_slice_count);
}
if (intel_dp_joiner_needs_dsc(display, num_joined_pipes) && !dsc) {
--
2.50.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 12/14] drm/i915/dp: Apply the MSA WA to the Data M/N
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
` (10 preceding siblings ...)
2026-11-30 4:32 ` [PATCH 11/14] drm/i915/dp: Account for the MSA WA in DSC mode validation Chaitanya Kumar Borah
@ 2026-11-30 4:32 ` Chaitanya Kumar Borah
2026-11-30 5:17 ` sashiko-bot
2026-11-30 4:32 ` [PATCH 13/14] drm/i915/display: Enable Wa_14027342164 on Xe3p Chaitanya Kumar Borah
` (3 subsequent siblings)
15 siblings, 1 reply; 21+ messages in thread
From: Chaitanya Kumar Borah @ 2026-11-30 4:32 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: Chaitanya Kumar Borah
Adjust the Data M/N for the MSA placement WA after computing the link
M/N values, tracking whether the end of line got shifted left, which
requires the Audio Hblank Early adjustment.
The link configuration selection skips the configurations failing the
WA, so it is expected to pass here. The WA also requires that the Audio
SDPs are not split, which is the case as SDP splitting is enabled only
for 128b/132b, not affected by the WA.
No functional changes, since the MSA placement WA isn't enabled yet.
Bspec: 68922
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 44 +++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 75ddfa30a3c3..0f7be0608644 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1858,6 +1858,46 @@ static bool intel_dp_msa_wa_link_config_valid(struct intel_dp *intel_dp,
link_bpp_x16, dsc, &m_n) == 0;
}
+static int intel_dp_msa_wa_compute_config(struct intel_dp *intel_dp,
+ struct intel_crtc_state *crtc_state,
+ int link_bpp_x16)
+{
+ struct intel_display *display = to_intel_display(intel_dp);
+ struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
+ struct intel_link_m_n *m_n = &crtc_state->dp_m_n;
+ u32 data_m = m_n->data_m, data_n = m_n->data_n;
+ int ret;
+
+ if (!intel_dp_msa_wa_needed(intel_dp,
+ intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST),
+ crtc_state->port_clock) ||
+ !crtc_state->has_audio)
+ return 0;
+
+ /*
+ * The WA requires the Audio SDPs not to be split, as the HW always
+ * finishes a split SDP right before transmitting the MSA. SDP
+ * splitting is enabled only with 128b/132b, which the WA doesn't
+ * apply to.
+ */
+ drm_WARN_ON(display->drm, crtc_state->sdp_split_enable);
+
+ ret = intel_dp_msa_wa_compute_m_n(crtc_state, crtc_state->port_clock,
+ crtc_state->lane_count, link_bpp_x16,
+ crtc_state->dsc.compression_enable, m_n);
+ /* The link configuration selection must have rejected such a config. */
+ if (drm_WARN_ON(display->drm, ret))
+ return ret;
+
+ drm_dbg_kms(display->drm,
+ "[ENCODER:%d:%s] MSA placement WA: Data M/N %u/%u -> %u/%u, end of line shifted %s\n",
+ encoder->base.base.id, encoder->base.name,
+ data_m, data_n, m_n->data_m, m_n->data_n,
+ m_n->msa_wa_shift_left ? "left" : "right");
+
+ return 0;
+}
+
/* Without an atomic state use the sink's audio capability */
static bool intel_dp_msa_wa_mode_needed(struct intel_dp *intel_dp,
const struct intel_connector *connector,
@@ -4428,6 +4468,10 @@ intel_dp_compute_config(struct intel_atomic_state *state,
&pipe_config->dp_m_n);
intel_dp_check_m_n_ratio(pipe_config, &pipe_config->dp_m_n);
+
+ ret = intel_dp_msa_wa_compute_config(intel_dp, pipe_config, link_bpp_x16);
+ if (ret)
+ return ret;
}
ret = intel_dp_compute_min_hblank(pipe_config, conn_state);
--
2.50.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH 12/14] drm/i915/dp: Apply the MSA WA to the Data M/N
2026-11-30 4:32 ` [PATCH 12/14] drm/i915/dp: Apply the MSA WA to the Data M/N Chaitanya Kumar Borah
@ 2026-11-30 5:17 ` sashiko-bot
0 siblings, 0 replies; 21+ messages in thread
From: sashiko-bot @ 2026-11-30 5:17 UTC (permalink / raw)
To: Chaitanya Kumar Borah, intel-xe, intel-gfx
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/i915/dp: unpopulated dsc.slice_config causes WARN in
intel_dp_msa_wa_compute_config()
--
commit d861175d9728b7781f564c9110b32c97237cc2d9
Author: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
drm/i915/dp: Apply the MSA WA to the Data M/N
This commit adjusts the Data M/N values for the MSA placement workaround
during DisplayPort config computation when audio is enabled.
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 75ddfa30a3c3e..0f7be06086448 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1858,6 +1858,46 @@ static bool intel_dp_msa_wa_link_config_valid(struct intel_dp *intel_dp,
> link_bpp_x16, dsc, &m_n) == 0;
> }
>
> +static int intel_dp_msa_wa_compute_config(struct intel_dp *intel_dp,
> + struct intel_crtc_state *crtc_state,
> + int link_bpp_x16)
> +{
> + struct intel_display *display = to_intel_display(intel_dp);
> + struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
> + struct intel_link_m_n *m_n = &crtc_state->dp_m_n;
> + u32 data_m = m_n->data_m, data_n = m_n->data_n;
> + int ret;
> +
> + if (!intel_dp_msa_wa_needed(intel_dp,
> + intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST),
> + crtc_state->port_clock) ||
> + !crtc_state->has_audio)
> + return 0;
> +
> + /*
> + * The WA requires the Audio SDPs not to be split, as the HW always
> + * finishes a split SDP right before transmitting the MSA. SDP
> + * splitting is enabled only with 128b/132b, which the WA doesn't
> + * apply to.
> + */
> + drm_WARN_ON(display->drm, crtc_state->sdp_split_enable);
> +
> + ret = intel_dp_msa_wa_compute_m_n(crtc_state, crtc_state->port_clock,
> + crtc_state->lane_count, link_bpp_x16,
> + crtc_state->dsc.compression_enable, m_n);
> + /* The link configuration selection must have rejected such a config. */
> + if (drm_WARN_ON(display->drm, ret))
> + return ret;
[Severity: Medium]
Can intel_dp_msa_wa_compute_m_n() fail and trigger this drm_WARN_ON() on SST
DSC configurations even after link configuration selection accepted the
config?
intel_dp_msa_wa_compute_m_n() derives dsc_slice_count from
crtc_state->dsc.slice_config:
drivers/gpu/drm/i915/display/intel_dp.c:intel_dp_msa_wa_compute_m_n() {
...
int dsc_slice_count = dsc ? intel_dsc_line_slice_count(&crtc_state->dsc.slice_config) : 0;
int active_bits = intel_dp_msa_wa_active_bits(adjusted_mode->crtc_hdisplay,
link_bpp_x16, lane_count,
dsc_slice_count);
However, in intel_dp_dsc_compute_config(), intel_dp_dsc_compute_pipe_bpp() ->
... -> dsc_compute_link_config() calls intel_dp_msa_wa_link_config_valid()
before intel_dp_dsc_get_slice_config() populates
pipe_config->dsc.slice_config:
drivers/gpu/drm/i915/display/intel_dp.c:intel_dp_dsc_compute_config() {
...
if (!is_mst) {
ret = intel_dp_dsc_compute_pipe_bpp(intel_dp, pipe_config,
conn_state, limits);
if (ret) {
...
return ret;
}
}
if (!intel_dp_dsc_get_slice_config(connector, adjusted_mode->crtc_clock,
adjusted_mode->crtc_hdisplay, num_joined_pipes,
&pipe_config->dsc.slice_config))
return -EINVAL;
During link config validation, crtc_state->dsc.slice_config is still zeroed,
so dsc_slice_count is 0 and intel_dp_msa_wa_active_bits() omits DSC slice
padding, EOC symbols, and MSA_WA_DSC_OVRHD_BITS. When
intel_dp_msa_wa_compute_config() later runs with dsc.slice_config populated,
the larger active_bits can push Data M above MSA_WA_DATA_N and return
-ERANGE, triggering the warning and failing the modeset instead of selecting
a lower compressed BPP or higher link rate.
Populating pipe_config->dsc.slice_config before
intel_dp_dsc_compute_pipe_bpp() in intel_dp_dsc_compute_config() would ensure
both checks use the same slice count.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261130043253.2165877-1-chaitanya.kumar.borah@intel.com?part=12
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 13/14] drm/i915/display: Enable Wa_14027342164 on Xe3p
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
` (11 preceding siblings ...)
2026-11-30 4:32 ` [PATCH 12/14] drm/i915/dp: Apply the MSA WA to the Data M/N Chaitanya Kumar Borah
@ 2026-11-30 4:32 ` Chaitanya Kumar Borah
2026-11-30 5:12 ` sashiko-bot
2026-11-30 4:32 ` [PATCH 14/14] drm/i915/dp: Add a debugfs knob to disable the MSA placement WA Chaitanya Kumar Borah
` (2 subsequent siblings)
15 siblings, 1 reply; 21+ messages in thread
From: Chaitanya Kumar Borah @ 2026-11-30 4:32 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: Chaitanya Kumar Borah
Enable the MSA placement Data M/N workaround on Xe3p for 8b/10b SST
streams with audio.
Exclude eDP from the WA. The WA doesn't account for eDP specifics today:
the link configuration may be fixed, with DSC the compressed bpp isn't
lowered and with MSO the link is split into segments. eDP panels
generally don't support audio, so excluding eDP shouldn't leave any
affected configurations unhandled. Bspec doesn't exclude eDP, so this is
a deliberate deviation.
While at it, group the cases of the WAs applying to the same display
version 35 condition under a single return statement.
Bspec: 68922
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
.../gpu/drm/i915/display/intel_display_wa.c | 2 +-
.../gpu/drm/i915/display/intel_display_wa.h | 1 +
drivers/gpu/drm/i915/display/intel_dp.c | 19 +++++++++++++++++--
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display_wa.c b/drivers/gpu/drm/i915/display/intel_display_wa.c
index cc0b28d524f6..6bffb55ec682 100644
--- a/drivers/gpu/drm/i915/display/intel_display_wa.c
+++ b/drivers/gpu/drm/i915/display/intel_display_wa.c
@@ -114,8 +114,8 @@ bool __intel_display_wa(struct intel_display *display, enum intel_display_wa wa,
case INTEL_DISPLAY_WA_14022081154:
return DISPLAY_VER(display) == 30;
case INTEL_DISPLAY_WA_14025769978:
- return DISPLAY_VER(display) == 35;
case INTEL_DISPLAY_WA_14026643300:
+ case INTEL_DISPLAY_WA_14027342164:
return DISPLAY_VER(display) == 35;
case INTEL_DISPLAY_WA_15013987218:
return DISPLAY_VER(display) == 20;
diff --git a/drivers/gpu/drm/i915/display/intel_display_wa.h b/drivers/gpu/drm/i915/display/intel_display_wa.h
index 2086c7da710d..378468517a38 100644
--- a/drivers/gpu/drm/i915/display/intel_display_wa.h
+++ b/drivers/gpu/drm/i915/display/intel_display_wa.h
@@ -38,6 +38,7 @@ enum intel_display_wa {
INTEL_DISPLAY_WA_14022081154,
INTEL_DISPLAY_WA_14025769978,
INTEL_DISPLAY_WA_14026643300,
+ INTEL_DISPLAY_WA_14027342164,
INTEL_DISPLAY_WA_15013987218,
INTEL_DISPLAY_WA_15018326506,
INTEL_DISPLAY_WA_16011181250,
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 0f7be0608644..0bd08087a9c4 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1835,8 +1835,23 @@ int intel_dp_msa_wa_compute_m_n(const struct intel_crtc_state *crtc_state,
static bool intel_dp_msa_wa_needed(struct intel_dp *intel_dp, bool is_mst,
int link_rate)
{
- /* Wa_14027342164: Enabled by a follow-up change. */
- return false;
+ struct intel_display *display = to_intel_display(intel_dp);
+
+ if (!intel_display_wa(display, INTEL_DISPLAY_WA_14027342164))
+ return false;
+
+ /*
+ * The WA doesn't account for eDP specifics today: the link
+ * configuration may be fixed, with DSC the compressed bpp isn't
+ * lowered and with MSO the link is split into segments. eDP panels
+ * generally don't support audio, so excluding eDP shouldn't leave any
+ * affected configurations unhandled.
+ */
+ if (intel_dp_is_edp(intel_dp))
+ return false;
+
+ /* The WA applies only to 8b/10b SST */
+ return !is_mst && !drm_dp_is_uhbr_rate(link_rate);
}
static bool intel_dp_msa_wa_link_config_valid(struct intel_dp *intel_dp,
--
2.50.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH 13/14] drm/i915/display: Enable Wa_14027342164 on Xe3p
2026-11-30 4:32 ` [PATCH 13/14] drm/i915/display: Enable Wa_14027342164 on Xe3p Chaitanya Kumar Borah
@ 2026-11-30 5:12 ` sashiko-bot
0 siblings, 0 replies; 21+ messages in thread
From: sashiko-bot @ 2026-11-30 5:12 UTC (permalink / raw)
To: Chaitanya Kumar Borah, intel-xe, intel-gfx
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/i915/dp: zeroed dsc.slice_config in
dsc_compute_link_config() MSA WA check
--
commit edc66f308060144911cfc28d89de19594d986df2
Author: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
drm/i915/display: Enable Wa_14027342164 on Xe3p
This commit enables the MSA placement Data M/N workaround
(Wa_14027342164) on Xe3p for non-eDP 8b/10b SST streams with audio.
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 0f7be06086448..0bd08087a9c42 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1835,8 +1835,23 @@ int intel_dp_msa_wa_compute_m_n(const struct intel_crtc_state *crtc_state,
> static bool intel_dp_msa_wa_needed(struct intel_dp *intel_dp, bool is_mst,
> int link_rate)
> {
> - /* Wa_14027342164: Enabled by a follow-up change. */
> - return false;
> + struct intel_display *display = to_intel_display(intel_dp);
> +
> + if (!intel_display_wa(display, INTEL_DISPLAY_WA_14027342164))
> + return false;
> +
> + /*
> + * The WA doesn't account for eDP specifics today: the link
> + * configuration may be fixed, with DSC the compressed bpp isn't
> + * lowered and with MSO the link is split into segments. eDP panels
> + * generally don't support audio, so excluding eDP shouldn't leave any
> + * affected configurations unhandled.
> + */
> + if (intel_dp_is_edp(intel_dp))
> + return false;
> +
> + /* The WA applies only to 8b/10b SST */
> + return !is_mst && !drm_dp_is_uhbr_rate(link_rate);
> }
[Severity: Medium]
When validating SST DSC link configurations in dsc_compute_link_config(),
does intel_dp_msa_wa_compute_m_n() evaluate crtc_state->dsc.slice_config
before it has been populated?
In intel_dp_dsc_compute_config(), intel_dp_dsc_compute_pipe_bpp() runs
before intel_dp_dsc_get_slice_config():
drivers/gpu/drm/i915/display/intel_dp.c:intel_dp_dsc_compute_config() {
...
if (!is_mst) {
ret = intel_dp_dsc_compute_pipe_bpp(intel_dp, pipe_config,
conn_state, limits);
if (ret) {
...
return ret;
}
}
if (!intel_dp_dsc_get_slice_config(connector, adjusted_mode->crtc_clock,
adjusted_mode->crtc_hdisplay, num_joined_pipes,
&pipe_config->dsc.slice_config))
return -EINVAL;
...
}
Because pipe_config->dsc.slice_config was zeroed by
intel_dp_dsc_reset_config(), intel_dp_dsc_compute_pipe_bpp() ->
dsc_compute_compressed_bpp() -> dsc_compute_link_config() ->
intel_dp_msa_wa_link_config_valid() -> intel_dp_msa_wa_compute_m_n() gets
dsc_slice_count == 0 and computes active_bits using the uncompressed
formula (omitting DSC slice chunk padding, EOC symbols, and
MSA_WA_DSC_OVRHD_BITS).
Later in intel_dp_compute_config(), intel_dp_msa_wa_compute_config() calls
intel_dp_msa_wa_compute_m_n() again with the populated slice_config. If
the extra DSC overhead bits push the shifted Data M/N ratio over 1.0,
intel_dp_msa_wa_compute_config() hits drm_WARN_ON(display->drm, ret) and
fails the modeset instead of selecting a lower compressed bpp or higher
link rate during link config selection.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261130043253.2165877-1-chaitanya.kumar.borah@intel.com?part=13
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 14/14] drm/i915/dp: Add a debugfs knob to disable the MSA placement WA
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
` (12 preceding siblings ...)
2026-11-30 4:32 ` [PATCH 13/14] drm/i915/display: Enable Wa_14027342164 on Xe3p Chaitanya Kumar Borah
@ 2026-11-30 4:32 ` Chaitanya Kumar Borah
2026-11-30 5:03 ` ✗ CI.checkpatch: warning for drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Patchwork
2026-11-30 5:04 ` ✗ CI.KUnit: failure " Patchwork
15 siblings, 0 replies; 21+ messages in thread
From: Chaitanya Kumar Borah @ 2026-11-30 4:32 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: Chaitanya Kumar Borah
Add a per-connector "intel_msa_wa_enable" debugfs file, set by default, to
allow disabling Wa_14027342164 at runtime. This makes it possible to
reproduce the issue the WA addresses, to verify the WA, and to debug in
case a sink does not tolerate it.
The WA is evaluated during the link configuration and mode validation, so
the new setting takes effect on the next modeset of the connector.
The file is created only for non-MST DP connectors, since the WA doesn't
apply to eDP or MST.
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
drivers/gpu/drm/i915/display/intel_display_debugfs.c | 5 +++++
drivers/gpu/drm/i915/display/intel_display_types.h | 3 +++
drivers/gpu/drm/i915/display/intel_dp.c | 4 +++-
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
index 3289535650aa..70950ce8d6cf 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
@@ -1356,6 +1356,11 @@ void intel_connector_debugfs_add(struct intel_connector *connector)
connector, &i915_joiner_fops);
}
+ if (connector_type == DRM_MODE_CONNECTOR_DisplayPort && !connector->mst.dp) {
+ debugfs_create_bool("intel_msa_wa_enable", 0644, root,
+ &intel_attached_dp(connector)->msa_wa_enable);
+ }
+
if (connector_type == DRM_MODE_CONNECTOR_DSI ||
connector_type == DRM_MODE_CONNECTOR_eDP ||
connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index d1d775314d6d..c81600765d68 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1970,6 +1970,9 @@ struct intel_dp {
bool force_dsc_fractional_bpp_en;
int force_dsc_bpc;
+ /* Wa_14027342164 (MSA placement) enabled, can be cleared for testing */
+ bool msa_wa_enable;
+
bool hobl_failed;
bool hobl_active;
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 0bd08087a9c4..83d7aceacbc3 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1837,7 +1837,8 @@ static bool intel_dp_msa_wa_needed(struct intel_dp *intel_dp, bool is_mst,
{
struct intel_display *display = to_intel_display(intel_dp);
- if (!intel_display_wa(display, INTEL_DISPLAY_WA_14027342164))
+ if (!intel_dp->msa_wa_enable ||
+ !intel_display_wa(display, INTEL_DISPLAY_WA_14027342164))
return false;
/*
@@ -8084,6 +8085,7 @@ intel_dp_init_connector(struct intel_digital_port *dig_port,
return false;
intel_dp->reset_link_params = true;
+ intel_dp->msa_wa_enable = true;
/* Preserve the current hw state. */
intel_dp->DP = intel_de_read(display, intel_dp->output_reg);
--
2.50.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* ✗ CI.checkpatch: warning for drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164)
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
` (13 preceding siblings ...)
2026-11-30 4:32 ` [PATCH 14/14] drm/i915/dp: Add a debugfs knob to disable the MSA placement WA Chaitanya Kumar Borah
@ 2026-11-30 5:03 ` Patchwork
2026-11-30 5:04 ` ✗ CI.KUnit: failure " Patchwork
15 siblings, 0 replies; 21+ messages in thread
From: Patchwork @ 2026-11-30 5:03 UTC (permalink / raw)
To: Chaitanya Kumar Borah; +Cc: intel-xe
== Series Details ==
Series: drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164)
URL : https://patchwork.freedesktop.org/series/179977/
State : warning
== Summary ==
+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt
Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master
3009867cd31863246e4afc138520a7a8bd37bb11
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 5ddd76c42fd0f813df6ecb8375e4cf9094f09f55
Author: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Date: Mon Nov 30 10:02:47 2026 +0530
drm/i915/dp: Add a debugfs knob to disable the MSA placement WA
Add a per-connector "intel_msa_wa_enable" debugfs file, set by default, to
allow disabling Wa_14027342164 at runtime. This makes it possible to
reproduce the issue the WA addresses, to verify the WA, and to debug in
case a sink does not tolerate it.
The WA is evaluated during the link configuration and mode validation, so
the new setting takes effect on the next modeset of the connector.
The file is created only for non-MST DP connectors, since the WA doesn't
apply to eDP or MST.
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
+ /mt/dim checkpatch 87312a33227c3d67b5dd786d81e093ca7a0cba56 drm-intel
9bfdfd24589e drm/i915/dp: Add the MSA placement Data M/N WA computation
060c469993b1 drm/i915/kunit: Export the MSA placement WA Data M/N helper for testing
-:85: WARNING:MULTISTATEMENT_MACRO_USE_DO_WHILE: Non-declarative macros with multiple statements should be enclosed in a do - while loop
#85: FILE: drivers/gpu/drm/i915/display/intel_dp.h:262:
+#define __DECLARE_MEMBER(__name, __fn) \
+ typeof(__fn) *__name;
BUT SEE:
do {} while (0) advice is over-stated in a few situations:
The more obvious case is macros, like MODULE_PARM_DESC, invoked at
file-scope, where C disallows code (it must be in functions). See
$exceptions if you have one to add by name.
More troublesome is declarative macros used at top of new scope,
like DECLARE_PER_CPU. These might just compile with a do-while-0
wrapper, but would be incorrect. Most of these are handled by
detecting struct,union,etc declaration primitives in $exceptions.
Theres also macros called inside an if (block), which "return" an
expression. These cannot do-while, and need a ({}) wrapper.
Enjoy this qualification while we work to improve our heuristics.
-:85: CHECK:MACRO_ARG_PRECEDENCE: Macro argument '__name' may be better as '(__name)' to avoid precedence issues
#85: FILE: drivers/gpu/drm/i915/display/intel_dp.h:262:
+#define __DECLARE_MEMBER(__name, __fn) \
+ typeof(__fn) *__name;
-:85: WARNING:TRAILING_SEMICOLON: macros should not use a trailing semicolon
#85: FILE: drivers/gpu/drm/i915/display/intel_dp.h:262:
+#define __DECLARE_MEMBER(__name, __fn) \
+ typeof(__fn) *__name;
total: 0 errors, 2 warnings, 1 checks, 70 lines checked
0d7a8b218519 drm/i915/kunit: Add MSA placement WA Data M/N tests
-:39: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#39:
new file mode 100644
total: 0 errors, 1 warnings, 0 checks, 195 lines checked
82bc7efa1ba5 drm/xe/kunit: Build the MSA placement WA display tests
372bbcbed70d drm/i915/audio: Rename enable_audio_dsc_wa()
97037d0d76a3 drm/i915/audio: Program Hblank Early for the MSA WA shift left
2074db247ce8 drm/i915/dp: Move intel_dp_has_audio() and intel_dp_port_has_audio() up
96867092b37d drm/i915/dp: Account for the MSA WA in SST link config selection
4c6f18cff3fd drm/i915/dp: Prune uncompressed modes failing the MSA WA
911ad96e3264 drm/i915/dp: Move intel_dp_mode_valid_format() and intel_dp_mode_valid() down
f937944ac6f2 drm/i915/dp: Account for the MSA WA in DSC mode validation
9fffe8e2188c drm/i915/dp: Apply the MSA WA to the Data M/N
054ac55d7e03 drm/i915/display: Enable Wa_14027342164 on Xe3p
5ddd76c42fd0 drm/i915/dp: Add a debugfs knob to disable the MSA placement WA
^ permalink raw reply [flat|nested] 21+ messages in thread* ✗ CI.KUnit: failure for drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164)
2026-11-30 4:32 [PATCH 00/14] drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Chaitanya Kumar Borah
` (14 preceding siblings ...)
2026-11-30 5:03 ` ✗ CI.checkpatch: warning for drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164) Patchwork
@ 2026-11-30 5:04 ` Patchwork
15 siblings, 0 replies; 21+ messages in thread
From: Patchwork @ 2026-11-30 5:04 UTC (permalink / raw)
To: Chaitanya Kumar Borah; +Cc: intel-xe
== Series Details ==
Series: drm/i915/dp: Add the MSA placement Data M/N WA (Wa_14027342164)
URL : https://patchwork.freedesktop.org/series/179977/
State : failure
== Summary ==
+ trap cleanup EXIT
+ kunitconfigs=('/kernel/drivers/gpu/tests/.kunitconfig' '/kernel/drivers/gpu/drm/xe/.kunitconfig' '/kernel/drivers/gpu/drm/tests/.kunitconfig' '/kernel/drivers/gpu/drm/ttm/tests/.kunitconfig' '/kernel/drivers/dma-buf/.kunitconfig')
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/tests/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/tests/.kunitconfig
[05:03:22] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[05:03:28] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
[05:03:48] Starting KUnit Kernel (1/1)...
[05:03:48] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[05:03:49] ================= gpu_buddy (15 subtests) ==================
[05:03:49] [PASSED] gpu_test_buddy_alloc_limit
[05:03:49] [PASSED] gpu_test_buddy_alloc_optimistic
[05:03:49] [PASSED] gpu_test_buddy_alloc_pessimistic
[05:03:49] [PASSED] gpu_test_buddy_alloc_pathological
[05:03:49] [PASSED] gpu_test_buddy_alloc_contiguous
[05:03:49] [PASSED] gpu_test_buddy_alloc_clear
[05:03:49] [PASSED] gpu_test_buddy_alloc_range
[05:03:49] [PASSED] gpu_test_buddy_alloc_range_bias
[05:03:49] [PASSED] gpu_test_buddy_alloc_range_clear_guard
[05:03:50] [PASSED] gpu_test_buddy_fragmentation_performance
[05:03:50] [PASSED] gpu_test_buddy_dirty_tracker_performance
[05:03:50] [PASSED] gpu_test_buddy_alloc_exceeds_max_order
[05:03:50] [PASSED] gpu_test_buddy_offset_aligned_allocation
[05:03:50] [PASSED] gpu_test_buddy_subtree_offset_alignment_stress
[05:03:50] [PASSED] gpu_test_buddy_addr_to_block
[05:03:50] ==================== [PASSED] gpu_buddy ====================
[05:03:50] ============================================================
[05:03:50] Testing complete. Ran 15 tests: passed: 15
[05:03:50] Elapsed time: 28.063s total, 5.206s configuring, 20.740s building, 2.042s running
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/drm/xe/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig
ERROR:root:../drivers/gpu/drm/xe/xe_hwmon.c:1959:6: error: redefinition of ‘xe_hwmon_unregister’
1959 | void xe_hwmon_unregister(struct xe_device *xe)
| ^~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/xe/xe_hwmon.c:1943:6: note: previous definition of ‘xe_hwmon_unregister’ with type ‘void(struct xe_device *)’
1943 | void xe_hwmon_unregister(struct xe_device *xe)
| ^~~~~~~~~~~~~~~~~~~
make[7]: *** [../scripts/Makefile.build:290: drivers/gpu/drm/xe/xe_hwmon.o] Error 1
make[7]: *** Waiting for unfinished jobs....
make[6]: *** [../scripts/Makefile.build:572: drivers/gpu/drm/xe] Error 2
make[5]: *** [../scripts/Makefile.build:572: drivers/gpu/drm] Error 2
make[4]: *** [../scripts/Makefile.build:572: drivers/gpu] Error 2
make[3]: *** [../scripts/Makefile.build:572: drivers] Error 2
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [/kernel/Makefile:2244: .] Error 2
make[1]: *** [/kernel/Makefile:248: __sub-make] Error 2
make: *** [Makefile:248: __sub-make] Error 2
[05:03:51] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[05:03:53] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel
^ permalink raw reply [flat|nested] 21+ messages in thread