* [PATCH v2 1/5] drm/dp: Always use enhanced framing for DPCD r1.2+
2026-10-29 10:18 [PATCH v2 0/5] drm/dp: Always use enhanced framing for DPCD r1.2+ Dmytro Malovanyi
@ 2026-10-29 10:18 ` Dmytro Malovanyi
2026-10-29 11:54 ` Jani Nikula
2026-10-29 10:18 ` [PATCH v2 2/5] drm/bridge: cdns-mhdp8546: Use drm_dp_enhanced_frame_cap() Dmytro Malovanyi
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Dmytro Malovanyi @ 2026-10-29 10:18 UTC (permalink / raw)
To: dri-devel
Cc: Jani Nikula, Ville Syrjälä,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Luca Ceresoli, Patrik Jakobsson, Lyude Paul,
Danilo Krummrich, nouveau, intel-gfx, linux-kernel,
Dmytro Malovanyi
DP 1.2 section 2.2.1.1 says "An upstream device interoperating with a
downstream device with DPCD Revision of 1.2 or higher must enable
Enhanced Framing Mode". So for r1.2+ the DPCD revision is enough, the
DP_ENHANCED_FRAME_CAP bit does not need to be checked.
Some sinks get this bit wrong. The Xiaomi Monitor A24i (P24FBA-RAGL)
sets it in the base receiver caps, but clears it in the extended
receiver caps at 0x2200, which are the ones we use:
base: 12 0a c4 01 01 00 01 80 02 00 06 00 00 00 81
extended: 14 0a 44 00 01 00 01 80 02 02 06 00 00 00 81
Through a USB4 dock (CalDigit Element 5) the link trains without
enhanced framing (0x202-0x204: 77 77 81), but the sink never syncs to
the stream (SINK_STATUS 0x205: 00) and shows "No signal". Forcing RBR
does not change it. Connected directly to the laptop the same sink
syncs without enhanced framing, at RBR, HBR and HBR2.
Make drm_dp_enhanced_frame_cap() return true for DPCD r1.2+. This
changes behaviour for every driver using the helper, but only for sinks
which already violate the spec by not setting the bit.
Tested on i915 (Arrow Lake-U), with the dock the link now uses enhanced
framing (0x101: 84) and the sink syncs (0x205: 03).
Fixes: a1d926527b79 ("drm/i915: implement EXTENDED_RECEIVER_CAPABILITY_FIELD_PRESENT")
Cc: stable@vger.kernel.org
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/17719
Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Dmytro Malovanyi <dmitrymalovanyy@gmail.com>
---
include/drm/display/drm_dp_helper.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h
index 5b05a7fbe..4f20f60db 100644
--- a/include/drm/display/drm_dp_helper.h
+++ b/include/drm/display/drm_dp_helper.h
@@ -160,6 +160,10 @@ drm_dp_max_lane_count(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
static inline bool
drm_dp_enhanced_frame_cap(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
{
+ /* DP 1.2 2.2.1.1: enhanced framing is mandatory for DPCD r1.2+ */
+ if (dpcd[DP_DPCD_REV] >= 0x12)
+ return true;
+
return dpcd[DP_DPCD_REV] >= 0x11 &&
(dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP);
}
--
2.50.1 (Apple Git-155)
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v2 1/5] drm/dp: Always use enhanced framing for DPCD r1.2+
2026-10-29 10:18 ` [PATCH v2 1/5] " Dmytro Malovanyi
@ 2026-10-29 11:54 ` Jani Nikula
0 siblings, 0 replies; 11+ messages in thread
From: Jani Nikula @ 2026-10-29 11:54 UTC (permalink / raw)
To: Dmytro Malovanyi, dri-devel
Cc: Ville Syrjälä,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Luca Ceresoli, Patrik Jakobsson, Lyude Paul,
Danilo Krummrich, nouveau, intel-gfx, linux-kernel,
Dmytro Malovanyi, Harry Wentland, Leo Li
On Thu, 29 Oct 2026, Dmytro Malovanyi <dmitrymalovanyy@gmail.com> wrote:
> DP 1.2 section 2.2.1.1 says "An upstream device interoperating with a
> downstream device with DPCD Revision of 1.2 or higher must enable
> Enhanced Framing Mode". So for r1.2+ the DPCD revision is enough, the
> DP_ENHANCED_FRAME_CAP bit does not need to be checked.
>
> Some sinks get this bit wrong. The Xiaomi Monitor A24i (P24FBA-RAGL)
> sets it in the base receiver caps, but clears it in the extended
> receiver caps at 0x2200, which are the ones we use:
>
> base: 12 0a c4 01 01 00 01 80 02 00 06 00 00 00 81
> extended: 14 0a 44 00 01 00 01 80 02 02 06 00 00 00 81
>
> Through a USB4 dock (CalDigit Element 5) the link trains without
> enhanced framing (0x202-0x204: 77 77 81), but the sink never syncs to
> the stream (SINK_STATUS 0x205: 00) and shows "No signal". Forcing RBR
> does not change it. Connected directly to the laptop the same sink
> syncs without enhanced framing, at RBR, HBR and HBR2.
>
> Make drm_dp_enhanced_frame_cap() return true for DPCD r1.2+. This
> changes behaviour for every driver using the helper, but only for sinks
> which already violate the spec by not setting the bit.
>
> Tested on i915 (Arrow Lake-U), with the dock the link now uses enhanced
> framing (0x101: 84) and the sink syncs (0x205: 03).
>
> Fixes: a1d926527b79 ("drm/i915: implement EXTENDED_RECEIVER_CAPABILITY_FIELD_PRESENT")
> Cc: stable@vger.kernel.org
> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/17719
> Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
> Signed-off-by: Dmytro Malovanyi <dmitrymalovanyy@gmail.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
I've bounced the series to intel-gfx and intel-xe to get CI results,
though I don't really expect any regressions.
I'd appreciate acks from other driver vendors too.
> ---
> include/drm/display/drm_dp_helper.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h
> index 5b05a7fbe..4f20f60db 100644
> --- a/include/drm/display/drm_dp_helper.h
> +++ b/include/drm/display/drm_dp_helper.h
> @@ -160,6 +160,10 @@ drm_dp_max_lane_count(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
> static inline bool
> drm_dp_enhanced_frame_cap(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
> {
> + /* DP 1.2 2.2.1.1: enhanced framing is mandatory for DPCD r1.2+ */
> + if (dpcd[DP_DPCD_REV] >= 0x12)
> + return true;
> +
> return dpcd[DP_DPCD_REV] >= 0x11 &&
> (dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP);
> }
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 2/5] drm/bridge: cdns-mhdp8546: Use drm_dp_enhanced_frame_cap()
2026-10-29 10:18 [PATCH v2 0/5] drm/dp: Always use enhanced framing for DPCD r1.2+ Dmytro Malovanyi
2026-10-29 10:18 ` [PATCH v2 1/5] " Dmytro Malovanyi
@ 2026-10-29 10:18 ` Dmytro Malovanyi
2026-10-29 11:58 ` Jani Nikula
2026-10-29 10:18 ` [PATCH v2 3/5] drm/bridge: it6505: " Dmytro Malovanyi
` (2 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Dmytro Malovanyi @ 2026-10-29 10:18 UTC (permalink / raw)
To: dri-devel
Cc: Jani Nikula, Ville Syrjälä,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Luca Ceresoli, Patrik Jakobsson, Lyude Paul,
Danilo Krummrich, nouveau, intel-gfx, linux-kernel,
Dmytro Malovanyi
Use the helper instead of checking DP_ENHANCED_FRAME_CAP directly, so
enhanced framing is used for all DPCD r1.2+ sinks as the spec requires.
Compile tested only.
Signed-off-by: Dmytro Malovanyi <dmitrymalovanyy@gmail.com>
---
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
index f47717bd1..8cab9a3e6 100644
--- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
@@ -1375,7 +1375,7 @@ static int cdns_mhdp_link_up(struct cdns_mhdp_device *mhdp)
mhdp->link.rate = drm_dp_bw_code_to_link_rate(dpcd[1]);
mhdp->link.num_lanes = dpcd[2] & DP_MAX_LANE_COUNT_MASK;
- if (dpcd[2] & DP_ENHANCED_FRAME_CAP)
+ if (drm_dp_enhanced_frame_cap(dpcd))
mhdp->link.capabilities |= DP_LINK_CAP_ENHANCED_FRAMING;
dev_dbg(mhdp->dev, "Set sink device power state via DPCD\n");
--
2.50.1 (Apple Git-155)
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v2 2/5] drm/bridge: cdns-mhdp8546: Use drm_dp_enhanced_frame_cap()
2026-10-29 10:18 ` [PATCH v2 2/5] drm/bridge: cdns-mhdp8546: Use drm_dp_enhanced_frame_cap() Dmytro Malovanyi
@ 2026-10-29 11:58 ` Jani Nikula
0 siblings, 0 replies; 11+ messages in thread
From: Jani Nikula @ 2026-10-29 11:58 UTC (permalink / raw)
To: Dmytro Malovanyi, dri-devel
Cc: Ville Syrjälä,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Luca Ceresoli, Patrik Jakobsson, Lyude Paul,
Danilo Krummrich, nouveau, intel-gfx, linux-kernel,
Dmytro Malovanyi
On Thu, 29 Oct 2026, Dmytro Malovanyi <dmitrymalovanyy@gmail.com> wrote:
> Use the helper instead of checking DP_ENHANCED_FRAME_CAP directly, so
> enhanced framing is used for all DPCD r1.2+ sinks as the spec requires.
>
> Compile tested only.
>
> Signed-off-by: Dmytro Malovanyi <dmitrymalovanyy@gmail.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> index f47717bd1..8cab9a3e6 100644
> --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> @@ -1375,7 +1375,7 @@ static int cdns_mhdp_link_up(struct cdns_mhdp_device *mhdp)
> mhdp->link.rate = drm_dp_bw_code_to_link_rate(dpcd[1]);
> mhdp->link.num_lanes = dpcd[2] & DP_MAX_LANE_COUNT_MASK;
>
> - if (dpcd[2] & DP_ENHANCED_FRAME_CAP)
> + if (drm_dp_enhanced_frame_cap(dpcd))
> mhdp->link.capabilities |= DP_LINK_CAP_ENHANCED_FRAMING;
I note that the driver should probably also switch to
drm_dp_read_dpcd_caps(), but that's beyond the patch at hand.
>
> dev_dbg(mhdp->dev, "Set sink device power state via DPCD\n");
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 3/5] drm/bridge: it6505: Use drm_dp_enhanced_frame_cap()
2026-10-29 10:18 [PATCH v2 0/5] drm/dp: Always use enhanced framing for DPCD r1.2+ Dmytro Malovanyi
2026-10-29 10:18 ` [PATCH v2 1/5] " Dmytro Malovanyi
2026-10-29 10:18 ` [PATCH v2 2/5] drm/bridge: cdns-mhdp8546: Use drm_dp_enhanced_frame_cap() Dmytro Malovanyi
@ 2026-10-29 10:18 ` Dmytro Malovanyi
2026-10-29 12:01 ` Jani Nikula
2026-10-29 10:18 ` [PATCH v2 4/5] drm/gma500: " Dmytro Malovanyi
2026-10-29 10:18 ` [PATCH v2 5/5] drm/nouveau: Use enhanced framing for DPCD r1.2+ Dmytro Malovanyi
4 siblings, 1 reply; 11+ messages in thread
From: Dmytro Malovanyi @ 2026-10-29 10:18 UTC (permalink / raw)
To: dri-devel
Cc: Jani Nikula, Ville Syrjälä,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Luca Ceresoli, Patrik Jakobsson, Lyude Paul,
Danilo Krummrich, nouveau, intel-gfx, linux-kernel,
Dmytro Malovanyi
Use the helper instead of checking DP_ENHANCED_FRAME_CAP directly, so
enhanced framing is used for all DPCD r1.2+ sinks as the spec requires.
Compile tested only.
Signed-off-by: Dmytro Malovanyi <dmitrymalovanyy@gmail.com>
---
drivers/gpu/drm/bridge/ite-it6505.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
index e136ac71e..d798a3db7 100644
--- a/drivers/gpu/drm/bridge/ite-it6505.c
+++ b/drivers/gpu/drm/bridge/ite-it6505.c
@@ -1651,7 +1651,7 @@ static void it6505_parse_link_capabilities(struct it6505 *it6505)
link->rate = drm_dp_bw_code_to_link_rate(it6505->dpcd[1]);
link->num_lanes = it6505->dpcd[2] & DP_MAX_LANE_COUNT_MASK;
- if (it6505->dpcd[2] & DP_ENHANCED_FRAME_CAP)
+ if (drm_dp_enhanced_frame_cap(it6505->dpcd))
link->capabilities = DP_ENHANCED_FRAME_CAP;
DRM_DEV_DEBUG_DRIVER(dev, "DPCD Rev.: %d.%d",
--
2.50.1 (Apple Git-155)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/5] drm/bridge: it6505: Use drm_dp_enhanced_frame_cap()
2026-10-29 10:18 ` [PATCH v2 3/5] drm/bridge: it6505: " Dmytro Malovanyi
@ 2026-10-29 12:01 ` Jani Nikula
0 siblings, 0 replies; 11+ messages in thread
From: Jani Nikula @ 2026-10-29 12:01 UTC (permalink / raw)
To: Dmytro Malovanyi, dri-devel
Cc: Ville Syrjälä,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Luca Ceresoli, Patrik Jakobsson, Lyude Paul,
Danilo Krummrich, nouveau, intel-gfx, linux-kernel,
Dmytro Malovanyi
On Thu, 29 Oct 2026, Dmytro Malovanyi <dmitrymalovanyy@gmail.com> wrote:
> Use the helper instead of checking DP_ENHANCED_FRAME_CAP directly, so
> enhanced framing is used for all DPCD r1.2+ sinks as the spec requires.
>
> Compile tested only.
>
> Signed-off-by: Dmytro Malovanyi <dmitrymalovanyy@gmail.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Here too the driver should probably use drm_dp_read_dpcd_caps(), but
again beyond the patch.
> ---
> drivers/gpu/drm/bridge/ite-it6505.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
> index e136ac71e..d798a3db7 100644
> --- a/drivers/gpu/drm/bridge/ite-it6505.c
> +++ b/drivers/gpu/drm/bridge/ite-it6505.c
> @@ -1651,7 +1651,7 @@ static void it6505_parse_link_capabilities(struct it6505 *it6505)
> link->rate = drm_dp_bw_code_to_link_rate(it6505->dpcd[1]);
> link->num_lanes = it6505->dpcd[2] & DP_MAX_LANE_COUNT_MASK;
>
> - if (it6505->dpcd[2] & DP_ENHANCED_FRAME_CAP)
> + if (drm_dp_enhanced_frame_cap(it6505->dpcd))
> link->capabilities = DP_ENHANCED_FRAME_CAP;
>
> DRM_DEV_DEBUG_DRIVER(dev, "DPCD Rev.: %d.%d",
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 4/5] drm/gma500: Use drm_dp_enhanced_frame_cap()
2026-10-29 10:18 [PATCH v2 0/5] drm/dp: Always use enhanced framing for DPCD r1.2+ Dmytro Malovanyi
` (2 preceding siblings ...)
2026-10-29 10:18 ` [PATCH v2 3/5] drm/bridge: it6505: " Dmytro Malovanyi
@ 2026-10-29 10:18 ` Dmytro Malovanyi
2026-10-29 12:03 ` Jani Nikula
2026-10-29 10:18 ` [PATCH v2 5/5] drm/nouveau: Use enhanced framing for DPCD r1.2+ Dmytro Malovanyi
4 siblings, 1 reply; 11+ messages in thread
From: Dmytro Malovanyi @ 2026-10-29 10:18 UTC (permalink / raw)
To: dri-devel
Cc: Jani Nikula, Ville Syrjälä,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Luca Ceresoli, Patrik Jakobsson, Lyude Paul,
Danilo Krummrich, nouveau, intel-gfx, linux-kernel,
Dmytro Malovanyi
Use the helper instead of open coding the check, so enhanced framing is
used for all DPCD r1.2+ sinks as the spec requires.
The helper takes DP_RECEIVER_CAP_SIZE bytes and gcc warns about reading
past dpcd[4] (-Wstringop-overread), so read the full receiver caps like
the other drivers do. That is 15 bytes, it fits in one AUX transfer.
Compile tested only.
Signed-off-by: Dmytro Malovanyi <dmitrymalovanyy@gmail.com>
---
drivers/gpu/drm/gma500/cdv_intel_dp.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
index 8d0626ddf..0973598c7 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
@@ -262,7 +262,7 @@ struct cdv_intel_dp {
uint32_t color_range;
uint8_t link_bw;
uint8_t lane_count;
- uint8_t dpcd[4];
+ uint8_t dpcd[DP_RECEIVER_CAP_SIZE];
struct gma_encoder *encoder;
struct i2c_adapter adapter;
struct i2c_algo_dp_aux_data algo;
@@ -1070,11 +1070,7 @@ cdv_intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode
intel_dp->link_configuration[0] = intel_dp->link_bw;
intel_dp->link_configuration[1] = intel_dp->lane_count;
- /*
- * Check for DPCD version > 1.1 and enhanced framing support
- */
- if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&
- (intel_dp->dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP)) {
+ if (drm_dp_enhanced_frame_cap(intel_dp->dpcd)) {
intel_dp->link_configuration[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN;
intel_dp->DP |= DP_ENHANCED_FRAMING;
}
--
2.50.1 (Apple Git-155)
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v2 4/5] drm/gma500: Use drm_dp_enhanced_frame_cap()
2026-10-29 10:18 ` [PATCH v2 4/5] drm/gma500: " Dmytro Malovanyi
@ 2026-10-29 12:03 ` Jani Nikula
0 siblings, 0 replies; 11+ messages in thread
From: Jani Nikula @ 2026-10-29 12:03 UTC (permalink / raw)
To: Dmytro Malovanyi, dri-devel
Cc: Ville Syrjälä,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Luca Ceresoli, Patrik Jakobsson, Lyude Paul,
Danilo Krummrich, nouveau, intel-gfx, linux-kernel,
Dmytro Malovanyi
On Thu, 29 Oct 2026, Dmytro Malovanyi <dmitrymalovanyy@gmail.com> wrote:
> Use the helper instead of open coding the check, so enhanced framing is
> used for all DPCD r1.2+ sinks as the spec requires.
>
> The helper takes DP_RECEIVER_CAP_SIZE bytes and gcc warns about reading
> past dpcd[4] (-Wstringop-overread), so read the full receiver caps like
> the other drivers do. That is 15 bytes, it fits in one AUX transfer.
>
> Compile tested only.
>
> Signed-off-by: Dmytro Malovanyi <dmitrymalovanyy@gmail.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Ditto about drm_dp_read_dpcd_caps() usage.
> ---
> drivers/gpu/drm/gma500/cdv_intel_dp.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> index 8d0626ddf..0973598c7 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> @@ -262,7 +262,7 @@ struct cdv_intel_dp {
> uint32_t color_range;
> uint8_t link_bw;
> uint8_t lane_count;
> - uint8_t dpcd[4];
> + uint8_t dpcd[DP_RECEIVER_CAP_SIZE];
> struct gma_encoder *encoder;
> struct i2c_adapter adapter;
> struct i2c_algo_dp_aux_data algo;
> @@ -1070,11 +1070,7 @@ cdv_intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode
> intel_dp->link_configuration[0] = intel_dp->link_bw;
> intel_dp->link_configuration[1] = intel_dp->lane_count;
>
> - /*
> - * Check for DPCD version > 1.1 and enhanced framing support
> - */
> - if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&
> - (intel_dp->dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP)) {
> + if (drm_dp_enhanced_frame_cap(intel_dp->dpcd)) {
> intel_dp->link_configuration[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN;
> intel_dp->DP |= DP_ENHANCED_FRAMING;
> }
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 5/5] drm/nouveau: Use enhanced framing for DPCD r1.2+
2026-10-29 10:18 [PATCH v2 0/5] drm/dp: Always use enhanced framing for DPCD r1.2+ Dmytro Malovanyi
` (3 preceding siblings ...)
2026-10-29 10:18 ` [PATCH v2 4/5] drm/gma500: " Dmytro Malovanyi
@ 2026-10-29 10:18 ` Dmytro Malovanyi
2026-10-29 12:07 ` Jani Nikula
4 siblings, 1 reply; 11+ messages in thread
From: Dmytro Malovanyi @ 2026-10-29 10:18 UTC (permalink / raw)
To: dri-devel
Cc: Jani Nikula, Ville Syrjälä,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Luca Ceresoli, Patrik Jakobsson, Lyude Paul,
Danilo Krummrich, nouveau, intel-gfx, linux-kernel,
Dmytro Malovanyi
nv50_sor_dp_watermark_sst() checks DP_ENHANCED_FRAME_CAP for the
watermark calculation, but the actual enhanced framing enable is
decided in nvkm, in nvkm_dp_train(), nvkm_uoutp_mthd_dp_sst() and
r535_dp_train_target(), with its own copy of the check. Convert all of
them so they keep agreeing with each other.
dispnv50 uses drm_dp_enhanced_frame_cap(). nvkm does not include the
drm helpers, so add nvkm_dp_enhanced_frame_cap() with the same rule.
Compile tested only, I don't have nvidia hardware.
Signed-off-by: Dmytro Malovanyi <dmitrymalovanyy@gmail.com>
---
drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h | 11 +++++++++++
drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c | 2 +-
.../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c | 2 +-
5 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index e91130f93..f965d4811 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -1607,7 +1607,7 @@ static bool
nv50_sor_dp_watermark_sst(struct nouveau_encoder *outp,
struct nv50_head *head, struct nv50_head_atom *asyh)
{
- bool enhancedFraming = outp->dp.dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP;
+ bool enhancedFraming = drm_dp_enhanced_frame_cap(outp->dp.dpcd);
u64 minRate = outp->dp.link_bw * 1000;
unsigned tuSize = 64;
unsigned waterMark;
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c
index a109348bd..fbd9935f4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c
@@ -509,7 +509,7 @@ nvkm_dp_train(struct nvkm_outp *outp, bool retrain)
OUTP_DBG(outp, "training");
ior->dp.mst = outp->dp.lt.mst;
- ior->dp.ef = outp->dp.dpcd[DPCD_RC02] & DPCD_RC02_ENHANCED_FRAME_CAP;
+ ior->dp.ef = nvkm_dp_enhanced_frame_cap(outp->dp.dpcd);
ior->dp.bw = outp->dp.lt.bw;
ior->dp.nr = outp->dp.lt.nr;
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h
index 9a6be4391..e56acc162 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h
@@ -23,6 +23,17 @@ void nvkm_dp_enable(struct nvkm_outp *, bool auxpwr);
#define DPCD_RC10_SUPPORTED_LINK_RATES(i) 0x00010
#define DPCD_RC10_SUPPORTED_LINK_RATES__SIZE 16
+/* Same rule as drm_dp_enhanced_frame_cap() */
+static inline bool
+nvkm_dp_enhanced_frame_cap(const u8 *dpcd)
+{
+ if (dpcd[DPCD_RC00_DPCD_REV] >= 0x12)
+ return true;
+
+ return dpcd[DPCD_RC00_DPCD_REV] >= 0x11 &&
+ (dpcd[DPCD_RC02] & DPCD_RC02_ENHANCED_FRAME_CAP);
+}
+
/* DPCD Link Configuration */
#define DPCD_LC00_LINK_BW_SET 0x00100
#define DPCD_LC01 0x00101
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c
index 377d0e0ce..b0158fc30 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c
@@ -87,7 +87,7 @@ nvkm_uoutp_mthd_dp_sst(struct nvkm_outp *outp, void *argv, u32 argc)
return 0;
return ior->func->dp->sst(ior, args->v0.head,
- outp->dp.dpcd[DPCD_RC02] & DPCD_RC02_ENHANCED_FRAME_CAP,
+ nvkm_dp_enhanced_frame_cap(outp->dp.dpcd),
args->v0.watermark, args->v0.hblanksym, args->v0.vblanksym);
}
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
index f5f22173f..c62900320 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
@@ -972,7 +972,7 @@ r535_dp_train_target(struct nvkm_outp *outp, u8 target, bool mst, u8 link_nr, u8
if (mst)
cmd |= NVDEF(NV0073_CTRL, DP_CMD, SET_FORMAT_MODE, MULTI_STREAM);
- if (outp->dp.dpcd[DPCD_RC02] & DPCD_RC02_ENHANCED_FRAME_CAP)
+ if (nvkm_dp_enhanced_frame_cap(outp->dp.dpcd))
cmd |= NVDEF(NV0073_CTRL, DP_CMD, SET_ENHANCED_FRAMING, TRUE);
if (target == 0 &&
--
2.50.1 (Apple Git-155)
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v2 5/5] drm/nouveau: Use enhanced framing for DPCD r1.2+
2026-10-29 10:18 ` [PATCH v2 5/5] drm/nouveau: Use enhanced framing for DPCD r1.2+ Dmytro Malovanyi
@ 2026-10-29 12:07 ` Jani Nikula
0 siblings, 0 replies; 11+ messages in thread
From: Jani Nikula @ 2026-10-29 12:07 UTC (permalink / raw)
To: Dmytro Malovanyi, dri-devel
Cc: Ville Syrjälä,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Luca Ceresoli, Patrik Jakobsson, Lyude Paul,
Danilo Krummrich, nouveau, intel-gfx, linux-kernel,
Dmytro Malovanyi
On Thu, 29 Oct 2026, Dmytro Malovanyi <dmitrymalovanyy@gmail.com> wrote:
> nv50_sor_dp_watermark_sst() checks DP_ENHANCED_FRAME_CAP for the
> watermark calculation, but the actual enhanced framing enable is
> decided in nvkm, in nvkm_dp_train(), nvkm_uoutp_mthd_dp_sst() and
> r535_dp_train_target(), with its own copy of the check. Convert all of
> them so they keep agreeing with each other.
>
> dispnv50 uses drm_dp_enhanced_frame_cap(). nvkm does not include the
> drm helpers, so add nvkm_dp_enhanced_frame_cap() with the same rule.
Seems reasonable to me, but up to the nouveau maintainers.
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> Compile tested only, I don't have nvidia hardware.
>
> Signed-off-by: Dmytro Malovanyi <dmitrymalovanyy@gmail.com>
> ---
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +-
> drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c | 2 +-
> drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h | 11 +++++++++++
> drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c | 2 +-
> .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c | 2 +-
> 5 files changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index e91130f93..f965d4811 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -1607,7 +1607,7 @@ static bool
> nv50_sor_dp_watermark_sst(struct nouveau_encoder *outp,
> struct nv50_head *head, struct nv50_head_atom *asyh)
> {
> - bool enhancedFraming = outp->dp.dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP;
> + bool enhancedFraming = drm_dp_enhanced_frame_cap(outp->dp.dpcd);
> u64 minRate = outp->dp.link_bw * 1000;
> unsigned tuSize = 64;
> unsigned waterMark;
> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c
> index a109348bd..fbd9935f4 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c
> @@ -509,7 +509,7 @@ nvkm_dp_train(struct nvkm_outp *outp, bool retrain)
> OUTP_DBG(outp, "training");
>
> ior->dp.mst = outp->dp.lt.mst;
> - ior->dp.ef = outp->dp.dpcd[DPCD_RC02] & DPCD_RC02_ENHANCED_FRAME_CAP;
> + ior->dp.ef = nvkm_dp_enhanced_frame_cap(outp->dp.dpcd);
> ior->dp.bw = outp->dp.lt.bw;
> ior->dp.nr = outp->dp.lt.nr;
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h
> index 9a6be4391..e56acc162 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h
> +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h
> @@ -23,6 +23,17 @@ void nvkm_dp_enable(struct nvkm_outp *, bool auxpwr);
> #define DPCD_RC10_SUPPORTED_LINK_RATES(i) 0x00010
> #define DPCD_RC10_SUPPORTED_LINK_RATES__SIZE 16
>
> +/* Same rule as drm_dp_enhanced_frame_cap() */
> +static inline bool
> +nvkm_dp_enhanced_frame_cap(const u8 *dpcd)
> +{
> + if (dpcd[DPCD_RC00_DPCD_REV] >= 0x12)
> + return true;
> +
> + return dpcd[DPCD_RC00_DPCD_REV] >= 0x11 &&
> + (dpcd[DPCD_RC02] & DPCD_RC02_ENHANCED_FRAME_CAP);
> +}
> +
> /* DPCD Link Configuration */
> #define DPCD_LC00_LINK_BW_SET 0x00100
> #define DPCD_LC01 0x00101
> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c
> index 377d0e0ce..b0158fc30 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c
> @@ -87,7 +87,7 @@ nvkm_uoutp_mthd_dp_sst(struct nvkm_outp *outp, void *argv, u32 argc)
> return 0;
>
> return ior->func->dp->sst(ior, args->v0.head,
> - outp->dp.dpcd[DPCD_RC02] & DPCD_RC02_ENHANCED_FRAME_CAP,
> + nvkm_dp_enhanced_frame_cap(outp->dp.dpcd),
> args->v0.watermark, args->v0.hblanksym, args->v0.vblanksym);
> }
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
> index f5f22173f..c62900320 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
> @@ -972,7 +972,7 @@ r535_dp_train_target(struct nvkm_outp *outp, u8 target, bool mst, u8 link_nr, u8
> if (mst)
> cmd |= NVDEF(NV0073_CTRL, DP_CMD, SET_FORMAT_MODE, MULTI_STREAM);
>
> - if (outp->dp.dpcd[DPCD_RC02] & DPCD_RC02_ENHANCED_FRAME_CAP)
> + if (nvkm_dp_enhanced_frame_cap(outp->dp.dpcd))
> cmd |= NVDEF(NV0073_CTRL, DP_CMD, SET_ENHANCED_FRAMING, TRUE);
>
> if (target == 0 &&
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 11+ messages in thread