* [PATCH v5 01/15] drm/i915/dp: Forget the PCON FRL training state on a long HPD
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 9:45 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 02/15] drm/i915/dp: Account for FRL 16b/18b encoding overhead Ankit Nautiyal
` (14 subsequent siblings)
15 siblings, 1 reply; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
Currently, the intel_dp->frl.is_trained is cleared only when the HDMI link
status IRQ reports the link down. A sink disconnect, or a PCON that resets
itself and drops the HPD, doesn't clear it. As a result, the FRL training
is skipped at the next enable although the HDMI link is gone.
Clear the flag on a long HPD. The next enable then reads the state of
the PCON, and trains the link if it is not already in FRL mode.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 0c7c57d9f3ab..179e0d8b89c2 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -7140,6 +7140,13 @@ intel_dp_hpd_pulse(struct intel_digital_port *dig_port, bool long_hpd)
intel_dp->reset_link_params = true;
intel_dp_invalidate_source_oui(intel_dp);
+ /*
+ * The HDMI link of a PCON is lost with the sink, forget its
+ * trained state, so that the FRL training is checked again at
+ * the next enable.
+ */
+ intel_dp->frl.is_trained = false;
+
return IRQ_NONE;
}
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* Re: [PATCH v5 01/15] drm/i915/dp: Forget the PCON FRL training state on a long HPD
2026-12-04 8:57 ` [PATCH v5 01/15] drm/i915/dp: Forget the PCON FRL training state on a long HPD Ankit Nautiyal
@ 2026-12-04 9:45 ` sashiko-bot
0 siblings, 0 replies; 29+ messages in thread
From: sashiko-bot @ 2026-12-04 9:45 UTC (permalink / raw)
To: Ankit Nautiyal, intel-gfx, intel-xe; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [Medium] drm/i915/dp: long HPD without modeset breaks HDMI FRL link
recovery
- [Medium] drm/i915/dp: unlocked intel_dp->frl.is_trained write races
with enable
- [Medium] drm/i915/dp: unlocked race on frl.is_trained in
intel_dp_hpd_pulse()
- [Low] drm/i915/dp: missing Fixes tag for PCON FRL state reset on long
HPD
--
commit f7ef6c5b005b15275af0bf3883f1f982970ce603
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> drm/i915/dp: Forget the PCON FRL training state on a long HPD
>
> Currently, the intel_dp->frl.is_trained is cleared only when the HDMI link
> status IRQ reports the link down. A sink disconnect, or a PCON that resets
> itself and drops the HPD, doesn't clear it. As a result, the FRL training
> is skipped at the next enable although the HDMI link is gone.
>
> Clear the flag on a long HPD. The next enable then reads the state of
> the PCON, and trains the link if it is not already in FRL mode.
>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
[Severity: Low]
This looks like a bug fix for PCON FRL training state tracking. Should
this include:
Fixes: ced42f2df5fd ("drm/i915: Add support for starting FRL training for HDMI2.1 via PCON")
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 0c7c57d9f3abf..179e0d8b89c2c 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -7140,6 +7140,13 @@ intel_dp_hpd_pulse(struct intel_digital_port *dig_port, bool long_hpd)
> intel_dp->reset_link_params = true;
> intel_dp_invalidate_source_oui(intel_dp);
>
> + /*
> + * The HDMI link of a PCON is lost with the sink, forget its
> + * trained state, so that the FRL training is checked again at
> + * the next enable.
> + */
> + intel_dp->frl.is_trained = false;
[Severity: Medium]
Can clearing intel_dp->frl.is_trained on a long HPD break FRL link
recovery when no modeset follows?
If a transient long HPD occurs while the upstream DP link stays up and
the sink EDID is unchanged (such as a Type-C HPD deassert/reassert
without unplugging), intel_dp_detect() reports the connector connected
and intel_dp_check_link_state() -> intel_dp_needs_link_retrain() only
checks the upstream DP link via intel_dp_link_ok(), so no encoder enable
runs.
intel_dp->frl.is_trained then stays false while the stream remains
active, causing intel_dp_handle_hdmi_link_status_change() (which gates
recovery on intel_dp->frl.is_trained && !is_active) to silently ignore
later HDMI link drops until a full modeset occurs.
[Severity: Medium]
Can this unlocked write to intel_dp->frl.is_trained race with modeset
enable and lose the long HPD invalidation?
intel_dp_hpd_pulse() runs from i915_digport_work_func() with no modeset
locks held, while mtl_ddi_pre_enable_dp() (and tgl_ddi_pre_enable_dp() /
intel_enable_dp()) calls intel_dp_check_frl_training() before
intel_dp_start_link_train() calls intel_hpd_block():
CPU0 (modeset enable) CPU1 (dig_port_work)
mtl_ddi_pre_enable_dp()
intel_dp_check_frl_training()
intel_dp_pcon_start_frl_training()
poll intel_dp_pcon_is_frl_trained()
i915_digport_work_func()
intel_dp_hpd_pulse(..., true)
intel_dp->frl.is_trained = false
intel_dp->frl.is_trained = true <-- overwrites long HPD reset
Because intel_dp_pcon_start_frl_training() polls DPCD for up to 1.5s
without blocking HPD, a sink disconnect or PCON reset in that window is
overwritten back to true, so the next enable skips FRL training even
though the HDMI link is gone. The concurrent plain read/write is also a
data race (contrast intel_dp_invalidate_source_oui() above using
WRITE_ONCE()).
[Severity: Medium]
Can a delayed long HPD in i915_digport_work_func() also clobber a
freshly trained intel_dp->frl.is_trained state back to false?
CPU0 (modeset enable) CPU1 (dig_port_work)
i915_digport_work_func()
intel_dp_hpd_pulse(..., true)
intel_dp_read_dprx_caps()
mtl_ddi_pre_enable_dp()
intel_dp_check_frl_training()
intel_dp_pcon_start_frl_training()
intel_dp->frl.is_trained = true
intel_dp->frl.is_trained = false
<-- clobbers trained state
If intel_dp_hpd_pulse() is delayed behind another port or inside
intel_dp_read_dprx_caps(), it can clear intel_dp->frl.is_trained right
after FRL training finishes, disabling later HDMI_LINK_STATUS_CHANGED
recovery. Later in this series, commit "drm/i915/dp: Store the PCON FRL
rate in the crtc state" adds an unlocked write to
intel_dp->frl.trained_rate_gbps beside this one, which can also leave
torn state with is_trained true and trained_rate_gbps zero.
Serializing FRL state updates with modeset enable, or blocking HPD
across FRL training, would prevent both races.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204085746.391918-1-ankit.k.nautiyal@intel.com?part=1
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v5 02/15] drm/i915/dp: Account for FRL 16b/18b encoding overhead
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
2026-12-04 8:57 ` [PATCH v5 01/15] drm/i915/dp: Forget the PCON FRL training state on a long HPD Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 9:36 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 03/15] drm/i915/hdmi: Clamp the target_bpp only when it equals the link bpp Ankit Nautiyal
` (13 subsequent siblings)
15 siblings, 1 reply; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
HDMI 2.1 FRL uses 16b/18b line coding, so only 16/18 of the raw FRL
rate carries payload. The FRL bandwidth check compared the required
bandwidth against the raw rate of the PCON and the sink, and so
accepted modes that cannot be carried.
Use the payload bandwidth for the check. The requirement is still
estimated from the full pixel clock including blanking, so it remains
an upper bound.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 179e0d8b89c2..c0cf0938a7b6 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1206,8 +1206,11 @@ intel_dp_frl_bw_valid(struct intel_dp *intel_dp, int target_clock,
max_frl_bw = min(intel_dp->dfp.pcon_max_frl_bw,
intel_dp_hdmi_sink_max_frl(intel_dp));
- /* converting bw from Gbps to Kbps*/
- max_frl_bw = max_frl_bw * 1000000;
+ /*
+ * Convert the rate from Gbps to kbps. FRL uses 16b/18b line coding, so
+ * only 16/18 of the raw rate carries payload.
+ */
+ max_frl_bw = max_frl_bw * 1000000 * 16 / 18;
/* #FIXME check bandwidth with DSC if both PCON and HDMI sink support DSC */
if (target_bw > max_frl_bw)
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* Re: [PATCH v5 02/15] drm/i915/dp: Account for FRL 16b/18b encoding overhead
2026-12-04 8:57 ` [PATCH v5 02/15] drm/i915/dp: Account for FRL 16b/18b encoding overhead Ankit Nautiyal
@ 2026-12-04 9:36 ` sashiko-bot
0 siblings, 0 replies; 29+ messages in thread
From: sashiko-bot @ 2026-12-04 9:36 UTC (permalink / raw)
To: Ankit Nautiyal, intel-gfx, intel-xe; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] drm/i915/dp: 16/18 FRL scaling in intel_dp_frl_bw_valid()
rejects valid modes
- [Low] drm/i915/dp: missing Fixes trailer for FRL bandwidth fix
--
commit 107918ff8c7591551a5888b705f8709b7104d051
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> drm/i915/dp: Account for FRL 16b/18b encoding overhead
>
> HDMI 2.1 FRL uses 16b/18b line coding, so only 16/18 of the raw FRL
> rate carries payload. The FRL bandwidth check compared the required
> bandwidth against the raw rate of the PCON and the sink, and so
> accepted modes that cannot be carried.
>
> Use the payload bandwidth for the check. The requirement is still
> estimated from the full pixel clock including blanking, so it remains
> an upper bound.
>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
[Severity: Low]
This looks like a bug fix for the FRL bandwidth check. Should this
include:
Fixes: 2f78347e3634 ("drm/i915: Capture max frl rate for PCON in dfp cap structure")
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 179e0d8b89c2c..c0cf0938a7b64 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1206,8 +1206,11 @@ intel_dp_frl_bw_valid(struct intel_dp *intel_dp, int target_clock,
> max_frl_bw = min(intel_dp->dfp.pcon_max_frl_bw,
> intel_dp_hdmi_sink_max_frl(intel_dp));
>
> - /* converting bw from Gbps to Kbps*/
> - max_frl_bw = max_frl_bw * 1000000;
> + /*
> + * Convert the rate from Gbps to kbps. FRL uses 16b/18b line coding, so
> + * only 16/18 of the raw rate carries payload.
> + */
> + max_frl_bw = max_frl_bw * 1000000 * 16 / 18;
>
> /* #FIXME check bandwidth with DSC if both PCON and HDMI sink support DSC */
> if (target_bw > max_frl_bw)
[Severity: High]
Does scaling max_frl_bw by 16/18 without adjusting frl_required_bw() reject
valid HDMI 2.1 modes?
frl_required_bw() still multiplies the full pixel clock, including blanking,
by bpc * 3, whereas FRL carries blanking at much lower overhead than active
pixels. For 3840x2160@120Hz (1188 MHz) at 8 bpc on a 32 Gbps FRL link,
target_bw is 28,512,000 kbps against a reduced max_frl_bw of 28,444,444 kbps.
That causes intel_dp_mode_valid_downstream() to prune standard 1188 MHz modes
on 32 Gbps links, and intel_dp_hdmi_compute_bpc() to downgrade valid 10 bpc
to 8 bpc on 40 Gbps links (and 12 bpc to 10 bpc on 24/48 Gbps links).
Separately, for reduced-blanking timings such as CVT-RBv2, the full pixel
clock estimate is not an upper bound either because FRL also incurs roughly
2% RS-FEC, super-block, and map framing overhead beyond 16b/18b coding.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204085746.391918-1-ankit.k.nautiyal@intel.com?part=2
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v5 03/15] drm/i915/hdmi: Clamp the target_bpp only when it equals the link bpp
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
2026-12-04 8:57 ` [PATCH v5 01/15] drm/i915/dp: Forget the PCON FRL training state on a long HPD Ankit Nautiyal
2026-12-04 8:57 ` [PATCH v5 02/15] drm/i915/dp: Account for FRL 16b/18b encoding overhead Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 8:57 ` [PATCH v5 04/15] drm/i915/dp: Add PCON DSC state to crtc_state Ankit Nautiyal
` (12 subsequent siblings)
15 siblings, 0 replies; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
The max bpp from intel_hdmi_dsc_get_min_max_bpp() is at most the
uncompressed link bpp, so when picking the compressed bpp we reduce the
target to keep it below the uncompressed link bpp. Doing this
unconditionally makes the search skip both the max and min boundaries,
returning 0 when max_dsc_bpp equals min_dsc_bpp.
That case isn't hit as of now, but an upcoming FRL link-bandwidth clamp
can make max_dsc_bpp == min_dsc_bpp.
Reduce the target only when it equals the uncompressed link bpp, start
at max_dsc_bpp otherwise, and iterate down to and including min_dsc_bpp.
v2: Use link bpp, reuse intel_dp_output_format_link_bpp_x16(). (Suraj)
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/i915/display/intel_hdmi.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 7c44fb03f6c9..b4b39f5edfae 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -3402,13 +3402,15 @@ intel_hdmi_dsc_bpp_fits_chunk_bytes(int bpp, int num_slices, int slice_width,
}
static int
-get_dsc_compressed_bpp(int num_slices, int slice_width, int hdmi_max_chunk_bytes,
+get_dsc_compressed_bpp(enum intel_output_format output_format, int bpc,
+ int num_slices, int slice_width, int hdmi_max_chunk_bytes,
int src_fractional_bpp, int min_dsc_bpp, int max_dsc_bpp)
{
bool bpp_found = false;
int bpp_decrement_x16;
int bpp_target;
int bpp_target_x16;
+ int link_bpp_x16 = intel_dp_output_format_link_bpp_x16(output_format, 3 * bpc);
/*
* The Sink has a limit of compressed data in bytes for a scanline,
@@ -3433,9 +3435,13 @@ get_dsc_compressed_bpp(int num_slices, int slice_width, int hdmi_max_chunk_bytes
if (!src_fractional_bpp)
src_fractional_bpp = 1;
bpp_decrement_x16 = DIV_ROUND_UP(16, src_fractional_bpp);
- bpp_target_x16 = (bpp_target * 16) - bpp_decrement_x16;
+ bpp_target_x16 = bpp_target * 16;
- while (bpp_target_x16 > (min_dsc_bpp * 16)) {
+ /* The compressed bpp can't be the same as the uncompressed link bpp */
+ if (bpp_target_x16 == link_bpp_x16)
+ bpp_target_x16 -= bpp_decrement_x16;
+
+ while (bpp_target_x16 >= (min_dsc_bpp * 16)) {
int bpp;
bpp = DIV_ROUND_UP(bpp_target_x16, 16);
@@ -3477,7 +3483,8 @@ intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width, int num_slices,
intel_hdmi_dsc_get_min_max_bpp(output_format, bpc, hdmi_all_bpp,
&min_dsc_bpp, &max_dsc_bpp);
- dsc_bpp_x16 = get_dsc_compressed_bpp(num_slices, slice_width,
+ dsc_bpp_x16 = get_dsc_compressed_bpp(output_format, bpc,
+ num_slices, slice_width,
hdmi_max_chunk_bytes,
src_fractional_bpp,
min_dsc_bpp, max_dsc_bpp);
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* [PATCH v5 04/15] drm/i915/dp: Add PCON DSC state to crtc_state
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
` (2 preceding siblings ...)
2026-12-04 8:57 ` [PATCH v5 03/15] drm/i915/hdmi: Clamp the target_bpp only when it equals the link bpp Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 9:43 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 05/15] drm/dp: Add a helper to disable the PCON DSC encoder Ankit Nautiyal
` (11 subsequent siblings)
15 siblings, 1 reply; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
A DP->HDMI 2.1 PCON handles DSC in one of three ways:
- it decodes the stream,
- passes it through to the HDMI sink, or
- decodes it and encodes it again, if it has a DSC encoder.
Add the state to hold that decision, along with the PCON DSC encoder
PPS override parameters, so that they can be computed during
compute_config and only programmed at enable time.
The pass-through is not handled yet, so for now the state is none, decode,
or decode and re-encode.
The state is not read out since it does not map to any register, and
reading back the DPCD is unreliable. Reset it for every link
configuration attempt and print it in the crtc state dump.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
.../drm/i915/display/intel_crtc_state_dump.c | 15 +++++++++++
.../drm/i915/display/intel_display_types.h | 27 +++++++++++++++++++
drivers/gpu/drm/i915/display/intel_dp.c | 1 +
3 files changed, 43 insertions(+)
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..4e9ff59a8d5c 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
@@ -73,6 +73,12 @@ static const char * const output_type_str[] = {
#undef OUTPUT_TYPE
+static const char * const pcon_dsc_op_str[] = {
+ [INTEL_PCON_NO_DSC] = "none",
+ [INTEL_PCON_DSC_DECODE] = "decode",
+ [INTEL_PCON_DSC_DECODE_ENCODE] = "decode+encode",
+};
+
static void snprintf_output_types(char *buf, size_t len,
unsigned int output_types)
{
@@ -243,6 +249,15 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,
str_enabled_disabled(pipe_config->fec_enable),
str_enabled_disabled(pipe_config->enhanced_framing));
+ drm_printf(&p, "pcon: dsc op %s\n",
+ pcon_dsc_op_str[pipe_config->pcon_config.dsc_op]);
+ if (pipe_config->pcon_config.dsc_op == INTEL_PCON_DSC_DECODE_ENCODE)
+ drm_printf(&p,
+ "pcon dsc encoder: slice height: %u, slice width: %u, bpp_x16: %u\n",
+ pipe_config->pcon_config.dsc_enc.slice_height,
+ pipe_config->pcon_config.dsc_enc.slice_width,
+ pipe_config->pcon_config.dsc_enc.bpp_x16);
+
drm_printf(&p, "sdp split: %s\n",
str_enabled_disabled(pipe_config->sdp_split_enable));
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 514ca067e139..0103ac569727 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -968,6 +968,23 @@ enum intel_output_format {
INTEL_OUTPUT_FORMAT_YCBCR444,
};
+enum intel_pcon_dsc_op {
+ /* The PCON does not take part in DSC, also used when there is no HDMI 2.1 PCON */
+ INTEL_PCON_NO_DSC,
+ /* PCON decodes the DSC stream from the DP link, HDMI link is uncompressed */
+ INTEL_PCON_DSC_DECODE,
+ /* PCON decodes the DP stream and encodes DSC 1.2 for the HDMI sink */
+ INTEL_PCON_DSC_DECODE_ENCODE,
+};
+
+/* PCON DSC encoder PPS override parameters */
+struct intel_pcon_dsc_enc_config {
+ u16 slice_height;
+ u16 slice_width;
+ /* Compressed Bpp in U6.4 format */
+ u16 bpp_x16;
+};
+
/* Used by dp and fdi links */
struct intel_link_m_n {
u32 tu;
@@ -1370,6 +1387,16 @@ struct intel_crtc_state {
struct drm_dsc_config config;
} dsc;
+ /*
+ * Configuration of a DP->HDMI PCON. Only used for state computation,
+ * not read out from the HW.
+ */
+ struct {
+ enum intel_pcon_dsc_op dsc_op;
+ /* Only valid for INTEL_PCON_DSC_DECODE_ENCODE */
+ struct intel_pcon_dsc_enc_config dsc_enc;
+ } pcon_config;
+
/* DP tunnel used for BW allocation. */
struct drm_dp_tunnel_ref dp_tunnel_ref;
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index c0cf0938a7b6..2d5f7754eda0 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -2514,6 +2514,7 @@ void intel_dp_dsc_reset_config(struct intel_crtc_state *crtc_state)
memset(&crtc_state->dsc.slice_config, 0, sizeof(crtc_state->dsc.slice_config));
memset(&crtc_state->dsc.config, 0, sizeof(crtc_state->dsc.config));
+ memset(&crtc_state->pcon_config, 0, sizeof(crtc_state->pcon_config));
}
int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* Re: [PATCH v5 04/15] drm/i915/dp: Add PCON DSC state to crtc_state
2026-12-04 8:57 ` [PATCH v5 04/15] drm/i915/dp: Add PCON DSC state to crtc_state Ankit Nautiyal
@ 2026-12-04 9:43 ` sashiko-bot
0 siblings, 0 replies; 29+ messages in thread
From: sashiko-bot @ 2026-12-04 9:43 UTC (permalink / raw)
To: Ankit Nautiyal, intel-gfx, intel-xe; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/i915/dp: intel_pipe_config_compare() omits pcon_config on
fastset
--
commit 11d426d40cc5b9c42754f59b9f85ca99d5db238b
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
drm/i915/dp: Add PCON DSC state to crtc_state
This commit adds pcon_config to struct intel_crtc_state to track DP->HDMI
PCON DSC operation and encoder override parameters, resets it in
intel_dp_dsc_reset_config(), and prints it in intel_crtc_state_dump().
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 514ca067e1399..0103ac5697276 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
[ ... ]
> @@ -1370,6 +1387,16 @@ struct intel_crtc_state {
> struct drm_dsc_config config;
> } dsc;
>
> + /*
> + * Configuration of a DP->HDMI PCON. Only used for state computation,
> + * not read out from the HW.
> + */
> + struct {
> + enum intel_pcon_dsc_op dsc_op;
> + /* Only valid for INTEL_PCON_DSC_DECODE_ENCODE */
> + struct intel_pcon_dsc_enc_config dsc_enc;
> + } pcon_config;
> +
> /* DP tunnel used for BW allocation. */
> struct drm_dp_tunnel_ref dp_tunnel_ref;
[Severity: Medium]
Should intel_pipe_config_compare() compare pcon_config when fastset is
true?
Since pcon_config is not read out from hardware, it cannot be checked
during state verification. However, intel_crtc_check_fastset() calls
intel_pipe_config_compare(..., true) to downgrade modesets to fastsets,
and intel_ddi_update_pipe_dp() does not reprogram the PCON.
If the HDMI sink behind an active PCON is swapped for one with different
capabilities, intel_dp_detect() updates the sink caps in place. A later
commit setting mode_changed (such as changing HDR_OUTPUT_METADATA) then
computes a new pcon_config while DP-side fields match.
intel_crtc_check_fastset() downgrades that commit to a fastset, skipping
PCON reprogramming and leaving HDMI output blank or corrupted until a full
modeset occurs. Comparing pcon_config under if (fastset) would force a
full modeset on changes without affecting state readout verification.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204085746.391918-1-ankit.k.nautiyal@intel.com?part=4
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v5 05/15] drm/dp: Add a helper to disable the PCON DSC encoder
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
` (3 preceding siblings ...)
2026-12-04 8:57 ` [PATCH v5 04/15] drm/i915/dp: Add PCON DSC state to crtc_state Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 8:57 ` [PATCH v5 06/15] drm/i915/dp: Compute the PCON DSC operation Ankit Nautiyal
` (10 subsequent siblings)
15 siblings, 0 replies; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
The DSC encoder of a PCON is enabled through DPCD 3052h[1], together
with an optional PPS override in DPCD 3052h[3:2]. The existing helpers
only ever set these bits.
Add a helper to clear both, so that a driver can switch the encoder off
when the PCON does not need to encode the stream.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/display/drm_dp_helper.c | 23 +++++++++++++++++++++++
include/drm/display/drm_dp_helper.h | 1 +
2 files changed, 24 insertions(+)
diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c
index 2b6ce05556b0..e810addf52bc 100644
--- a/drivers/gpu/drm/display/drm_dp_helper.c
+++ b/drivers/gpu/drm/display/drm_dp_helper.c
@@ -4161,6 +4161,29 @@ int drm_dp_pcon_pps_override_param(struct drm_dp_aux *aux, u8 pps_param[6])
}
EXPORT_SYMBOL(drm_dp_pcon_pps_override_param);
+/**
+ * drm_dp_pcon_dsc_enc_disable() - Disable the DSC encoder of a PCON
+ * @aux: DisplayPort AUX channel
+ *
+ * Disable the DSC encoder of a PCON, along with the encoder PPS override.
+ *
+ * Returns 0 on success, else returns negative error code.
+ */
+int drm_dp_pcon_dsc_enc_disable(struct drm_dp_aux *aux)
+{
+ u8 buf;
+ int ret;
+
+ ret = drm_dp_dpcd_read_byte(aux, DP_PROTOCOL_CONVERTER_CONTROL_2, &buf);
+ if (ret < 0)
+ return ret;
+
+ buf &= ~(DP_PCON_ENABLE_DSC_ENCODER | DP_PCON_ENCODER_PPS_OVERRIDE_MASK);
+
+ return drm_dp_dpcd_write_byte(aux, DP_PROTOCOL_CONVERTER_CONTROL_2, buf);
+}
+EXPORT_SYMBOL(drm_dp_pcon_dsc_enc_disable);
+
/*
* drm_dp_pcon_convert_rgb_to_ycbcr() - Configure the PCon to convert RGB to Ycbcr
* @aux: displayPort AUX channel
diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h
index f497c9f3a550..32c95f657631 100644
--- a/include/drm/display/drm_dp_helper.h
+++ b/include/drm/display/drm_dp_helper.h
@@ -1019,6 +1019,7 @@ int drm_dp_pcon_dsc_bpp_incr(const u8 pcon_dsc_dpcd[DP_PCON_DSC_ENCODER_CAP_SIZE
int drm_dp_pcon_pps_default(struct drm_dp_aux *aux);
int drm_dp_pcon_pps_override_buf(struct drm_dp_aux *aux, u8 pps_buf[128]);
int drm_dp_pcon_pps_override_param(struct drm_dp_aux *aux, u8 pps_param[6]);
+int drm_dp_pcon_dsc_enc_disable(struct drm_dp_aux *aux);
bool drm_dp_downstream_rgb_to_ycbcr_conversion(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
const u8 port_cap[4], u8 color_spc);
int drm_dp_pcon_convert_rgb_to_ycbcr(struct drm_dp_aux *aux, u8 color_spc);
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* [PATCH v5 06/15] drm/i915/dp: Compute the PCON DSC operation
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
` (4 preceding siblings ...)
2026-12-04 8:57 ` [PATCH v5 05/15] drm/dp: Add a helper to disable the PCON DSC encoder Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 9:38 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 07/15] drm/i915/dp: Disable the PCON DSC encoder unless it is needed Ankit Nautiyal
` (9 subsequent siblings)
15 siblings, 1 reply; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
When the DP stream is compressed and the HDMI link of an HDMI 2.1 PCON
carries it uncompressed, the PCON decodes the DSC stream. Record this in
the PCON DSC state once the DP link configuration is final.
The operations for HDMI links that need DSC are added once such modes
can be selected.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 2d5f7754eda0..999faf29be45 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -129,6 +129,7 @@ bool intel_dp_is_edp(struct intel_dp *intel_dp)
static void intel_dp_unset_edid(struct intel_dp *intel_dp);
static int intel_dp_hdmi_sink_max_frl(struct intel_dp *intel_dp);
+static bool intel_dp_is_hdmi_2_1_sink(struct intel_dp *intel_dp);
/* Is link rate UHBR and thus 128b/132b? */
bool intel_dp_is_uhbr(const struct intel_crtc_state *crtc_state)
@@ -3013,6 +3014,19 @@ bool intel_dp_joiner_needs_dsc(struct intel_display *display,
num_joined_pipes == 4;
}
+static int
+intel_dp_pcon_compute_config(struct intel_dp *intel_dp,
+ struct intel_crtc_state *crtc_state)
+{
+ if (!intel_dp_is_hdmi_2_1_sink(intel_dp))
+ return 0;
+
+ if (crtc_state->dsc.compression_enable)
+ crtc_state->pcon_config.dsc_op = INTEL_PCON_DSC_DECODE;
+
+ return 0;
+}
+
static int
intel_dp_compute_link_for_joined_pipes(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config,
@@ -3098,6 +3112,10 @@ intel_dp_compute_link_for_joined_pipes(struct intel_encoder *encoder,
return -EINVAL;
}
+ ret = intel_dp_pcon_compute_config(intel_dp, pipe_config);
+ if (ret)
+ return ret;
+
drm_dbg_kms(display->drm,
"DP lane count %d clock %d bpp input %d compressed " FXP_Q4_FMT " HDR %s link rate required %d available %d\n",
pipe_config->lane_count, pipe_config->port_clock,
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* Re: [PATCH v5 06/15] drm/i915/dp: Compute the PCON DSC operation
2026-12-04 8:57 ` [PATCH v5 06/15] drm/i915/dp: Compute the PCON DSC operation Ankit Nautiyal
@ 2026-12-04 9:38 ` sashiko-bot
0 siblings, 0 replies; 29+ messages in thread
From: sashiko-bot @ 2026-12-04 9:38 UTC (permalink / raw)
To: Ankit Nautiyal, intel-gfx, intel-xe; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/i915/dp: intel_dp_pcon_compute_config() checks sink
instead of PCON FRL
--
commit de210caf4878edfc0415e925316be92c717fcd9d
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
drm/i915/dp: Compute the PCON DSC operation
This commit adds intel_dp_pcon_compute_config() to record
INTEL_PCON_DSC_DECODE in crtc_state->pcon_config.dsc_op when DP DSC is
enabled on an HDMI 2.1 sink, and calls it from
intel_dp_compute_link_for_joined_pipes().
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 2d5f7754eda0c..999faf29be458 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
[ ... ]
> @@ -3013,6 +3014,19 @@ bool intel_dp_joiner_needs_dsc(struct intel_display *display,
> num_joined_pipes == 4;
> }
>
> +static int
> +intel_dp_pcon_compute_config(struct intel_dp *intel_dp,
> + struct intel_crtc_state *crtc_state)
> +{
> + if (!intel_dp_is_hdmi_2_1_sink(intel_dp))
> + return 0;
> +
> + if (crtc_state->dsc.compression_enable)
> + crtc_state->pcon_config.dsc_op = INTEL_PCON_DSC_DECODE;
> +
> + return 0;
> +}
[Severity: Medium]
Should intel_dp_pcon_compute_config() check HDMI 2.1 PCON capability
instead of intel_dp_is_hdmi_2_1_sink()?
intel_dp_is_hdmi_2_1_sink() only checks that a branch device has an HDMI
sink reporting FRL support, without checking
intel_dp->dfp.pcon_max_frl_bw.
With DP DSC enabled, a non-HDMI-2.1 PCON connected to an HDMI 2.1 sink
records INTEL_PCON_DSC_DECODE (contradicting enum intel_pcon_dsc_op),
while an HDMI 2.1 PCON driving an HDMI 2.0 sink leaves dsc_op as
INTEL_PCON_NO_DSC.
This misclassifies crtc_state->pcon_config.dsc_op in CRTC state tracking
and intel_crtc_state_dump(). Checking intel_dp->dfp.pcon_max_frl_bw > 0
(or reusing intel_dp_pcon_sink_support_frl() if both ends must support
FRL) would avoid the mismatch.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204085746.391918-1-ankit.k.nautiyal@intel.com?part=6
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v5 07/15] drm/i915/dp: Disable the PCON DSC encoder unless it is needed
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
` (5 preceding siblings ...)
2026-12-04 8:57 ` [PATCH v5 06/15] drm/i915/dp: Compute the PCON DSC operation Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 9:38 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 08/15] drm/i915/dp: Clamp PCON DSC bpp to the FRL link bandwidth Ankit Nautiyal
` (8 subsequent siblings)
15 siblings, 1 reply; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
The PCON DSC encoder is only used when the PCON re-encodes the DP stream
as DSC 1.2 for the HDMI sink. Otherwise the PCON either decodes the
stream, or there is no DSC at all.
Currently the encoder is enabled with PPS override parameters whenever
the PCON and the HDMI sink support DSC 1.2, even for streams that do not
need it, and it is never disabled again.
Program the encoder only for the decode and re-encode operation, and
explicitly disable it for all the other operations.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 999faf29be45..a469766c0a6b 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -4610,6 +4610,13 @@ intel_dp_pcon_dsc_configure(struct intel_dp *intel_dp,
!hdmi_is_dsc_1_2)
return;
+ if (crtc_state->pcon_config.dsc_op != INTEL_PCON_DSC_DECODE_ENCODE) {
+ ret = drm_dp_pcon_dsc_enc_disable(&intel_dp->aux);
+ if (ret < 0)
+ drm_dbg_kms(display->drm, "Failed to disable pcon DSC encoder\n");
+ return;
+ }
+
slice_height = intel_dp_pcon_dsc_enc_slice_height(crtc_state);
if (!slice_height)
return;
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* Re: [PATCH v5 07/15] drm/i915/dp: Disable the PCON DSC encoder unless it is needed
2026-12-04 8:57 ` [PATCH v5 07/15] drm/i915/dp: Disable the PCON DSC encoder unless it is needed Ankit Nautiyal
@ 2026-12-04 9:38 ` sashiko-bot
0 siblings, 0 replies; 29+ messages in thread
From: sashiko-bot @ 2026-12-04 9:38 UTC (permalink / raw)
To: Ankit Nautiyal, intel-gfx, intel-xe; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/i915/dp: intel_dp_pcon_dsc_configure() skips disable on
sink checks
- [Low] drm/i915/dp: missing Fixes trailer for commit 10fec80b48c5
--
commit 00ba4aeec950179a86038a063b9758f78b472573
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> drm/i915/dp: Disable the PCON DSC encoder unless it is needed
>
> The PCON DSC encoder is only used when the PCON re-encodes the DP stream
> as DSC 1.2 for the HDMI sink. Otherwise the PCON either decodes the
> stream, or there is no DSC at all.
>
> Currently the encoder is enabled with PPS override parameters whenever
> the PCON and the HDMI sink support DSC 1.2, even for streams that do not
> need it, and it is never disabled again.
>
> Program the encoder only for the decode and re-encode operation, and
> explicitly disable it for all the other operations.
>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
[Severity: Low]
This fixes the unconditional PCON DSC encoder enablement in
intel_dp_pcon_dsc_configure(). Should this include:
Fixes: 10fec80b48c5 ("drm/i915/display: Configure PCON for DSC1.1 to DSC1.2 encoding")
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 999faf29be458..a469766c0a6b2 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -4610,6 +4610,13 @@ intel_dp_pcon_dsc_configure(struct intel_dp *intel_dp,
> !hdmi_is_dsc_1_2)
> return;
>
> + if (crtc_state->pcon_config.dsc_op != INTEL_PCON_DSC_DECODE_ENCODE) {
> + ret = drm_dp_pcon_dsc_enc_disable(&intel_dp->aux);
> + if (ret < 0)
> + drm_dbg_kms(display->drm, "Failed to disable pcon DSC encoder\n");
> + return;
> + }
[Severity: Medium]
Can this skip disabling the PCON DSC encoder when the downstream HDMI sink
is swapped to one that does not support HDMI 2.1 or DSC 1.2?
DP_PCON_ENABLE_DSC_ENCODER and DP_PCON_ENCODER_PPS_OVERRIDE_MASK live in
DP_PROTOCOL_CONVERTER_CONTROL_2 on the PCON itself, and neither output
disable nor intel_dp_configure_protocol_converter() clears them.
Because intel_dp_pcon_dsc_configure() returns early on
!intel_dp_is_hdmi_2_1_sink() and !hdmi_is_dsc_1_2, a DSC 1.2-capable PCON
left with its encoder enabled from an earlier modeset will not reach
drm_dp_pcon_dsc_enc_disable(), causing a blank or corrupted display.
Disabling the encoder based on PCON capability before the sink checks (and
clearing intel_dp->pcon_dsc_dpcd in intel_dp_unset_edid()) would avoid
leaving stale encoder state on the PCON.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204085746.391918-1-ankit.k.nautiyal@intel.com?part=7
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v5 08/15] drm/i915/dp: Clamp PCON DSC bpp to the FRL link bandwidth
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
` (6 preceding siblings ...)
2026-12-04 8:57 ` [PATCH v5 07/15] drm/i915/dp: Disable the PCON DSC encoder unless it is needed Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 9:33 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 09/15] drm/i915/dp: Add a helper for the FRL payload bandwidth Ankit Nautiyal
` (7 subsequent siblings)
15 siblings, 1 reply; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
While configuring the PCON DSC encoder, intel_hdmi_dsc_get_bpp() picks
the highest compressed bpp that fits the sink's per-scanline chunk-bytes
limit. However it does not account for the FRL link bandwidth, so the
selected bpp can end up exceeding what the trained PCON/sink FRL link can
actually carry.
Add a parameter to limit the maximum bpp to what the link can carry. All
callers pass 0 for now, which means no limit.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
drivers/gpu/drm/i915/display/intel_hdmi.c | 8 +++++++-
drivers/gpu/drm/i915/display/intel_hdmi.h | 3 ++-
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index a469766c0a6b..e84c060e5563 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -4578,7 +4578,7 @@ intel_dp_pcon_dsc_enc_bpp(struct intel_dp *intel_dp,
return intel_hdmi_dsc_get_bpp(pcon_fractional_bpp, slice_width,
num_slices, output_format, bpc, hdmi_all_bpp,
- hdmi_max_chunk_bytes);
+ hdmi_max_chunk_bytes, 0);
}
void
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index b4b39f5edfae..834900b0d11a 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -3469,13 +3469,15 @@ get_dsc_compressed_bpp(enum intel_output_format output_format, int bpc,
* @bpc: bits per color
* @hdmi_all_bpp: sink supports decoding of 1/16th bpp setting
* @hdmi_max_chunk_bytes: max bytes in a line of chunks supported by sink
+ * @max_link_dsc_bpp: max compressed bpp the link bandwidth can carry, or 0 if not limited
*
* @return: compressed bits_per_pixel in step of 1/16 of bits_per_pixel
*/
int
intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width, int num_slices,
enum intel_output_format output_format, int bpc,
- bool hdmi_all_bpp, int hdmi_max_chunk_bytes)
+ bool hdmi_all_bpp, int hdmi_max_chunk_bytes,
+ int max_link_dsc_bpp)
{
int max_dsc_bpp, min_dsc_bpp;
int dsc_bpp_x16;
@@ -3483,6 +3485,10 @@ intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width, int num_slices,
intel_hdmi_dsc_get_min_max_bpp(output_format, bpc, hdmi_all_bpp,
&min_dsc_bpp, &max_dsc_bpp);
+ /* Limit the bpp to what the link bandwidth can carry */
+ if (max_link_dsc_bpp)
+ max_dsc_bpp = min(max_dsc_bpp, max_link_dsc_bpp);
+
dsc_bpp_x16 = get_dsc_compressed_bpp(output_format, bpc,
num_slices, slice_width,
hdmi_max_chunk_bytes,
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.h b/drivers/gpu/drm/i915/display/intel_hdmi.h
index 375f1b4decfb..acc025ae507c 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.h
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.h
@@ -56,7 +56,8 @@ bool intel_hdmi_bpc_possible(const struct intel_crtc_state *crtc_state,
int intel_hdmi_tmds_clock(int clock, int bpc, enum intel_output_format sink_format);
int intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width,
int num_slices, enum intel_output_format output_format,
- int bpc, bool hdmi_all_bpp, int hdmi_max_chunk_bytes);
+ int bpc, bool hdmi_all_bpp, int hdmi_max_chunk_bytes,
+ int max_link_dsc_bpp);
void intel_hdmi_dsc_get_min_max_bpp(enum intel_output_format output_format, u8 bpc,
bool hdmi_all_bpp, int *min_dsc_bpp, int *max_dsc_bpp);
bool intel_hdmi_dsc_bpp_fits_chunk_bytes(int bpp, int num_slices, int slice_width,
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* Re: [PATCH v5 08/15] drm/i915/dp: Clamp PCON DSC bpp to the FRL link bandwidth
2026-12-04 8:57 ` [PATCH v5 08/15] drm/i915/dp: Clamp PCON DSC bpp to the FRL link bandwidth Ankit Nautiyal
@ 2026-12-04 9:33 ` sashiko-bot
0 siblings, 0 replies; 29+ messages in thread
From: sashiko-bot @ 2026-12-04 9:33 UTC (permalink / raw)
To: Ankit Nautiyal, intel-gfx, intel-xe; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/i915/hdmi: commit subject mismatches
intel_hdmi_dsc_get_bpp() change
--
commit 8b4e22eb1e4b64b0b98e7622e004d1fabc6aaaef
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
drm/i915/dp: Clamp PCON DSC bpp to the FRL link bandwidth
This commit adds an optional max_link_dsc_bpp parameter to
intel_hdmi_dsc_get_bpp() to cap the selected DSC bpp, while updating the
caller in intel_dp_pcon_dsc_enc_bpp() to pass 0 for now.
> drm/i915/dp: Clamp PCON DSC bpp to the FRL link bandwidth
[Severity: Low]
Should the commit subject reflect that this patch only adds the
max_link_dsc_bpp parameter to intel_hdmi_dsc_get_bpp()?
Nothing in this commit computes or references FRL link bandwidth, and
intel_dp_pcon_dsc_enc_bpp() passes 0 so runtime behavior is unchanged.
Something like "drm/i915/hdmi: Add max_link_dsc_bpp parameter to
intel_hdmi_dsc_get_bpp()" would match the code changes and avoid
misleading readers of git log or bisectors.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204085746.391918-1-ankit.k.nautiyal@intel.com?part=8
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v5 09/15] drm/i915/dp: Add a helper for the FRL payload bandwidth
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
` (7 preceding siblings ...)
2026-12-04 8:57 ` [PATCH v5 08/15] drm/i915/dp: Clamp PCON DSC bpp to the FRL link bandwidth Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 8:57 ` [PATCH v5 10/15] drm/i915/dp: Compute the PCON DSC encoder parameters Ankit Nautiyal
` (6 subsequent siblings)
15 siblings, 0 replies; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
The payload bandwidth of the HDMI FRL link is limited by both the PCON
and the HDMI 2.1 sink. Add a helper for it, so that the following
changes can use it as well.
No functional change.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index e84c060e5563..ca218481182f 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1190,6 +1190,18 @@ static int frl_required_bw(int clock, int bpc,
return clock * bpc * 3;
}
+/*
+ * Both the PCON and the HDMI 2.1 sink limit the FRL rate. FRL uses 16b/18b
+ * line coding, so only 16/18 of the raw rate carries payload. Returns kbps.
+ */
+static int intel_dp_hdmi_frl_payload_bw(struct intel_dp *intel_dp)
+{
+ int max_frl_rate = min(intel_dp->dfp.pcon_max_frl_bw,
+ intel_dp_hdmi_sink_max_frl(intel_dp));
+
+ return max_frl_rate * 1000000 * 16 / 18;
+}
+
static enum drm_mode_status
intel_dp_frl_bw_valid(struct intel_dp *intel_dp, int target_clock,
int bpc, enum intel_output_format sink_format,
@@ -1204,14 +1216,7 @@ intel_dp_frl_bw_valid(struct intel_dp *intel_dp, int target_clock,
target_bw = frl_required_bw(target_clock, bpc, sink_format);
/* check for MAX FRL BW for both PCON and HDMI2.1 sink */
- max_frl_bw = min(intel_dp->dfp.pcon_max_frl_bw,
- intel_dp_hdmi_sink_max_frl(intel_dp));
-
- /*
- * Convert the rate from Gbps to kbps. FRL uses 16b/18b line coding, so
- * only 16/18 of the raw rate carries payload.
- */
- max_frl_bw = max_frl_bw * 1000000 * 16 / 18;
+ max_frl_bw = intel_dp_hdmi_frl_payload_bw(intel_dp);
/* #FIXME check bandwidth with DSC if both PCON and HDMI sink support DSC */
if (target_bw > max_frl_bw)
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* [PATCH v5 10/15] drm/i915/dp: Compute the PCON DSC encoder parameters
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
` (8 preceding siblings ...)
2026-12-04 8:57 ` [PATCH v5 09/15] drm/i915/dp: Add a helper for the FRL payload bandwidth Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 9:52 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 11/15] drm/i915/dp: Retrain the PCON FRL link from the link check work Ankit Nautiyal
` (5 subsequent siblings)
15 siblings, 1 reply; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
When the HDMI link needs DSC, the PCON can only get it from a
compressed DP stream. It decodes that stream and encodes a DSC 1.2
stream for the HDMI sink, which also converts a DSC 1.1 stream, as
HDMI 2.1 supports DSC 1.2 and beyond only.
The encoder parameters are the slice height and width, and the
compressed bpp. Since they describe the stream the HDMI sink receives,
so compute them for the sink format, within the bandwidth of the FRL link.
Currently these are derived at enable time from the stream going out of
the pipe. Instead, derive these during compute config phase and store the
result in the crtc state.
The enable path now only programs the stored values.
Modes that need DSC on the HDMI link are not selectable yet, so there is
no change in behavior.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 196 +++++++++++++-----------
1 file changed, 107 insertions(+), 89 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index ca218481182f..272837cc6efa 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1232,6 +1232,69 @@ intel_dp_pcon_sink_support_frl(struct intel_dp *intel_dp)
intel_dp_hdmi_sink_max_frl(intel_dp);
}
+static bool intel_dp_pcon_can_encode_dsc(struct intel_dp *intel_dp)
+{
+ struct intel_connector *connector = intel_dp->attached_connector;
+
+ return intel_dp_is_hdmi_2_1_sink(intel_dp) &&
+ connector->base.display_info.hdmi.dsc_cap.v_1p2 &&
+ drm_dp_pcon_enc_is_dsc_1_2(intel_dp->pcon_dsc_dpcd);
+}
+
+/*
+ * Compute the PCON DSC encoder parameters for the stream sent to the HDMI
+ * sink, which is in @sink_format. @enc can be NULL to only check feasibility.
+ */
+static bool
+intel_dp_pcon_dsc_enc_compute(struct intel_dp *intel_dp,
+ const struct drm_display_mode *mode, int pixel_clock,
+ int bpc, enum intel_output_format sink_format,
+ struct intel_pcon_dsc_enc_config *enc)
+{
+ struct intel_connector *connector = intel_dp->attached_connector;
+ const struct drm_display_info *info = &connector->base.display_info;
+ int pcon_max_slices = drm_dp_pcon_dsc_max_slices(intel_dp->pcon_dsc_dpcd);
+ int pcon_max_slice_width = drm_dp_pcon_dsc_max_slice_width(intel_dp->pcon_dsc_dpcd);
+ int slice_height, num_slices, slice_width, max_link_dsc_bpp, bpp_x16;
+
+ if (!intel_dp_pcon_can_encode_dsc(intel_dp))
+ return false;
+
+ slice_height = intel_hdmi_dsc_get_slice_height(mode->vdisplay);
+ if (!slice_height)
+ return false;
+
+ num_slices = intel_hdmi_dsc_get_num_slices(mode, pixel_clock, sink_format,
+ pcon_max_slices, pcon_max_slice_width,
+ info->hdmi.dsc_cap.max_slices,
+ info->hdmi.dsc_cap.clk_per_slice);
+ if (!num_slices)
+ return false;
+
+ slice_width = DIV_ROUND_UP(mode->hdisplay, num_slices);
+
+ /* The compressed stream has to fit the FRL link */
+ max_link_dsc_bpp = intel_dp_hdmi_frl_payload_bw(intel_dp) / pixel_clock;
+ if (!max_link_dsc_bpp)
+ return false;
+
+ bpp_x16 = intel_hdmi_dsc_get_bpp(drm_dp_pcon_dsc_bpp_incr(intel_dp->pcon_dsc_dpcd),
+ slice_width, num_slices, sink_format, bpc,
+ info->hdmi.dsc_cap.all_bpp,
+ info->hdmi.dsc_cap.total_chunk_kbytes * 1024,
+ max_link_dsc_bpp);
+ if (!bpp_x16)
+ return false;
+
+ if (enc) {
+ enc->slice_height = slice_height;
+ enc->slice_width = slice_width;
+ enc->bpp_x16 = bpp_x16;
+ }
+
+ return true;
+}
+
static enum drm_mode_status
intel_dp_hdmi_bw_valid(struct intel_dp *intel_dp,
int target_clock, int bpc,
@@ -3021,14 +3084,47 @@ bool intel_dp_joiner_needs_dsc(struct intel_display *display,
static int
intel_dp_pcon_compute_config(struct intel_dp *intel_dp,
- struct intel_crtc_state *crtc_state)
+ struct intel_crtc_state *crtc_state,
+ bool respect_downstream_limits)
{
+ struct intel_display *display = to_intel_display(intel_dp);
+ const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
+ int bpc = crtc_state->pipe_bpp / 3;
+
if (!intel_dp_is_hdmi_2_1_sink(intel_dp))
return 0;
if (crtc_state->dsc.compression_enable)
crtc_state->pcon_config.dsc_op = INTEL_PCON_DSC_DECODE;
+ if (!respect_downstream_limits || !intel_dp_pcon_sink_support_frl(intel_dp))
+ return 0;
+
+ if (intel_dp_frl_bw_valid(intel_dp, adjusted_mode->crtc_clock, bpc,
+ crtc_state->sink_format, true) == MODE_OK)
+ return 0;
+
+ /*
+ * The HDMI link needs DSC. The PCON can only get it from a compressed DP
+ * stream.
+ *
+ * A DSC 1.1 stream has to be converted to DSC 1.2, as HDMI 2.1
+ * supports DSC 1.2 and beyond only. The spec has the pass-through for
+ * a DSC 1.2a stream, which is not handled yet, so the PCON DSC encoder
+ * is used for it as well.
+ */
+ if (!crtc_state->dsc.compression_enable ||
+ !intel_dp_pcon_dsc_enc_compute(intel_dp, adjusted_mode,
+ adjusted_mode->crtc_clock, bpc,
+ crtc_state->sink_format,
+ &crtc_state->pcon_config.dsc_enc)) {
+ drm_dbg_kms(display->drm,
+ "HDMI link needs DSC, but the PCON can't provide it\n");
+ return -EINVAL;
+ }
+
+ crtc_state->pcon_config.dsc_op = INTEL_PCON_DSC_DECODE_ENCODE;
+
return 0;
}
@@ -3117,7 +3213,8 @@ intel_dp_compute_link_for_joined_pipes(struct intel_encoder *encoder,
return -EINVAL;
}
- ret = intel_dp_pcon_compute_config(intel_dp, pipe_config);
+ ret = intel_dp_pcon_compute_config(intel_dp, pipe_config,
+ respect_downstream_limits);
if (ret)
return ret;
@@ -4540,79 +4637,16 @@ void intel_dp_check_frl_training(struct intel_dp *intel_dp)
}
}
-static int
-intel_dp_pcon_dsc_enc_slice_height(const struct intel_crtc_state *crtc_state)
-{
- int vactive = crtc_state->hw.adjusted_mode.vdisplay;
-
- return intel_hdmi_dsc_get_slice_height(vactive);
-}
-
-static int
-intel_dp_pcon_dsc_enc_slices(struct intel_dp *intel_dp,
- const struct intel_crtc_state *crtc_state)
-{
- struct intel_connector *connector = intel_dp->attached_connector;
- const struct drm_display_info *info = &connector->base.display_info;
- int hdmi_throughput = info->hdmi.dsc_cap.clk_per_slice;
- int hdmi_max_slices = info->hdmi.dsc_cap.max_slices;
- int pcon_max_slices = drm_dp_pcon_dsc_max_slices(intel_dp->pcon_dsc_dpcd);
- int pcon_max_slice_width = drm_dp_pcon_dsc_max_slice_width(intel_dp->pcon_dsc_dpcd);
-
- return intel_hdmi_dsc_get_num_slices(&crtc_state->hw.adjusted_mode,
- crtc_state->hw.adjusted_mode.crtc_clock,
- crtc_state->output_format,
- pcon_max_slices,
- pcon_max_slice_width,
- hdmi_max_slices, hdmi_throughput);
-}
-
-static int
-intel_dp_pcon_dsc_enc_bpp(struct intel_dp *intel_dp,
- const struct intel_crtc_state *crtc_state,
- int num_slices, int slice_width)
-{
- struct intel_connector *connector = intel_dp->attached_connector;
- const struct drm_display_info *info = &connector->base.display_info;
- int output_format = crtc_state->output_format;
- bool hdmi_all_bpp = info->hdmi.dsc_cap.all_bpp;
- int pcon_fractional_bpp = drm_dp_pcon_dsc_bpp_incr(intel_dp->pcon_dsc_dpcd);
- int hdmi_max_chunk_bytes =
- info->hdmi.dsc_cap.total_chunk_kbytes * 1024;
- int bpc = crtc_state->pipe_bpp / 3;
-
- return intel_hdmi_dsc_get_bpp(pcon_fractional_bpp, slice_width,
- num_slices, output_format, bpc, hdmi_all_bpp,
- hdmi_max_chunk_bytes, 0);
-}
-
void
intel_dp_pcon_dsc_configure(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state)
{
struct intel_display *display = to_intel_display(intel_dp);
- struct intel_connector *connector = intel_dp->attached_connector;
- const struct drm_display_info *info;
+ const struct intel_pcon_dsc_enc_config *enc = &crtc_state->pcon_config.dsc_enc;
u8 pps_param[6];
- int slice_height;
- int slice_width;
- int num_slices;
- int bits_per_pixel;
int ret;
- bool hdmi_is_dsc_1_2;
-
- if (!intel_dp_is_hdmi_2_1_sink(intel_dp))
- return;
-
- if (!connector)
- return;
- info = &connector->base.display_info;
-
- hdmi_is_dsc_1_2 = info->hdmi.dsc_cap.v_1p2;
-
- if (!drm_dp_pcon_enc_is_dsc_1_2(intel_dp->pcon_dsc_dpcd) ||
- !hdmi_is_dsc_1_2)
+ if (!intel_dp_pcon_can_encode_dsc(intel_dp))
return;
if (crtc_state->pcon_config.dsc_op != INTEL_PCON_DSC_DECODE_ENCODE) {
@@ -4622,28 +4656,12 @@ intel_dp_pcon_dsc_configure(struct intel_dp *intel_dp,
return;
}
- slice_height = intel_dp_pcon_dsc_enc_slice_height(crtc_state);
- if (!slice_height)
- return;
-
- num_slices = intel_dp_pcon_dsc_enc_slices(intel_dp, crtc_state);
- if (!num_slices)
- return;
-
- slice_width = DIV_ROUND_UP(crtc_state->hw.adjusted_mode.hdisplay,
- num_slices);
-
- bits_per_pixel = intel_dp_pcon_dsc_enc_bpp(intel_dp, crtc_state,
- num_slices, slice_width);
- if (!bits_per_pixel)
- return;
-
- pps_param[0] = slice_height & 0xFF;
- pps_param[1] = slice_height >> 8;
- pps_param[2] = slice_width & 0xFF;
- pps_param[3] = slice_width >> 8;
- pps_param[4] = bits_per_pixel & 0xFF;
- pps_param[5] = (bits_per_pixel >> 8) & 0x3;
+ pps_param[0] = enc->slice_height & 0xFF;
+ pps_param[1] = enc->slice_height >> 8;
+ pps_param[2] = enc->slice_width & 0xFF;
+ pps_param[3] = enc->slice_width >> 8;
+ pps_param[4] = enc->bpp_x16 & 0xFF;
+ pps_param[5] = (enc->bpp_x16 >> 8) & 0x3;
ret = drm_dp_pcon_pps_override_param(&intel_dp->aux, pps_param);
if (ret < 0)
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* Re: [PATCH v5 10/15] drm/i915/dp: Compute the PCON DSC encoder parameters
2026-12-04 8:57 ` [PATCH v5 10/15] drm/i915/dp: Compute the PCON DSC encoder parameters Ankit Nautiyal
@ 2026-12-04 9:52 ` sashiko-bot
0 siblings, 0 replies; 29+ messages in thread
From: sashiko-bot @ 2026-12-04 9:52 UTC (permalink / raw)
To: Ankit Nautiyal, intel-gfx, intel-xe; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/i915/dp: missing PCON and sink DSC capability checks in
compute
--
commit 436e850e3ddf87d0b01bc7a145ea30594fd044f0
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
drm/i915/dp: Compute the PCON DSC encoder parameters
This commit moves computation of the PCON DSC encoder slice height, slice
width, and compressed bpp from enable time to compute config, storing the
parameters in the crtc state for intel_dp_pcon_dsc_configure() to program.
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index ca218481182fd..272837cc6efa4 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1232,6 +1232,69 @@ intel_dp_pcon_sink_support_frl(struct intel_dp *intel_dp)
> intel_dp_hdmi_sink_max_frl(intel_dp);
> }
>
> +static bool intel_dp_pcon_can_encode_dsc(struct intel_dp *intel_dp)
> +{
> + struct intel_connector *connector = intel_dp->attached_connector;
> +
> + return intel_dp_is_hdmi_2_1_sink(intel_dp) &&
> + connector->base.display_info.hdmi.dsc_cap.v_1p2 &&
> + drm_dp_pcon_enc_is_dsc_1_2(intel_dp->pcon_dsc_dpcd);
> +}
> +
> +/*
> + * Compute the PCON DSC encoder parameters for the stream sent to the HDMI
> + * sink, which is in @sink_format. @enc can be NULL to only check feasibility.
> + */
> +static bool
> +intel_dp_pcon_dsc_enc_compute(struct intel_dp *intel_dp,
> + const struct drm_display_mode *mode, int pixel_clock,
> + int bpc, enum intel_output_format sink_format,
> + struct intel_pcon_dsc_enc_config *enc)
> +{
> + struct intel_connector *connector = intel_dp->attached_connector;
> + const struct drm_display_info *info = &connector->base.display_info;
> + int pcon_max_slices = drm_dp_pcon_dsc_max_slices(intel_dp->pcon_dsc_dpcd);
> + int pcon_max_slice_width = drm_dp_pcon_dsc_max_slice_width(intel_dp->pcon_dsc_dpcd);
> + int slice_height, num_slices, slice_width, max_link_dsc_bpp, bpp_x16;
> +
> + if (!intel_dp_pcon_can_encode_dsc(intel_dp))
> + return false;
> +
> + slice_height = intel_hdmi_dsc_get_slice_height(mode->vdisplay);
> + if (!slice_height)
> + return false;
> +
> + num_slices = intel_hdmi_dsc_get_num_slices(mode, pixel_clock, sink_format,
> + pcon_max_slices, pcon_max_slice_width,
> + info->hdmi.dsc_cap.max_slices,
> + info->hdmi.dsc_cap.clk_per_slice);
> + if (!num_slices)
> + return false;
> +
> + slice_width = DIV_ROUND_UP(mode->hdisplay, num_slices);
> +
> + /* The compressed stream has to fit the FRL link */
> + max_link_dsc_bpp = intel_dp_hdmi_frl_payload_bw(intel_dp) / pixel_clock;
> + if (!max_link_dsc_bpp)
> + return false;
> +
> + bpp_x16 = intel_hdmi_dsc_get_bpp(drm_dp_pcon_dsc_bpp_incr(intel_dp->pcon_dsc_dpcd),
> + slice_width, num_slices, sink_format, bpc,
> + info->hdmi.dsc_cap.all_bpp,
> + info->hdmi.dsc_cap.total_chunk_kbytes * 1024,
> + max_link_dsc_bpp);
> + if (!bpp_x16)
> + return false;
> +
> + if (enc) {
> + enc->slice_height = slice_height;
> + enc->slice_width = slice_width;
> + enc->bpp_x16 = bpp_x16;
> + }
> +
> + return true;
> +}
[Severity: Medium]
Should intel_dp_pcon_can_encode_dsc() and intel_dp_pcon_dsc_enc_compute()
validate the PCON and HDMI sink DSC capabilities before accepting a mode?
intel_dp_pcon_can_encode_dsc() checks only the DSC 1.2 version flags and
skips DP_PCON_DSC_ENCODER_SUPPORTED and DP_PCON_DSC_PPS_ENC_OVERRIDE in
DP_PCON_DSC_ENCODER, even though intel_dp_pcon_dsc_configure()
unconditionally writes PPS override parameters.
intel_dp_pcon_dsc_enc_compute() also skips validating sink_format against
info->hdmi.dsc_cap.native_420 (for INTEL_OUTPUT_FORMAT_YCBCR420) and
DP_PCON_DSC_ENC_COLOR_FMT_CAP.
Similarly, bpc is not checked against info->hdmi.dsc_cap.bpc_supported
(which drm_parse_dsc_info() defaults to 8 bpc independently of
uncompressed deep-color support) or DP_PCON_DSC_ENC_COLOR_DEPTH_CAP.
On a PCON or HDMI 2.1 sink whose DSC capabilities are narrower than its
uncompressed ones (for example, 10 bpc uncompressed but only 8 bpc with
DSC), intel_dp_pcon_compute_config() will accept the mode and program
unsupported parameters, causing blank or corrupted display output.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204085746.391918-1-ankit.k.nautiyal@intel.com?part=10
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v5 11/15] drm/i915/dp: Retrain the PCON FRL link from the link check work
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
` (9 preceding siblings ...)
2026-12-04 8:57 ` [PATCH v5 10/15] drm/i915/dp: Compute the PCON DSC encoder parameters Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 9:52 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 12/15] drm/i915/dp: Store the PCON FRL rate in the crtc state Ankit Nautiyal
` (4 subsequent siblings)
15 siblings, 1 reply; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
When the HDMI link of a PCON goes down while the stream is active, the
HDMI link status change handler restarts the FRL training, or falls back
to TMDS mode, directly from the short pulse handling. That runs without
any modeset lock, so it can race with a modeset that trains the link as
well, and it has no access to the state of the active stream.
Queue the link check work instead, as it is done for the DP link
retraining, and restart the FRL training there, with the modeset locks
held and only if a stream is active. The work restarts the training only
if the FRL link is not trained and the HDMI link is not active, so it
does nothing after a fallback to TMDS mode.
This allows to use the state of the active stream for the training in
the following changes.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 43 ++++++++++++++++++-
drivers/gpu/drm/i915/display/intel_dp.h | 2 +
.../drm/i915/display/intel_dp_link_training.c | 5 ++-
3 files changed, 47 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 272837cc6efa..2e92e4898ee6 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -4637,6 +4637,42 @@ void intel_dp_check_frl_training(struct intel_dp *intel_dp)
}
}
+/*
+ * Restart FRL training after the HDMI link went down while the stream is
+ * active, or fall back to TMDS mode.
+ */
+int intel_dp_pcon_frl_recover(struct intel_encoder *encoder,
+ struct drm_modeset_acquire_ctx *ctx)
+{
+ struct intel_display *display = to_intel_display(encoder);
+ struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
+ u8 pipe_mask;
+ int ret;
+
+ if (!(intel_dp->downstream_ports[2] & DP_PCON_SOURCE_CTL_MODE) ||
+ !intel_dp_is_hdmi_2_1_sink(intel_dp) ||
+ intel_dp->frl.is_trained ||
+ drm_dp_pcon_hdmi_link_active(&intel_dp->aux))
+ return 0;
+
+ /* The connection mutex may be held already by the link retraining */
+ ret = drm_modeset_lock(&display->drm->mode_config.connection_mutex, ctx);
+ if (ret && ret != -EALREADY)
+ return ret;
+
+ ret = intel_dp_get_active_pipes(intel_dp, ctx, &pipe_mask);
+ if (ret)
+ return ret;
+
+ /* Without an active stream the next enable trains the link */
+ if (pipe_mask == 0)
+ return 0;
+
+ intel_dp_check_frl_training(intel_dp);
+
+ return 0;
+}
+
void
intel_dp_pcon_dsc_configure(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state)
@@ -6060,8 +6096,11 @@ intel_dp_handle_hdmi_link_status_change(struct intel_dp *intel_dp)
intel_dp->frl.is_trained = false;
- /* Restart FRL training or fall back to TMDS mode */
- intel_dp_check_frl_training(intel_dp);
+ /*
+ * Restart FRL training or fall back to TMDS mode, from the link
+ * check work, where the modeset locks can be taken.
+ */
+ intel_encoder_link_check_queue_work(&dp_to_dig_port(intel_dp)->base, 0);
}
}
diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
index 1f4a3aff9abe..070f6229cc39 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.h
+++ b/drivers/gpu/drm/i915/display/intel_dp.h
@@ -188,6 +188,8 @@ void intel_dp_sync_state(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state);
void intel_dp_check_frl_training(struct intel_dp *intel_dp);
+int intel_dp_pcon_frl_recover(struct intel_encoder *encoder,
+ struct drm_modeset_acquire_ctx *ctx);
void intel_dp_pcon_dsc_configure(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state);
diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
index 1efc78b329a6..2c18590bcbff 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
@@ -2635,8 +2635,11 @@ void intel_dp_link_check(struct intel_encoder *encoder)
struct drm_modeset_acquire_ctx ctx;
int ret;
- intel_modeset_lock_ctx_retry(&ctx, NULL, 0, ret)
+ intel_modeset_lock_ctx_retry(&ctx, NULL, 0, ret) {
ret = intel_dp_retrain_link(encoder, &ctx);
+ if (!ret)
+ ret = intel_dp_pcon_frl_recover(encoder, &ctx);
+ }
}
void intel_dp_check_link_state(struct intel_dp *intel_dp)
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* Re: [PATCH v5 11/15] drm/i915/dp: Retrain the PCON FRL link from the link check work
2026-12-04 8:57 ` [PATCH v5 11/15] drm/i915/dp: Retrain the PCON FRL link from the link check work Ankit Nautiyal
@ 2026-12-04 9:52 ` sashiko-bot
0 siblings, 0 replies; 29+ messages in thread
From: sashiko-bot @ 2026-12-04 9:52 UTC (permalink / raw)
To: Ankit Nautiyal, intel-gfx, intel-xe; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 6 potential
issues to consider:
- [Medium] drm/i915/dp: TOCTOU race before hw_done in
intel_dp_pcon_frl_recover()
- [Medium] drm/i915/dp: missing connected check and lock in
intel_dp_pcon_frl_recover()
- [Medium] drm/i915/dp: intel_dp_pcon_frl_recover() accesses AUX on
suspended display
- [Medium] drm/i915/dp: race between intel_dp_pcon_frl_recover() and HPD
pulse work
- [Low] drm/i915/dp: redundant -EALREADY check in
intel_dp_pcon_frl_recover()
- [Low] drm/i915/dp: missing Fixes trailer for commit 9488a030ac91
--
commit 1499fb0865199b2ac41ce39175d24f1ae4317106
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> drm/i915/dp: Retrain the PCON FRL link from the link check work
>
> When the HDMI link of a PCON goes down while the stream is active, the
> HDMI link status change handler restarts the FRL training, or falls back
> to TMDS mode, directly from the short pulse handling. That runs without
> any modeset lock, so it can race with a modeset that trains the link as
> well, and it has no access to the state of the active stream.
>
> Queue the link check work instead, as it is done for the DP link
> retraining, and restart the FRL training there, with the modeset locks
> held and only if a stream is active. The work restarts the training only
> if the FRL link is not trained and the HDMI link is not active, so it
> does nothing after a fallback to TMDS mode.
>
> This allows to use the state of the active stream for the training in
> the following changes.
>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
[Severity: Low]
This fixes a concurrency bug in intel_dp_handle_hdmi_link_status_change().
Should this include:
Fixes: 9488a030ac91 ("drm/i915: Add support for enabling link status and recovery")
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 272837cc6efa4..2e92e4898ee6b 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -4637,6 +4637,42 @@ void intel_dp_check_frl_training(struct intel_dp *intel_dp)
> }
> }
>
> +/*
> + * Restart FRL training after the HDMI link went down while the stream is
> + * active, or fall back to TMDS mode.
> + */
> +int intel_dp_pcon_frl_recover(struct intel_encoder *encoder,
> + struct drm_modeset_acquire_ctx *ctx)
> +{
> + struct intel_display *display = to_intel_display(encoder);
> + struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> + u8 pipe_mask;
> + int ret;
> +
> + if (!(intel_dp->downstream_ports[2] & DP_PCON_SOURCE_CTL_MODE) ||
> + !intel_dp_is_hdmi_2_1_sink(intel_dp) ||
> + intel_dp->frl.is_trained ||
> + drm_dp_pcon_hdmi_link_active(&intel_dp->aux))
> + return 0;
[Severity: Medium]
Can intel_dp_pcon_frl_recover() race with intel_dp_detect() and attempt FRL
recovery on a disconnected port?
When the connector is disconnected, intel_dp_retrain_link() returns 0 early
without taking mode_config.connection_mutex, so intel_dp_link_check() still
calls intel_dp_pcon_frl_recover(). This early check then reads
downstream_ports, dpcd, and connector->base.display_info without holding
connection_mutex, racing with intel_dp_detect().
On disconnect while the CRTC is still active, a long HPD clears
frl.is_trained while intel_dp_unset_edid() leaves downstream_ports, dpcd,
and display_info populated. A pending link_check_work then passes the early
check, takes connection_mutex and crtc->base.mutex, and either writes TMDS
fallback DPCD registers to the disconnected port or polls in
intel_dp_pcon_start_frl_training() for up to 1.5 seconds while holding those
locks. Checking intel_dp_is_connected() and locking connection_mutex before
reading the DPCD state would avoid this.
[Severity: Medium]
Can drm_dp_pcon_hdmi_link_active() issue DP AUX transfers against suspended
display hardware on non-TypeC DDI ports?
intel_ddi_init() only sets encoder->suspend_complete (which calls
intel_encoder_link_check_flush_work()) for TypeC encoders, and
__intel_display_driver_pm_suspend() does not flush display->wq.unordered.
Moving FRL recovery from dig_port_work onto encoder->link_check_work allows
a pending work item to run after display access, IRQs, and power domains are
suspended.
Because drm_dp_pcon_hdmi_link_active() runs before acquiring
connection_mutex and checking pipe_mask == 0, it performs AUX MMIO and
runtime PM calls against suspended hardware whenever frl.is_trained is
false. Flushing link_check_work for all DDI encoders on suspend and moving
the AUX read after the active-pipe check would prevent this.
> +
> + /* The connection mutex may be held already by the link retraining */
> + ret = drm_modeset_lock(&display->drm->mode_config.connection_mutex, ctx);
> + if (ret && ret != -EALREADY)
> + return ret;
[Severity: Low]
Is the ret != -EALREADY check needed here? With a non-NULL ctx,
drm_modeset_lock() already converts -EALREADY to 0 internally in
modeset_lock(), so this branch is dead code and "if (ret) return ret;"
matches intel_dp_retrain_link() and intel_dp_get_active_pipes().
> +
> + ret = intel_dp_get_active_pipes(intel_dp, ctx, &pipe_mask);
> + if (ret)
> + return ret;
> +
> + /* Without an active stream the next enable trains the link */
> + if (pipe_mask == 0)
> + return 0;
> +
> + intel_dp_check_frl_training(intel_dp);
[Severity: Medium]
Can intel_dp_pcon_frl_recover() tear down a working TMDS fallback link
because drm_dp_pcon_hdmi_link_active() is checked before
wait_for_connector_hw_done()?
A non-blocking atomic modeset drops the modeset locks and runs
intel_atomic_commit_tail() on display->wq.modeset. If link_check_work runs
concurrently, intel_dp_pcon_frl_recover() reads frl.is_trained and
DP_PCON_HDMI_TX_LINK_STATUS before intel_dp_get_active_pipes() waits on
hw_done, and never re-checks them afterward (unlike intel_dp_retrain_link(),
which re-checks intel_dp_needs_link_retrain()):
CPU0 (wq.modeset) CPU1 (wq.unordered)
intel_atomic_commit_tail()
intel_dp_pcon_frl_recover()
frl.is_trained == false
drm_dp_pcon_hdmi_link_active()
-> false
intel_dp_check_frl_training()
intel_dp_pcon_set_tmds_mode()
signal hw_done
intel_dp_get_active_pipes()
wait_for_connector_hw_done()
intel_dp_check_frl_training()
drm_dp_pcon_frl_prepare()
<-- tears down active TMDS link
When the modeset falls back to TMDS mode, frl.is_trained remains false while
the HDMI link is active in TMDS mode. intel_dp_check_frl_training() then
sees !frl.is_trained and calls drm_dp_pcon_frl_prepare(), disrupting the
active display and repeating up to 1.5 seconds of FRL polling under
connection_mutex and crtc->base.mutex; the pre-wait AUX read can also race
with the in-flight modeset's training. Re-checking frl.is_trained and
drm_dp_pcon_hdmi_link_active() after intel_dp_get_active_pipes() would close
this window.
[Severity: Medium]
Can intel_dp_pcon_frl_recover() race with HPD pulse handling on
frl.is_trained and DP_PCON_HDMI_LINK_CONFIG_1?
Previously, FRL recovery ran in dig_port_work, which serialized it against
intel_dp_hpd_pulse() and intel_dp_handle_hdmi_link_status_change(). In
encoder->link_check_work, intel_dp_pcon_frl_recover() runs on
display->wq.unordered without calling intel_hpd_block(encoder) or sharing a
lock with dig_port_work:
CPU0 (wq.unordered) CPU1 (hotplug.dp_wq)
intel_dp_pcon_frl_recover()
...
intel_dp_pcon_start_frl_training()
intel_dp_pcon_is_frl_trained()
-> true
intel_dp_hpd_pulse() (long HPD)
frl.is_trained = false
frl.is_trained = true <-- overwrites long-HPD reset
Losing the long-HPD reset leaves frl.is_trained set, so the next enable
skips FRL training even though the HDMI link is down. A concurrent short
HPD in intel_dp_handle_hdmi_link_status_change() can also read is_active as
false before training finishes, then see frl.is_trained == true and clear
DP_PCON_ENABLE_HDMI_LINK via an unlocked read-modify-write, tearing down the
freshly trained link. Blocking HPD with intel_hpd_block(encoder) around FRL
recovery would serialize it with dig_port_work.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204085746.391918-1-ankit.k.nautiyal@intel.com?part=11
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v5 12/15] drm/i915/dp: Store the PCON FRL rate in the crtc state
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
` (10 preceding siblings ...)
2026-12-04 8:57 ` [PATCH v5 11/15] drm/i915/dp: Retrain the PCON FRL link from the link check work Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 10:00 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 13/15] drm/i915/dp: Use the FRL rate of the stream on the HDMI link Ankit Nautiyal
` (3 subsequent siblings)
15 siblings, 1 reply; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
Currently the FRL training derives the max rate to train the HDMI link
from the capabilities of the PCON and the HDMI sink, regardless of the
stream that is going to be sent.
Compute the FRL rate together with the PCON DSC operation, store it in
the crtc state and train the link at that rate. For now this is still
the lower of the PCON and sink max rates, so there is no change in
behavior. The upcoming changes will make the rate depend on the stream.
A link that is already trained is kept only if it was trained at least
at the rate the new stream needs, otherwise train it again.
Also reset the trained rate when the sink is gone on a long HPD, now
that it is used to decide if the link has to be retrained.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/i915/display/g4x_dp.c | 2 +-
.../drm/i915/display/intel_crtc_state_dump.c | 5 ++-
drivers/gpu/drm/i915/display/intel_ddi.c | 4 +-
.../drm/i915/display/intel_display_types.h | 2 +
drivers/gpu/drm/i915/display/intel_dp.c | 39 ++++++++++++-------
drivers/gpu/drm/i915/display/intel_dp.h | 3 +-
6 files changed, 34 insertions(+), 21 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/g4x_dp.c b/drivers/gpu/drm/i915/display/g4x_dp.c
index b867443ff227..f8ac6d51f6ff 100644
--- a/drivers/gpu/drm/i915/display/g4x_dp.c
+++ b/drivers/gpu/drm/i915/display/g4x_dp.c
@@ -709,7 +709,7 @@ static void intel_enable_dp(struct intel_atomic_state *state,
intel_dp_set_power(intel_dp, DP_SET_POWER_D0);
intel_dp_configure_protocol_converter(intel_dp, pipe_config);
- intel_dp_check_frl_training(intel_dp);
+ intel_dp_check_frl_training(intel_dp, pipe_config);
intel_dp_pcon_dsc_configure(intel_dp, pipe_config);
intel_dp_start_link_train(state, intel_dp, pipe_config);
intel_dp_stop_link_train(intel_dp, pipe_config);
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 4e9ff59a8d5c..967123a11833 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
@@ -249,8 +249,9 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,
str_enabled_disabled(pipe_config->fec_enable),
str_enabled_disabled(pipe_config->enhanced_framing));
- drm_printf(&p, "pcon: dsc op %s\n",
- pcon_dsc_op_str[pipe_config->pcon_config.dsc_op]);
+ drm_printf(&p, "pcon: dsc op %s, frl rate: %d Gbps\n",
+ pcon_dsc_op_str[pipe_config->pcon_config.dsc_op],
+ pipe_config->pcon_config.frl_rate_gbps);
if (pipe_config->pcon_config.dsc_op == INTEL_PCON_DSC_DECODE_ENCODE)
drm_printf(&p,
"pcon dsc encoder: slice height: %u, slice width: %u, bpp_x16: %u\n",
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index e21c237b39f4..f8357574710c 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -2714,7 +2714,7 @@ static void mtl_ddi_pre_enable_dp(struct intel_atomic_state *state,
*/
intel_dp_sink_set_fec_ready(intel_dp, crtc_state, true);
- intel_dp_check_frl_training(intel_dp);
+ intel_dp_check_frl_training(intel_dp, crtc_state);
intel_dp_pcon_dsc_configure(intel_dp, crtc_state);
/*
@@ -2876,7 +2876,7 @@ static void tgl_ddi_pre_enable_dp(struct intel_atomic_state *state,
*/
intel_dp_sink_set_fec_ready(intel_dp, crtc_state, true);
- intel_dp_check_frl_training(intel_dp);
+ intel_dp_check_frl_training(intel_dp, crtc_state);
intel_dp_pcon_dsc_configure(intel_dp, crtc_state);
/*
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 0103ac569727..e937c249ca9b 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1395,6 +1395,8 @@ struct intel_crtc_state {
enum intel_pcon_dsc_op dsc_op;
/* Only valid for INTEL_PCON_DSC_DECODE_ENCODE */
struct intel_pcon_dsc_enc_config dsc_enc;
+ /* Max FRL rate in Gbps to train the HDMI link at, 0 if no FRL */
+ int frl_rate_gbps;
} pcon_config;
/* DP tunnel used for BW allocation. */
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 2e92e4898ee6..da3aeba84c60 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3094,6 +3094,9 @@ intel_dp_pcon_compute_config(struct intel_dp *intel_dp,
if (!intel_dp_is_hdmi_2_1_sink(intel_dp))
return 0;
+ crtc_state->pcon_config.frl_rate_gbps =
+ min(intel_dp->dfp.pcon_max_frl_bw, intel_dp_hdmi_sink_max_frl(intel_dp));
+
if (crtc_state->dsc.compression_enable)
crtc_state->pcon_config.dsc_op = INTEL_PCON_DSC_DECODE;
@@ -4507,23 +4510,19 @@ intel_dp_pcon_is_frl_trained(struct intel_dp *intel_dp,
return false;
}
-static int intel_dp_pcon_start_frl_training(struct intel_dp *intel_dp)
+static int intel_dp_pcon_start_frl_training(struct intel_dp *intel_dp,
+ const struct intel_crtc_state *crtc_state)
{
struct intel_display *display = to_intel_display(intel_dp);
#define TIMEOUT_FRL_READY_MS 500
#define TIMEOUT_HDMI_LINK_ACTIVE_MS 1000
- int max_frl_bw, max_pcon_frl_bw, max_edid_frl_bw, ret;
+ int max_frl_bw, ret;
u8 max_frl_bw_mask = 0, frl_trained_mask;
bool is_active;
- max_pcon_frl_bw = intel_dp->dfp.pcon_max_frl_bw;
- drm_dbg(display->drm, "PCON max rate = %d Gbps\n", max_pcon_frl_bw);
-
- max_edid_frl_bw = intel_dp_hdmi_sink_max_frl(intel_dp);
- drm_dbg(display->drm, "Sink max rate from EDID = %d Gbps\n",
- max_edid_frl_bw);
-
- max_frl_bw = min(max_edid_frl_bw, max_pcon_frl_bw);
+ max_frl_bw = crtc_state->pcon_config.frl_rate_gbps;
+ drm_dbg(display->drm, "FRL max rate = %d Gbps (PCON max rate = %d Gbps)\n",
+ max_frl_bw, intel_dp->dfp.pcon_max_frl_bw);
if (max_frl_bw <= 0)
return -EINVAL;
@@ -4607,7 +4606,8 @@ int intel_dp_pcon_set_tmds_mode(struct intel_dp *intel_dp)
return 0;
}
-void intel_dp_check_frl_training(struct intel_dp *intel_dp)
+void intel_dp_check_frl_training(struct intel_dp *intel_dp,
+ const struct intel_crtc_state *crtc_state)
{
struct intel_display *display = to_intel_display(intel_dp);
@@ -4617,11 +4617,15 @@ void intel_dp_check_frl_training(struct intel_dp *intel_dp)
* -sink is HDMI2.1
*/
if (!(intel_dp->downstream_ports[2] & DP_PCON_SOURCE_CTL_MODE) ||
- !intel_dp_is_hdmi_2_1_sink(intel_dp) ||
- intel_dp->frl.is_trained)
+ !intel_dp_is_hdmi_2_1_sink(intel_dp))
return;
- if (intel_dp_pcon_start_frl_training(intel_dp) < 0) {
+ /* A link trained at a lower rate than the stream needs has to be retrained */
+ if (intel_dp->frl.is_trained &&
+ intel_dp->frl.trained_rate_gbps >= crtc_state->pcon_config.frl_rate_gbps)
+ return;
+
+ if (intel_dp_pcon_start_frl_training(intel_dp, crtc_state) < 0) {
int ret, mode;
drm_dbg(display->drm,
@@ -4646,6 +4650,7 @@ int intel_dp_pcon_frl_recover(struct intel_encoder *encoder,
{
struct intel_display *display = to_intel_display(encoder);
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
+ struct intel_crtc *crtc;
u8 pipe_mask;
int ret;
@@ -4668,7 +4673,10 @@ int intel_dp_pcon_frl_recover(struct intel_encoder *encoder,
if (pipe_mask == 0)
return 0;
- intel_dp_check_frl_training(intel_dp);
+ /* The stream is on the pipe of the connector's CRTC, locked above */
+ crtc = intel_crtc_for_pipe(display, ffs(pipe_mask) - 1);
+
+ intel_dp_check_frl_training(intel_dp, to_intel_crtc_state(crtc->base.state));
return 0;
}
@@ -7237,6 +7245,7 @@ intel_dp_hpd_pulse(struct intel_digital_port *dig_port, bool long_hpd)
* the next enable.
*/
intel_dp->frl.is_trained = false;
+ intel_dp->frl.trained_rate_gbps = 0;
return IRQ_NONE;
}
diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
index 070f6229cc39..83954c2c28e6 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.h
+++ b/drivers/gpu/drm/i915/display/intel_dp.h
@@ -187,7 +187,8 @@ bool intel_dp_initial_fastset_check(struct intel_encoder *encoder,
void intel_dp_sync_state(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state);
-void intel_dp_check_frl_training(struct intel_dp *intel_dp);
+void intel_dp_check_frl_training(struct intel_dp *intel_dp,
+ const struct intel_crtc_state *crtc_state);
int intel_dp_pcon_frl_recover(struct intel_encoder *encoder,
struct drm_modeset_acquire_ctx *ctx);
void intel_dp_pcon_dsc_configure(struct intel_dp *intel_dp,
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* Re: [PATCH v5 12/15] drm/i915/dp: Store the PCON FRL rate in the crtc state
2026-12-04 8:57 ` [PATCH v5 12/15] drm/i915/dp: Store the PCON FRL rate in the crtc state Ankit Nautiyal
@ 2026-12-04 10:00 ` sashiko-bot
0 siblings, 0 replies; 29+ messages in thread
From: sashiko-bot @ 2026-12-04 10:00 UTC (permalink / raw)
To: Ankit Nautiyal, intel-gfx, intel-xe; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 5 potential
issues to consider:
- [Medium] drm/i915/dp: intel_dp_check_frl_training() leaves stale FRL
state on failure
- [Medium] drm/i915/dp: intel_dp_pcon_frl_recover() fails with zero
frl_rate_gbps
- [Medium] drm/i915/dp: HPD pulse races with FRL training on frl state
and DPCD
- [Medium] drm/i915/dp: unlocked read and TOCTOU in
intel_dp_pcon_frl_recover()
- [Medium] drm/i915/dp: intel_dp_pcon_frl_recover() may see zero
frl_rate_gbps
--
commit c3d65efbf1eff2d1822dd7d0fa85881a9934f871
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
drm/i915/dp: Store the PCON FRL rate in the crtc state
This commit computes the PCON FRL rate in intel_dp_pcon_compute_config(),
stores it in crtc_state->pcon_config.frl_rate_gbps, and uses it during FRL
training and recovery. It also retrains an already-trained FRL link when a
new stream requires a higher rate and clears frl.trained_rate_gbps on long
HPD.
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 2e92e4898ee6b..da3aeba84c602 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
[ ... ]
> @@ -4507,23 +4510,19 @@ intel_dp_pcon_is_frl_trained(struct intel_dp *intel_dp,
> return false;
> }
>
> -static int intel_dp_pcon_start_frl_training(struct intel_dp *intel_dp)
> +static int intel_dp_pcon_start_frl_training(struct intel_dp *intel_dp,
> + const struct intel_crtc_state *crtc_state)
> {
> struct intel_display *display = to_intel_display(intel_dp);
> #define TIMEOUT_FRL_READY_MS 500
> #define TIMEOUT_HDMI_LINK_ACTIVE_MS 1000
> - int max_frl_bw, max_pcon_frl_bw, max_edid_frl_bw, ret;
> + int max_frl_bw, ret;
> u8 max_frl_bw_mask = 0, frl_trained_mask;
> bool is_active;
>
> - max_pcon_frl_bw = intel_dp->dfp.pcon_max_frl_bw;
> - drm_dbg(display->drm, "PCON max rate = %d Gbps\n", max_pcon_frl_bw);
> -
> - max_edid_frl_bw = intel_dp_hdmi_sink_max_frl(intel_dp);
> - drm_dbg(display->drm, "Sink max rate from EDID = %d Gbps\n",
> - max_edid_frl_bw);
> -
> - max_frl_bw = min(max_edid_frl_bw, max_pcon_frl_bw);
> + max_frl_bw = crtc_state->pcon_config.frl_rate_gbps;
> + drm_dbg(display->drm, "FRL max rate = %d Gbps (PCON max rate = %d Gbps)\n",
> + max_frl_bw, intel_dp->dfp.pcon_max_frl_bw);
>
> if (max_frl_bw <= 0)
> return -EINVAL;
[Severity: Medium]
Can crtc_state->pcon_config.frl_rate_gbps be 0 here for a BIOS-inherited
state?
pcon_config is not read out from hardware during
intel_modeset_readout_hw_state(), and intel_dp_initial_fastset_check() does
not force a full modeset for uncompressed DP-to-HDMI PCON outputs. Once
intel_dp_detect() populates the HDMI 2.1 sink caps, an inactive HDMI link
handled by intel_dp_pcon_frl_recover() passes that inherited crtc_state here,
causing intel_dp_pcon_start_frl_training() to return -EINVAL and fall back to
TMDS mode instead of recovering FRL.
[ ... ]
> @@ -4607,7 +4606,8 @@ int intel_dp_pcon_set_tmds_mode(struct intel_dp *intel_dp)
> return 0;
> }
>
> -void intel_dp_check_frl_training(struct intel_dp *intel_dp)
> +void intel_dp_check_frl_training(struct intel_dp *intel_dp,
> + const struct intel_crtc_state *crtc_state)
> {
> struct intel_display *display = to_intel_display(intel_dp);
>
> @@ -4617,11 +4617,15 @@ void intel_dp_check_frl_training(struct intel_dp *intel_dp)
> * -sink is HDMI2.1
> */
> if (!(intel_dp->downstream_ports[2] & DP_PCON_SOURCE_CTL_MODE) ||
> - !intel_dp_is_hdmi_2_1_sink(intel_dp) ||
> - intel_dp->frl.is_trained)
> + !intel_dp_is_hdmi_2_1_sink(intel_dp))
> return;
>
> - if (intel_dp_pcon_start_frl_training(intel_dp) < 0) {
> + /* A link trained at a lower rate than the stream needs has to be retrained */
> + if (intel_dp->frl.is_trained &&
> + intel_dp->frl.trained_rate_gbps >= crtc_state->pcon_config.frl_rate_gbps)
> + return;
> +
> + if (intel_dp_pcon_start_frl_training(intel_dp, crtc_state) < 0) {
> int ret, mode;
>
> drm_dbg(display->drm,
[Severity: Medium]
Does this leave intel_dp->frl.is_trained and intel_dp->frl.trained_rate_gbps
stale if retraining to a higher rate fails?
When retraining runs with frl.is_trained already true,
drm_dp_pcon_frl_prepare() clears DP_PCON_ENABLE_HDMI_LINK and tears down the
previous FRL link. If training then fails and intel_dp_check_frl_training()
switches the PCON to TMDS mode without clearing frl.is_trained and
frl.trained_rate_gbps, later modesets requesting at most the old rate take
the early return and stay stuck in TMDS mode, and intel_dp_pcon_frl_recover()
skips recovery. Resetting both fields before drm_dp_pcon_frl_prepare() would
keep software state in sync with hardware.
> @@ -4646,6 +4650,7 @@ int intel_dp_pcon_frl_recover(struct intel_encoder *encoder,
> {
> struct intel_display *display = to_intel_display(encoder);
> struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> + struct intel_crtc *crtc;
> u8 pipe_mask;
> int ret;
>
> @@ -4668,7 +4673,10 @@ int intel_dp_pcon_frl_recover(struct intel_encoder *encoder,
> if (pipe_mask == 0)
> return 0;
>
> - intel_dp_check_frl_training(intel_dp);
> + /* The stream is on the pipe of the connector's CRTC, locked above */
> + crtc = intel_crtc_for_pipe(display, ffs(pipe_mask) - 1);
> +
> + intel_dp_check_frl_training(intel_dp, to_intel_crtc_state(crtc->base.state));
>
> return 0;
> }
[Severity: Medium]
Can intel_dp_pcon_frl_recover() pass a crtc_state whose
pcon_config.frl_rate_gbps was computed as 0 before EDID detection?
During intel_display_driver_probe(), intel_initial_commit() runs before
intel_hpd_init() and intel_dp_set_edid(). Even on a Type-C port where
intel_ddi_initial_fastset_check() forces a full modeset,
intel_dp_is_hdmi_2_1_sink() is still false during that commit, leaving
frl_rate_gbps at 0 while intel_dp_stop_link_train() queues link_check_work.
Once intel_dp_detect() populates the HDMI 2.1 sink caps,
intel_dp_pcon_frl_recover() runs with frl_rate_gbps == 0, fails with -EINVAL,
and demotes the link to TMDS mode instead of training FRL.
[Severity: Medium]
Can intel_dp_pcon_frl_recover() tear down an active TMDS link because
drm_dp_pcon_hdmi_link_active() is not re-checked after
intel_dp_get_active_pipes()?
CPU0 (commit worker) CPU1 (link_check_work)
intel_atomic_commit_tail() intel_dp_pcon_frl_recover()
... if (frl.is_trained ||
drm_dp_pcon_hdmi_link_active())
/* link not active yet */
intel_dp_get_active_pipes()
wait_for_connector_hw_done()
intel_dp_check_frl_training()
intel_dp_pcon_start_frl_training() /* fails */
intel_dp_pcon_set_tmds_mode()
/* hw_done signalled */
/* unblocks, no re-check */
intel_dp_check_frl_training()
drm_dp_pcon_frl_prepare()
<-- tears down active TMDS link
Because intel_dp_get_active_pipes() waits in wait_for_connector_hw_done() for
in-flight nonblocking commits, an initial check before that wait is stale by
the time it returns. Additionally, when intel_dp_retrain_link() returns
early on !intel_dp_is_connected(intel_dp) without locking
mode_config.connection_mutex, intel_dp_pcon_frl_recover() reads
downstream_ports, dpcd, pcon_dsc_dpcd, and connector->base.display_info
before acquiring connection_mutex, racing with intel_dp_detect().
[ ... ]
> @@ -7237,6 +7245,7 @@ intel_dp_hpd_pulse(struct intel_digital_port *dig_port, bool long_hpd)
> * the next enable.
> */
> intel_dp->frl.is_trained = false;
> + intel_dp->frl.trained_rate_gbps = 0;
>
> return IRQ_NONE;
> }
[Severity: Medium]
Can concurrent HPD pulses race with FRL retraining on intel_dp->frl and
DP_PCON_HDMI_LINK_CONFIG_1?
intel_hpd_block() is not called until intel_dp_start_link_train(), after
intel_dp_check_frl_training(), and i915_digport_work_func() runs
intel_dp_hpd_pulse() without modeset locks:
CPU0 (modeset) CPU1 (i915_digport_work_func)
intel_dp_check_frl_training()
/* is_trained still true */
intel_dp_pcon_start_frl_training()
drm_dp_pcon_frl_prepare()
/* HDMI link inactive */
drm_dp_pcon_frl_enable()
intel_dp_hpd_pulse()
intel_dp_handle_hdmi_link_status_change()
/* sees is_trained && !is_active */
clear DP_PCON_ENABLE_HDMI_LINK
<-- aborts FRL training
frl.is_trained = false
During a rate-upgrade retrain, drm_dp_pcon_frl_prepare() drops the HDMI link
while frl.is_trained is still true and polls for up to 1.5 s, allowing a
short HPD to clear DP_PCON_ENABLE_HDMI_LINK mid-training or clobber
frl.is_trained after training succeeds. Similarly, a long HPD resets
frl.is_trained then frl.trained_rate_gbps in reverse order from
intel_dp_pcon_start_frl_training() with no lock, which can leave is_trained
true with trained_rate_gbps == 0 or lose the disconnect reset.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204085746.391918-1-ankit.k.nautiyal@intel.com?part=12
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v5 13/15] drm/i915/dp: Use the FRL rate of the stream on the HDMI link
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
` (11 preceding siblings ...)
2026-12-04 8:57 ` [PATCH v5 12/15] drm/i915/dp: Store the PCON FRL rate in the crtc state Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 9:58 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 14/15] drm/i915/dp: Pick the bpc for a PCON DSC stream Ankit Nautiyal
` (2 subsequent siblings)
15 siblings, 1 reply; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
Currently the FRL rate stored in the crtc state is the lower of the PCON
and sink max rates, as the previous change only made the rate a part of
the state. The HDMI sink has two max FRL rates: one for uncompressed
video and a separate, possibly lower one for compressed video
transport. The max rate helper returns the lower of the two whenever the
PCON has a DSC encoder, even if the HDMI link carries an uncompressed
stream.
Pass to the helpers whether the stream on the HDMI link is compressed,
and use the regular max rate for an uncompressed stream and the sink DSC
max rate for a compressed one.
The capability checks and the bandwidth check for an uncompressed stream
use the regular rate, the check for a compressed stream the DSC rate.
Store the rate matching the PCON DSC operation in the crtc state, which
the FRL training uses.
As a result, modes that fit the HDMI link uncompressed at the regular
max rate of a sink with a lower DSC max rate are not dropped any more
for a PCON with a DSC encoder.
This makes way for allowing the DSC modes through the FRL bandwidth check
using the rate of the compressed stream.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 44 ++++++++++++++-----------
1 file changed, 25 insertions(+), 19 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index da3aeba84c60..f2505b707cad 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -128,7 +128,7 @@ bool intel_dp_is_edp(struct intel_dp *intel_dp)
}
static void intel_dp_unset_edid(struct intel_dp *intel_dp);
-static int intel_dp_hdmi_sink_max_frl(struct intel_dp *intel_dp);
+static int intel_dp_hdmi_sink_max_frl(struct intel_dp *intel_dp, bool dsc);
static bool intel_dp_is_hdmi_2_1_sink(struct intel_dp *intel_dp);
/* Is link rate UHBR and thus 128b/132b? */
@@ -1191,15 +1191,22 @@ static int frl_required_bw(int clock, int bpc,
}
/*
- * Both the PCON and the HDMI 2.1 sink limit the FRL rate. FRL uses 16b/18b
- * line coding, so only 16/18 of the raw rate carries payload. Returns kbps.
+ * Both the PCON and the HDMI 2.1 sink limit the FRL rate. The sink has a
+ * separate limit for @dsc, a compressed stream on the HDMI link.
*/
-static int intel_dp_hdmi_frl_payload_bw(struct intel_dp *intel_dp)
+static int intel_dp_pcon_max_frl_rate(struct intel_dp *intel_dp, bool dsc)
{
- int max_frl_rate = min(intel_dp->dfp.pcon_max_frl_bw,
- intel_dp_hdmi_sink_max_frl(intel_dp));
+ return min(intel_dp->dfp.pcon_max_frl_bw,
+ intel_dp_hdmi_sink_max_frl(intel_dp, dsc));
+}
- return max_frl_rate * 1000000 * 16 / 18;
+/*
+ * FRL uses 16b/18b line coding, so only 16/18 of the raw rate carries
+ * payload. Returns kbps.
+ */
+static int intel_dp_hdmi_frl_payload_bw(struct intel_dp *intel_dp, bool dsc)
+{
+ return intel_dp_pcon_max_frl_rate(intel_dp, dsc) * 1000000 * 16 / 18;
}
static enum drm_mode_status
@@ -1216,7 +1223,7 @@ intel_dp_frl_bw_valid(struct intel_dp *intel_dp, int target_clock,
target_bw = frl_required_bw(target_clock, bpc, sink_format);
/* check for MAX FRL BW for both PCON and HDMI2.1 sink */
- max_frl_bw = intel_dp_hdmi_frl_payload_bw(intel_dp);
+ max_frl_bw = intel_dp_hdmi_frl_payload_bw(intel_dp, false);
/* #FIXME check bandwidth with DSC if both PCON and HDMI sink support DSC */
if (target_bw > max_frl_bw)
@@ -1229,7 +1236,7 @@ static bool
intel_dp_pcon_sink_support_frl(struct intel_dp *intel_dp)
{
return intel_dp->dfp.pcon_max_frl_bw &&
- intel_dp_hdmi_sink_max_frl(intel_dp);
+ intel_dp_hdmi_sink_max_frl(intel_dp, false);
}
static bool intel_dp_pcon_can_encode_dsc(struct intel_dp *intel_dp)
@@ -1274,7 +1281,7 @@ intel_dp_pcon_dsc_enc_compute(struct intel_dp *intel_dp,
slice_width = DIV_ROUND_UP(mode->hdisplay, num_slices);
/* The compressed stream has to fit the FRL link */
- max_link_dsc_bpp = intel_dp_hdmi_frl_payload_bw(intel_dp) / pixel_clock;
+ max_link_dsc_bpp = intel_dp_hdmi_frl_payload_bw(intel_dp, true) / pixel_clock;
if (!max_link_dsc_bpp)
return false;
@@ -3094,8 +3101,8 @@ intel_dp_pcon_compute_config(struct intel_dp *intel_dp,
if (!intel_dp_is_hdmi_2_1_sink(intel_dp))
return 0;
- crtc_state->pcon_config.frl_rate_gbps =
- min(intel_dp->dfp.pcon_max_frl_bw, intel_dp_hdmi_sink_max_frl(intel_dp));
+ /* The HDMI link carries an uncompressed stream, unless the PCON compresses it */
+ crtc_state->pcon_config.frl_rate_gbps = intel_dp_pcon_max_frl_rate(intel_dp, false);
if (crtc_state->dsc.compression_enable)
crtc_state->pcon_config.dsc_op = INTEL_PCON_DSC_DECODE;
@@ -3127,6 +3134,7 @@ intel_dp_pcon_compute_config(struct intel_dp *intel_dp,
}
crtc_state->pcon_config.dsc_op = INTEL_PCON_DSC_DECODE_ENCODE;
+ crtc_state->pcon_config.frl_rate_gbps = intel_dp_pcon_max_frl_rate(intel_dp, true);
return 0;
}
@@ -4478,7 +4486,7 @@ static int intel_dp_pcon_set_frl_mask(int max_frl)
return 0;
}
-static int intel_dp_hdmi_sink_max_frl(struct intel_dp *intel_dp)
+static int intel_dp_hdmi_sink_max_frl(struct intel_dp *intel_dp, bool dsc)
{
struct intel_connector *connector = intel_dp->attached_connector;
struct drm_connector *drm_connector = &connector->base;
@@ -4487,12 +4495,10 @@ static int intel_dp_hdmi_sink_max_frl(struct intel_dp *intel_dp)
/*
* The sink's DSC max FRL rate only applies to compressed video
- * transport, which requires a DSC 1.2 encoder in the PCON. Without
- * one the HDMI link always carries uncompressed video, for which
- * the regular max FRL rate is the limit.
+ * transport. For uncompressed video the regular max FRL rate is the
+ * limit.
*/
- if (drm_dp_pcon_enc_is_dsc_1_2(intel_dp->pcon_dsc_dpcd) &&
- dsc_max_frl_rate)
+ if (dsc && dsc_max_frl_rate)
return min(max_frl_rate, dsc_max_frl_rate);
return max_frl_rate;
@@ -4578,7 +4584,7 @@ static bool intel_dp_is_hdmi_2_1_sink(struct intel_dp *intel_dp)
{
if (drm_dp_is_branch(intel_dp->dpcd) &&
intel_dp_has_hdmi_sink(intel_dp) &&
- intel_dp_hdmi_sink_max_frl(intel_dp) > 0)
+ intel_dp_hdmi_sink_max_frl(intel_dp, false) > 0)
return true;
return false;
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* Re: [PATCH v5 13/15] drm/i915/dp: Use the FRL rate of the stream on the HDMI link
2026-12-04 8:57 ` [PATCH v5 13/15] drm/i915/dp: Use the FRL rate of the stream on the HDMI link Ankit Nautiyal
@ 2026-12-04 9:58 ` sashiko-bot
0 siblings, 0 replies; 29+ messages in thread
From: sashiko-bot @ 2026-12-04 9:58 UTC (permalink / raw)
To: Ankit Nautiyal, intel-gfx, intel-xe; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [High] drm/i915/dp: FRL link not retrained down to sink DSC max FRL
rate
- [Medium] drm/i915/dp: stale FRL state after failed retrain TMDS
fallback
- [Medium] drm/i915/dp: intel_dp_hdmi_sink_max_frl() ignores zero DSC
max FRL rate
- [Medium] drm/i915/dp: race between FRL retraining and HPD pulse on
intel_dp->frl
--
commit e1a3040089835da203f6f54ee67ab293bf6c6ee8
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
drm/i915/dp: Use the FRL rate of the stream on the HDMI link
This commit passes a boolean indicating whether the HDMI stream is
compressed to the sink and PCON FRL rate helpers, and stores the
matching FRL rate in crtc_state->pcon_config.frl_rate_gbps.
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index da3aeba84c602..f2505b707cad5 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
[ ... ]
> @@ -3094,8 +3101,8 @@ intel_dp_pcon_compute_config(struct intel_dp *intel_dp,
> if (!intel_dp_is_hdmi_2_1_sink(intel_dp))
> return 0;
>
> - crtc_state->pcon_config.frl_rate_gbps =
> - min(intel_dp->dfp.pcon_max_frl_bw, intel_dp_hdmi_sink_max_frl(intel_dp));
> + /* The HDMI link carries an uncompressed stream, unless the PCON compresses it */
> + crtc_state->pcon_config.frl_rate_gbps = intel_dp_pcon_max_frl_rate(intel_dp, false);
[Severity: Medium]
Can a failed FRL retrain now leave intel_dp->frl.is_trained true while the
PCON has fallen back to TMDS mode?
With stream-dependent FRL rates, switching from a PCON DSC mode trained at a
lower rate to an uncompressed mode at a higher rate calls
intel_dp_pcon_start_frl_training() while intel_dp->frl.is_trained is still
true. drm_dp_pcon_frl_prepare() tears down the previous FRL link, and if
training then fails, intel_dp_check_frl_training() switches the PCON to TMDS
via intel_dp_pcon_set_tmds_mode() without clearing intel_dp->frl.is_trained
or intel_dp->frl.trained_rate_gbps.
Later modesets requesting a rate at or below the stale trained_rate_gbps
will then skip FRL training and remain stuck in TMDS mode, and
intel_dp_pcon_frl_recover() will return early because is_trained is still
set.
[Severity: Medium]
Is there a data race between FRL retraining and HPD pulse handling on
intel_dp->frl and DP_PCON_HDMI_LINK_CONFIG_1?
When switching from a lower DSC FRL rate to a higher uncompressed FRL rate,
intel_dp_check_frl_training() runs before intel_dp_start_link_train(), so
intel_hpd_block() is not active yet:
CPU0 CPU1
intel_dp_check_frl_training()
...
drm_dp_pcon_frl_prepare()
/* HDMI link down;
frl.is_trained is true */
intel_dp_hpd_pulse()
...
intel_dp_handle_hdmi_link_status_change()
/* is_trained && !is_active */
clear DP_PCON_ENABLE_HDMI_LINK
<-- aborts FRL retrain
Tearing down the active HDMI link can itself trigger a short HPD.
intel_dp_handle_hdmi_link_status_change() then does an unsynchronized
read-modify-write on DP_PCON_HDMI_LINK_CONFIG_1 and clears
intel_dp->frl.is_trained, causing FRL training to time out and fall back to
TMDS mode. A concurrent long HPD in intel_dp_hpd_pulse() can also race with
the two-field update of trained_rate_gbps and is_trained at the end of
intel_dp_pcon_start_frl_training().
Clearing intel_dp->frl.is_trained before tearing down the link and
synchronizing FRL training with HPD pulse handling (for example via
intel_hpd_block() / intel_hpd_unblock()) would avoid these races.
> @@ -3127,6 +3134,7 @@ intel_dp_pcon_compute_config(struct intel_dp *intel_dp,
> }
>
> crtc_state->pcon_config.dsc_op = INTEL_PCON_DSC_DECODE_ENCODE;
> + crtc_state->pcon_config.frl_rate_gbps = intel_dp_pcon_max_frl_rate(intel_dp, true);
[Severity: High]
Does the FRL training path fail to retrain the link down when switching from
an uncompressed mode to a PCON DSC mode with a lower sink DSC max FRL rate?
When an uncompressed mode trains the FRL link at the sink's regular max rate
(for example 48 Gbps), intel_dp->frl.is_trained and trained_rate_gbps are
not cleared on disable. On a later modeset to a PCON DSC mode capped by
DSC_Max_FRL_Rate (for example 24 Gbps), intel_dp_check_frl_training() checks
trained_rate_gbps >= crtc_state->pcon_config.frl_rate_gbps and returns early
without retraining.
Even if intel_dp->frl.is_trained were false, intel_dp_pcon_is_frl_trained()
also accepts *frl_trained_mask >= max_frl_bw_mask, so
intel_dp_pcon_start_frl_training() jumps straight to frl_trained.
intel_dp_pcon_dsc_configure() then enables the PCON DSC encoder over an FRL
link exceeding the sink's DSC_Max_FRL_Rate, which can cause a blank display
or link failure.
[ ... ]
> @@ -4478,7 +4486,7 @@ static int intel_dp_pcon_set_frl_mask(int max_frl)
> return 0;
> }
>
> -static int intel_dp_hdmi_sink_max_frl(struct intel_dp *intel_dp)
> +static int intel_dp_hdmi_sink_max_frl(struct intel_dp *intel_dp, bool dsc)
> {
> struct intel_connector *connector = intel_dp->attached_connector;
> struct drm_connector *drm_connector = &connector->base;
> @@ -4487,12 +4495,10 @@ static int intel_dp_hdmi_sink_max_frl(struct intel_dp *intel_dp)
>
> /*
> * The sink's DSC max FRL rate only applies to compressed video
> - * transport, which requires a DSC 1.2 encoder in the PCON. Without
> - * one the HDMI link always carries uncompressed video, for which
> - * the regular max FRL rate is the limit.
> + * transport. For uncompressed video the regular max FRL rate is the
> + * limit.
> */
> - if (drm_dp_pcon_enc_is_dsc_1_2(intel_dp->pcon_dsc_dpcd) &&
> - dsc_max_frl_rate)
> + if (dsc && dsc_max_frl_rate)
> return min(max_frl_rate, dsc_max_frl_rate);
>
> return max_frl_rate;
[Severity: Medium]
When dsc is true and the sink reports a zero dsc_max_frl_rate, shouldn't
this return 0 instead of falling back to max_frl_rate?
In HDMI 2.1, a zero DSC_Max_FRL_Rate (or an unrecognized rate code mapped to
0 by drm_get_max_frl_rate()) indicates that compressed transport over FRL is
unsupported. Because intel_dp_pcon_can_encode_dsc() only checks
dsc_cap.v_1p2, falling through to max_frl_rate allows
intel_dp_pcon_dsc_enc_compute() to succeed and intel_dp_pcon_compute_config()
to enable INTEL_PCON_DSC_DECODE_ENCODE at the uncompressed FRL rate, which
can cause link failure or a blank screen.
Changing the condition to "if (dsc)" so it returns min(max_frl_rate,
dsc_max_frl_rate) would return 0 when compressed FRL is unsupported.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204085746.391918-1-ankit.k.nautiyal@intel.com?part=13
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v5 14/15] drm/i915/dp: Pick the bpc for a PCON DSC stream
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
` (12 preceding siblings ...)
2026-12-04 8:57 ` [PATCH v5 13/15] drm/i915/dp: Use the FRL rate of the stream on the HDMI link Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 9:58 ` sashiko-bot
2026-12-04 8:57 ` [PATCH v5 15/15] drm/i915/dp: Allow PCON DSC modes through the FRL bw check Ankit Nautiyal
2026-12-04 11:05 ` ✗ i915.CI.BAT: failure for DP-HDMI PCON DSC fixes (rev5) Patchwork
15 siblings, 1 reply; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
Currently the bpc for the HDMI link is picked only from the bpcs that fit
the FRL link uncompressed. No bpc is found for a mode that needs DSC on
the HDMI link, even though an HDMI 2.1 PCON can decode the DP stream and
encode DSC 1.2 for the HDMI sink.
If the DP stream is compressed and no bpc fits the HDMI link
uncompressed, pick the highest bpc the PCON can encode for the HDMI
link. The PCON can't encode an uncompressed stream, so this is done only
in the pass that compresses the DP stream, after the uncompressed bpcs
are tried.
The mode valid check still prunes such modes. The next change lets them
through.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 43 ++++++++++++++++++++++---
1 file changed, 39 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index f2505b707cad..94744ead1a6e 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1302,6 +1302,20 @@ intel_dp_pcon_dsc_enc_compute(struct intel_dp *intel_dp,
return true;
}
+/*
+ * Whether the PCON can compress a stream that doesn't fit the HDMI FRL link
+ * uncompressed. The DP stream has to be compressed for that as well.
+ */
+static bool
+intel_dp_hdmi_dsc_possible(struct intel_dp *intel_dp,
+ const struct drm_display_mode *mode, int pixel_clock,
+ int bpc, enum intel_output_format sink_format)
+{
+ return intel_dp_pcon_sink_support_frl(intel_dp) &&
+ intel_dp_pcon_dsc_enc_compute(intel_dp, mode, pixel_clock, bpc,
+ sink_format, NULL);
+}
+
static enum drm_mode_status
intel_dp_hdmi_bw_valid(struct intel_dp *intel_dp,
int target_clock, int bpc,
@@ -1835,9 +1849,11 @@ bool intel_dp_supports_dsc(struct intel_dp *intel_dp,
static int intel_dp_hdmi_compute_bpc(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
- int bpc, bool respect_downstream_limits)
+ int bpc, bool respect_downstream_limits,
+ bool dsc)
{
int clock = crtc_state->hw.adjusted_mode.crtc_clock;
+ int max_bpc;
/*
* Current bpc could already be below 8bpc due to
@@ -1854,6 +1870,8 @@ static int intel_dp_hdmi_compute_bpc(struct intel_dp *intel_dp,
if (!respect_downstream_limits)
bpc = 8;
+ max_bpc = bpc;
+
for (; bpc >= 8; bpc -= 2) {
if (intel_hdmi_bpc_possible(crtc_state, bpc,
intel_dp_has_hdmi_sink(intel_dp)) &&
@@ -1862,12 +1880,27 @@ static int intel_dp_hdmi_compute_bpc(struct intel_dp *intel_dp,
return bpc;
}
+ /*
+ * No bpc fits the HDMI link uncompressed. If the DP stream is compressed
+ * the PCON may be able to compress the stream for the HDMI link as well.
+ */
+ if (!dsc || !respect_downstream_limits)
+ return -EINVAL;
+
+ for (bpc = max_bpc; bpc >= 8; bpc -= 2) {
+ if (intel_hdmi_bpc_possible(crtc_state, bpc,
+ intel_dp_has_hdmi_sink(intel_dp)) &&
+ intel_dp_hdmi_dsc_possible(intel_dp, &crtc_state->hw.adjusted_mode,
+ clock, bpc, crtc_state->sink_format))
+ return bpc;
+ }
+
return -EINVAL;
}
static int intel_dp_max_bpp(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
- bool respect_downstream_limits)
+ bool respect_downstream_limits, bool dsc)
{
struct intel_display *display = to_intel_display(intel_dp);
struct intel_connector *connector = intel_dp->attached_connector;
@@ -1882,7 +1915,8 @@ static int intel_dp_max_bpp(struct intel_dp *intel_dp,
int max_hdmi_bpc;
max_hdmi_bpc = intel_dp_hdmi_compute_bpc(intel_dp, crtc_state, bpc,
- respect_downstream_limits);
+ respect_downstream_limits,
+ dsc);
if (max_hdmi_bpc < 0)
return 0;
@@ -2964,7 +2998,8 @@ intel_dp_compute_config_limits(struct intel_dp *intel_dp,
limits->pipe.max_bpp = min(crtc_state->max_pipe_bpp, 24);
} else {
limits->pipe.max_bpp = intel_dp_max_bpp(intel_dp, crtc_state,
- respect_downstream_limits);
+ respect_downstream_limits,
+ dsc);
}
if (!dsc && intel_dp_in_hdr_mode(conn_state)) {
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* Re: [PATCH v5 14/15] drm/i915/dp: Pick the bpc for a PCON DSC stream
2026-12-04 8:57 ` [PATCH v5 14/15] drm/i915/dp: Pick the bpc for a PCON DSC stream Ankit Nautiyal
@ 2026-12-04 9:58 ` sashiko-bot
0 siblings, 0 replies; 29+ messages in thread
From: sashiko-bot @ 2026-12-04 9:58 UTC (permalink / raw)
To: Ankit Nautiyal, intel-gfx, intel-xe; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [High] drm/i915/dp: intel_dp_hdmi_compute_bpc() ignores sink and PCON
DSC bpc caps
- [Medium] drm/i915/dp: PCON DSC ignores sink native_420 and PCON color
format caps
- [Medium] drm/i915/dp: intel_dp_check_frl_training() skips lower DSC
FRL retraining
- [Low] drm/i915/dp: intel_dp_hdmi_sink_max_frl() ignores zero DSC FRL
rate
--
commit 1707d6510af7a4b652b9374bcbb1a3e1c3e1df5a
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
drm/i915/dp: Pick the bpc for a PCON DSC stream
This commit adds a fallback in intel_dp_hdmi_compute_bpc() to pick the
highest bpc that an HDMI 2.1 PCON can DSC-encode when no bpc fits the
HDMI FRL link uncompressed and the DP stream is compressed.
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index f2505b707cad5..94744ead1a6e9 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1302,6 +1302,20 @@ intel_dp_pcon_dsc_enc_compute(struct intel_dp *intel_dp,
> return true;
> }
>
> +/*
> + * Whether the PCON can compress a stream that doesn't fit the HDMI FRL link
> + * uncompressed. The DP stream has to be compressed for that as well.
> + */
> +static bool
> +intel_dp_hdmi_dsc_possible(struct intel_dp *intel_dp,
> + const struct drm_display_mode *mode, int pixel_clock,
> + int bpc, enum intel_output_format sink_format)
> +{
> + return intel_dp_pcon_sink_support_frl(intel_dp) &&
> + intel_dp_pcon_dsc_enc_compute(intel_dp, mode, pixel_clock, bpc,
> + sink_format, NULL);
> +}
[Severity: Medium]
Can intel_dp_hdmi_dsc_possible() accept a sink_format that the HDMI sink or
PCON DSC encoder cannot compress?
intel_dp_pcon_dsc_enc_compute() only checks v_1p2 and PCON DSC 1.2 support
via intel_dp_pcon_can_encode_dsc(). It never checks
info->hdmi.dsc_cap.native_420 for INTEL_OUTPUT_FORMAT_YCBCR420 or
DP_PCON_DSC_ENC_COLOR_FMT_CAP in intel_dp->pcon_dsc_dpcd.
On an HDMI 2.1 sink that supports DSC 1.2 for RGB without native 4:2:0 DSC
decoding, driving a 4:2:0 mode that requires FRL DSC will configure PCON DSC
encoding in an unsupported format and produce blank or corrupted output.
[Severity: Low]
What happens here if the HDMI sink advertises DSC 1.2 support but reports a
DSC_Max_FRL_Rate of 0 (or an unrecognized rate code that
drm_get_max_frl_rate() maps to 0)?
intel_dp_pcon_dsc_enc_compute() calls intel_dp_hdmi_frl_payload_bw(intel_dp,
true), which reaches intel_dp_hdmi_sink_max_frl():
drivers/gpu/drm/i915/display/intel_dp.c:intel_dp_hdmi_sink_max_frl() {
...
if (dsc && dsc_max_frl_rate)
return min(max_frl_rate, dsc_max_frl_rate);
return max_frl_rate;
}
When dsc is true and dsc_max_frl_rate is 0, this falls through and returns
the uncompressed max_frl_rate instead of 0. PCON DSC is then enabled on a
sink that does not advertise compressed FRL transport, causing link failure.
Checking if (dsc) without && dsc_max_frl_rate would return 0 and let
intel_dp_pcon_dsc_enc_compute() reject the mode cleanly.
[ ... ]
> @@ -1862,12 +1880,27 @@ static int intel_dp_hdmi_compute_bpc(struct intel_dp *intel_dp,
> return bpc;
> }
>
> + /*
> + * No bpc fits the HDMI link uncompressed. If the DP stream is compressed
> + * the PCON may be able to compress the stream for the HDMI link as well.
> + */
> + if (!dsc || !respect_downstream_limits)
> + return -EINVAL;
> +
> + for (bpc = max_bpc; bpc >= 8; bpc -= 2) {
> + if (intel_hdmi_bpc_possible(crtc_state, bpc,
> + intel_dp_has_hdmi_sink(intel_dp)) &&
> + intel_dp_hdmi_dsc_possible(intel_dp, &crtc_state->hw.adjusted_mode,
> + clock, bpc, crtc_state->sink_format))
> + return bpc;
> + }
> +
> return -EINVAL;
> }
[Severity: High]
Should this loop validate bpc against the sink and PCON DSC color depth
capabilities rather than only uncompressed HDMI deep-color limits?
intel_hdmi_bpc_possible() only checks uncompressed EDID deep-color flags,
and neither intel_dp_hdmi_dsc_possible() nor intel_dp_pcon_dsc_enc_compute()
checks info->hdmi.dsc_cap.bpc_supported or DP_PCON_DSC_ENC_COLOR_DEPTH_CAP
in intel_dp->pcon_dsc_dpcd.
On an HDMI 2.1 sink that advertises 12 bpc uncompressed deep color but only
8 or 10 bpc in its HF-VSDB DSC capabilities, this picks 12 bpc and
configures an unsupported compressed color depth, resulting in a blank or
corrupted screen.
[Severity: Medium]
Now that this loop allows switching to a PCON DSC stream, does
intel_dp_check_frl_training() fail to retrain the FRL link down when the
sink's DSC_Max_FRL_Rate is lower than its uncompressed Max_FRL_Rate?
After an uncompressed modeset trains the FRL link at a higher rate (for
example 48 Gbps), intel_dp->frl.is_trained stays true across modesets. A
later PCON DSC modeset sets crtc_state->pcon_config.frl_rate_gbps to the
lower compressed rate (for example 24 Gbps), but this returns early:
drivers/gpu/drm/i915/display/intel_dp.c:intel_dp_check_frl_training() {
...
if (intel_dp->frl.is_trained &&
intel_dp->frl.trained_rate_gbps >= crtc_state->pcon_config.frl_rate_gbps)
return;
...
}
intel_dp_pcon_is_frl_trained() has the same *frl_trained_mask >=
max_frl_bw_mask check. The PCON then transmits compressed video above the
sink's DSC_Max_FRL_Rate, breaking display output on the mode switch.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204085746.391918-1-ankit.k.nautiyal@intel.com?part=14
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v5 15/15] drm/i915/dp: Allow PCON DSC modes through the FRL bw check
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
` (13 preceding siblings ...)
2026-12-04 8:57 ` [PATCH v5 14/15] drm/i915/dp: Pick the bpc for a PCON DSC stream Ankit Nautiyal
@ 2026-12-04 8:57 ` Ankit Nautiyal
2026-12-04 9:53 ` sashiko-bot
2026-12-04 11:05 ` ✗ i915.CI.BAT: failure for DP-HDMI PCON DSC fixes (rev5) Patchwork
15 siblings, 1 reply; 29+ messages in thread
From: Ankit Nautiyal @ 2026-12-04 8:57 UTC (permalink / raw)
To: intel-gfx, intel-xe
Cc: dri-devel, alexander.kaplan, suraj.kandpal, Ankit Nautiyal
Currently the FRL bandwidth check rejects every mode whose uncompressed
bandwidth exceeds the FRL rate, even though an HDMI 2.1 PCON can decode
the DP stream and encode DSC 1.2 for the HDMI sink. High bandwidth modes
(e.g. 4k120, 8k60) get pruned for such PCONs, although the PCON and the
sink can carry them. The previous change lets the bpc selection use the
DSC encoder of the PCON, but the mode valid check still prunes such
modes.
Accept such a mode in the mode valid check if the HDMI link can carry it
compressed, and the DP stream can be compressed too: the PCON can't
encode an uncompressed stream. This is the same check that the bpc
selection uses, so a mode that is listed can also be configured.
The DP spec defines the decoding and re-encoding only for a DSC v1.1
source, and the pass-through for a DSC v1.2a (or higher) one. The
pass-through is not handled here, so a DSC 1.2a stream is re-encoded as
well for now.
Tested with a BizLink USB-C to DP80 cable (PCON) and an HDMI 2.1 panel
This takes care of the FIXME in the FRL bandwidth check.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 94744ead1a6e..be40a882e90d 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1225,7 +1225,6 @@ intel_dp_frl_bw_valid(struct intel_dp *intel_dp, int target_clock,
/* check for MAX FRL BW for both PCON and HDMI2.1 sink */
max_frl_bw = intel_dp_hdmi_frl_payload_bw(intel_dp, false);
- /* #FIXME check bandwidth with DSC if both PCON and HDMI sink support DSC */
if (target_bw > max_frl_bw)
return MODE_CLOCK_HIGH;
@@ -1339,12 +1338,22 @@ intel_dp_mode_valid_downstream(struct intel_connector *connector,
{
struct intel_dp *intel_dp = intel_attached_dp(connector);
int bpc = 8; /* Assume 8bpc for the DP++/HDMI/DVI TMDS/FRL bw check */
+ enum drm_mode_status status;
if (intel_dp->dfp.max_dotclock &&
target_clock > intel_dp->dfp.max_dotclock)
return MODE_CLOCK_HIGH;
- return intel_dp_hdmi_bw_valid(intel_dp, target_clock, bpc, sink_format, true);
+ status = intel_dp_hdmi_bw_valid(intel_dp, target_clock, bpc, sink_format, true);
+ if (status != MODE_CLOCK_HIGH)
+ return status;
+
+ /* The PCON may be able to compress the stream for the HDMI link */
+ if (intel_dp_has_dsc(connector) &&
+ intel_dp_hdmi_dsc_possible(intel_dp, mode, target_clock, bpc, sink_format))
+ return MODE_OK;
+
+ return status;
}
static enum drm_mode_status
--
2.50.1
^ permalink raw reply related [flat|nested] 29+ messages in thread* Re: [PATCH v5 15/15] drm/i915/dp: Allow PCON DSC modes through the FRL bw check
2026-12-04 8:57 ` [PATCH v5 15/15] drm/i915/dp: Allow PCON DSC modes through the FRL bw check Ankit Nautiyal
@ 2026-12-04 9:53 ` sashiko-bot
0 siblings, 0 replies; 29+ messages in thread
From: sashiko-bot @ 2026-12-04 9:53 UTC (permalink / raw)
To: Ankit Nautiyal, intel-gfx, intel-xe; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] drm/i915/dp: PCON DSC mode_valid misses per-mode DP DSC and
FEC checks
- [Medium] drm/i915/dp: FRL training skips rate reduction for PCON DSC
modes
- [Medium] drm/i915/dp: PCON DSC compute omits sink/PCON format, bpc,
and PPS caps
--
commit bc75fbbf3bd6bf6b6b5b7a81601106a79bf3cab6
Author: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
drm/i915/dp: Allow PCON DSC modes through the FRL bw check
This commit updates intel_dp_mode_valid_downstream() to accept modes that
exceed uncompressed HDMI FRL bandwidth when both connector DP DSC and PCON
HDMI DSC encoding are available, and removes the corresponding FIXME comment
in intel_dp_frl_bw_valid().
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 94744ead1a6e9..be40a882e90da 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
[ ... ]
> @@ -1339,12 +1338,22 @@ intel_dp_mode_valid_downstream(struct intel_connector *connector,
> {
> struct intel_dp *intel_dp = intel_attached_dp(connector);
> int bpc = 8; /* Assume 8bpc for the DP++/HDMI/DVI TMDS/FRL bw check */
> + enum drm_mode_status status;
>
> if (intel_dp->dfp.max_dotclock &&
> target_clock > intel_dp->dfp.max_dotclock)
> return MODE_CLOCK_HIGH;
>
> - return intel_dp_hdmi_bw_valid(intel_dp, target_clock, bpc, sink_format, true);
> + status = intel_dp_hdmi_bw_valid(intel_dp, target_clock, bpc, sink_format, true);
> + if (status != MODE_CLOCK_HIGH)
> + return status;
> +
> + /* The PCON may be able to compress the stream for the HDMI link */
> + if (intel_dp_has_dsc(connector) &&
> + intel_dp_hdmi_dsc_possible(intel_dp, mode, target_clock, bpc, sink_format))
> + return MODE_OK;
> +
> + return status;
> }
[Severity: Medium]
Is checking intel_dp_has_dsc() sufficient here to guarantee that DP DSC can
be enabled for the mode?
intel_dp_has_dsc() only checks static connector capabilities and skips FEC
support, intel_dp_mode_valid_with_dsc(), joiner needs, and DSC bubble
dotclock limits. In intel_dp_mode_valid_format(), a mode that fits the DP
link uncompressed still reaches here even when local dsc is false.
At modeset time, intel_dp_compute_formats() with respect_downstream_limits
set requires DP DSC and fails, for example in intel_dp_supports_dsc() without
FEC. intel_dp_compute_config() then falls back to ignoring downstream limits
and either fails with -EINVAL or drives an out-of-spec uncompressed FRL link.
[Severity: Medium]
Does switching from an uncompressed mode to one of these PCON DSC modes leave
the HDMI FRL link running above the sink's DSC_Max_FRL_Rate?
intel_dp_pcon_compute_config() selects the lower dsc_max_frl_rate for PCON
DSC streams, but intel_dp_check_frl_training() skips retraining whenever
frl.trained_rate_gbps >= pcon_config.frl_rate_gbps.
intel_dp_pcon_is_frl_trained() similarly accepts any higher trained mask.
On an HDMI 2.1 sink where dsc_max_frl_rate is below max_frl_rate (such as
40 Gbps vs 48 Gbps), switching from an uncompressed mode to a PCON DSC mode
leaves the FRL link above the sink's DSC limit, which can cause the sink to
reject or corrupt the compressed stream.
[Severity: Medium]
Can intel_dp_hdmi_dsc_possible() accept YCbCr 4:2:0 or deep-color modes that
exceed the HDMI sink's or PCON's DSC encoder capabilities?
intel_dp_pcon_dsc_enc_compute() never checks sink_format against
hdmi.dsc_cap.native_420 or DP_PCON_DSC_ENC_COLOR_FMT_CAP, nor bpc against
hdmi.dsc_cap.bpc_supported or DP_PCON_DSC_ENC_COLOR_DEPTH_CAP.
intel_dp_pcon_can_encode_dsc() also omits DP_PCON_DSC_ENCODER_SUPPORTED and
DP_PCON_DSC_PPS_ENC_OVERRIDE, even though intel_dp_pcon_dsc_configure()
programs PPS override parameters.
On a sink that advertises DSC 1.2 without Native 4:2:0 DSC, or only 8 bpc DSC
while supporting 10/12 bpc uncompressed, unsupported modes pass validation
and get programmed into the PCON, causing blank or corrupted output.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204085746.391918-1-ankit.k.nautiyal@intel.com?part=15
^ permalink raw reply [flat|nested] 29+ messages in thread
* ✗ i915.CI.BAT: failure for DP-HDMI PCON DSC fixes (rev5)
2026-12-04 8:57 [PATCH v5 00/15] DP-HDMI PCON DSC fixes Ankit Nautiyal
` (14 preceding siblings ...)
2026-12-04 8:57 ` [PATCH v5 15/15] drm/i915/dp: Allow PCON DSC modes through the FRL bw check Ankit Nautiyal
@ 2026-12-04 11:05 ` Patchwork
15 siblings, 0 replies; 29+ messages in thread
From: Patchwork @ 2026-12-04 11:05 UTC (permalink / raw)
To: Ankit Nautiyal; +Cc: intel-gfx
[-- Attachment #1: Type: text/plain, Size: 6784 bytes --]
== Series Details ==
Series: DP-HDMI PCON DSC fixes (rev5)
URL : https://patchwork.freedesktop.org/series/171345/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_19668 -> Patchwork_171345v5
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_171345v5 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_171345v5, please notify your bug team (I915-ci-infra@lists.freedesktop.org) to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/index.html
Participating hosts (39 -> 37)
------------------------------
Additional (1): fi-tgl-1115g4
Missing (3): bat-dg2-13 bat-rpls-4 bat-adls-6
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_171345v5:
### IGT changes ###
#### Possible regressions ####
* igt@i915_pm_rpm@module-reload:
- fi-skl-6600u: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19668/fi-skl-6600u/igt@i915_pm_rpm@module-reload.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/fi-skl-6600u/igt@i915_pm_rpm@module-reload.html
Known issues
------------
Here are the changes found in Patchwork_171345v5 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_huc_copy@huc-copy:
- fi-tgl-1115g4: NOTRUN -> [SKIP][3] ([i915#2190])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/fi-tgl-1115g4/igt@gem_huc_copy@huc-copy.html
* igt@gem_lmem_swapping@parallel-random-engines:
- fi-tgl-1115g4: NOTRUN -> [SKIP][4] ([i915#4613]) +3 other tests skip
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/fi-tgl-1115g4/igt@gem_lmem_swapping@parallel-random-engines.html
* igt@i915_selftest@live@sanitycheck:
- fi-kbl-7567u: [PASS][5] -> [DMESG-WARN][6] ([i915#13735]) +46 other tests dmesg-warn
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19668/fi-kbl-7567u/igt@i915_selftest@live@sanitycheck.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/fi-kbl-7567u/igt@i915_selftest@live@sanitycheck.html
* igt@intel_hwmon@hwmon-read:
- fi-tgl-1115g4: NOTRUN -> [SKIP][7] ([i915#7707]) +1 other test skip
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/fi-tgl-1115g4/igt@intel_hwmon@hwmon-read.html
* igt@kms_busy@basic@flip:
- fi-kbl-7567u: [PASS][8] -> [DMESG-WARN][9] ([i915#13735] / [i915#180])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19668/fi-kbl-7567u/igt@kms_busy@basic@flip.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/fi-kbl-7567u/igt@kms_busy@basic@flip.html
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-tgl-1115g4: NOTRUN -> [SKIP][10] ([i915#4103]) +1 other test skip
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/fi-tgl-1115g4/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
* igt@kms_dsc@dsc-basic:
- fi-tgl-1115g4: NOTRUN -> [SKIP][11] ([i915#16361])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/fi-tgl-1115g4/igt@kms_dsc@dsc-basic.html
* igt@kms_force_connector_basic@force-load-detect:
- fi-tgl-1115g4: NOTRUN -> [SKIP][12] ([i915#17452])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/fi-tgl-1115g4/igt@kms_force_connector_basic@force-load-detect.html
* igt@kms_pm_backlight@basic-brightness:
- fi-tgl-1115g4: NOTRUN -> [SKIP][13] ([i915#12343] / [i915#9812])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/fi-tgl-1115g4/igt@kms_pm_backlight@basic-brightness.html
* igt@kms_pm_rpm@basic-pci-d3-state:
- fi-kbl-7567u: [PASS][14] -> [DMESG-WARN][15] ([i915#13735] / [i915#15673] / [i915#180]) +52 other tests dmesg-warn
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19668/fi-kbl-7567u/igt@kms_pm_rpm@basic-pci-d3-state.html
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/fi-kbl-7567u/igt@kms_pm_rpm@basic-pci-d3-state.html
* igt@kms_psr@psr-primary-page-flip:
- fi-tgl-1115g4: NOTRUN -> [SKIP][16] ([i915#9732]) +3 other tests skip
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/fi-tgl-1115g4/igt@kms_psr@psr-primary-page-flip.html
* igt@kms_setmode@basic-clone-single-crtc:
- fi-tgl-1115g4: NOTRUN -> [SKIP][17] ([i915#3555])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/fi-tgl-1115g4/igt@kms_setmode@basic-clone-single-crtc.html
#### Possible fixes ####
* igt@i915_selftest@live:
- fi-bsw-n3050: [ABORT][18] ([i915#17765] / [i915#17881]) -> [PASS][19] +1 other test pass
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19668/fi-bsw-n3050/igt@i915_selftest@live.html
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/fi-bsw-n3050/igt@i915_selftest@live.html
[i915#12343]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12343
[i915#13735]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13735
[i915#15673]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/15673
[i915#16361]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/16361
[i915#17452]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/17452
[i915#17765]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/17765
[i915#17881]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/17881
[i915#180]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/180
[i915#2190]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/2190
[i915#3555]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/3555
[i915#4103]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/4103
[i915#4613]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/4613
[i915#7707]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/7707
[i915#9732]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/9732
[i915#9812]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/9812
Build changes
-------------
* Linux: CI_DRM_19668 -> Patchwork_171345v5
CI-20190529: 20190529
CI_DRM_19668: 60d94dca4747e725c2128a008e0cf8f17a4a0f84 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_9224: 9224
Patchwork_171345v5: 60d94dca4747e725c2128a008e0cf8f17a4a0f84 @ git://anongit.freedesktop.org/gfx-ci/linux
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_171345v5/index.html
[-- Attachment #2: Type: text/html, Size: 7950 bytes --]
^ permalink raw reply [flat|nested] 29+ messages in thread