drm/i915/dp: enable DSC passthrough for HDMI 2.1 PCON devices
Subsystems (3)
PATCH v2 1/1 drm/i915/dp: enable DSC passthrough for HDMI 2.1 PCON devices
HDMI 2.1 PCON devices (e.g. Parade PS196) that do not have an internal DSC encoder can still forward a DSC-compressed stream from the DP source to the downstream HDMI 2.1 sink unchanged (passthrough mode). The HDMI sink (e.g. Lenovo ThinkVision Pro 27UD-10) then decompresses the stream itself. This mode is signalled by DP_DSC_PASSTHROUGH_IS_SUPPORTED (DPCD 0x060 bit1) on the PCON.
Previously the driver had no awareness of this path: the PCON would fall back to its autonomous passthrough mode and write 0x160=0x02 by itself, leaving the source with no control over DSC parameters or DPCD 0x160.
This patch adds explicit driver control of PCON DSC passthrough:
- Detect passthrough capability at connect time from DPCD 0x060 bit1 (DP_DSC_PASSTHROUGH_IS_SUPPORTED) combined with the downstream HDMI 2.1 sink's DSC 1.2 support from EDID HF-VSDB. Cache the result in connector->dp.pcon_dsc_passthrough (same lifecycle as fec_capability and dsc_dpcd) to avoid repeated lookups on every modeset.
- Treat the PCON as DSC-capable in intel_dp_has_dsc() when passthrough is supported, allowing the normal DSC compute_config path to proceed.
- Derive DSC parameters (slice count, bpc limits) from the downstream HDMI sink's EDID DSC capabilities (dsc_cap.max_slices, dsc_cap.clk_per_slice, dsc_cap.bpc_supported) rather than from the PCON's DSC encoder DPCD (which is all-zero for passthrough-only PCONs). This ensures the source VDSC engine produces a stream the HDMI sink can actually decompress.
- Write DP_DSC_PASSTHROUGH_EN (0x160 bit1) to the PCON via intel_dp_sink_set_dsc_passthrough() on enable, and clear it on disable. The existing MST hub passthrough path in that function is preserved; the PCON case is handled by redirecting aux to intel_dp->aux when pcon_dsc_passthrough is set.
- Short-circuit intel_dp_sink_set_dsc_decompression() for PCON passthrough since the PCON itself does not decompress (the HDMI sink does); writing DP_DECOMPRESSION_EN to the PCON would be incorrect.
Tested with Parade PS196G (HW 0.2, SW 241.62) connected to a Lenovo ThinkVision Pro 27UD-10 (HDMI 2.1, DSC 1.2, max 16 slices, 400 MHz/ slice). At 4K@240Hz DSC compression is required (10.5625 bpp, 8 slices); driver now writes 0x160=0x02 explicitly and slice count is correctly derived from the HDMI sink EDID rather than from PCON DPCD.
---
v2: Fix build failure on drm-tip - replace non-existent dsc.slice_count
field with dsc.slice_config. Introduce intel_dp_pcon_passthrough_dsc_slice_config() which calls intel_hdmi_dsc_get_num_slices() for the target slice count then finds a matching intel_dsc_slice_config via intel_dsc_get_slice_config() to satisfy Intel VDSC HW constraints.
Fix pcon_dsc_passthrough caching order: move intel_dp_pcon_set_dsc_passthrough_cap() from intel_dp_get_dsc_sink_cap() to intel_dp_set_edid() so it runs after EDID is parsed and display_info.hdmi.dsc_cap is populated. Also clear pcon_dsc_passthrough in intel_dp_unset_edid() to keep lifecycle consistent.
--- .../drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_dp.c | 172 +++++++++++++++++- 2 files changed, 165 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/display/intel_display_types.h +1 -0
@@ -564,6 +564,7 @@ struct intel_connector { u8 dsc_hblank_expansion_quirk:1; u8 dsc_throughput_quirk:1; u8 dsc_decompression_enabled:1; + u8 pcon_dsc_passthrough:1; /* PCON DSC PT supported and HDMI sink DSC 1.2 */ struct { struct {
drivers/gpu/drm/i915/display/intel_dp.c +164 -8
244 lines not on this page · raw message
Signature · 1 line
2.43.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [High] Hardcoded usage of `intel_dp->attached_connector` accesses the root SST connector in shared DP…
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Hardcoded usage of intel_dp->attached_connector accesses the root SST connector in shared DP code paths, breaking MST support.
- [High] Function signature mismatch in the call to intel_hdmi_dsc_get_num_slices() causes compilation failure.
- [High] PCON DSC passthrough fundamentally breaks downstream DSC helpers due to an unhandled all-zero dsc_dpcd. --
commit 8891a63d7de717cf65ea1f4d21b654db63caa8ce
Author: Xiao Lu <[email protected]>
drm/i915/dp: enable DSC passthrough for HDMI 2.1 PCON devices
This patch adds explicit driver control of PCON DSC passthrough. It derives DSC parameters from the downstream HDMI sink's EDID DSC capabilities rather than from the PCON's DSC encoder DPCD (which is all-zero for passthrough-only PCONs).
drivers/gpu/drm/i915/display/intel_dp.c int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, · line 2406
Quoted 9 lines
drivers/gpu/drm/i915/display/intel_dp.c +1
-1@@ -2393,7 +2403,19 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, } } - if (!intel_dp_dsc_get_slice_config(connector, adjusted_mode->crtc_clock, +if (intel_dp->attached_connector->dp.pcon_dsc_passthrough) {
[Severity: High]
Does hardcoding intel_dp->attached_connector here cause issues for MST configurations? For MST, attached_connector points to the root SST connector, not the active MST leaf branch connector undergoing the modeset. This might incorrectly evaluate the pcon_dsc_passthrough flag of the root connector instead of the active MST connector.
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_dp.c +5
-0+/* +* PCON passthrough: no PCON encoder DPCD, derive slice config +* from the downstream HDMI 2.1 sink DSC capabilities in EDID. +*/ + if (!intel_dp_pcon_passthrough_dsc_slice_config(intel_dp,
drivers/gpu/drm/i915/display/intel_dp.c int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, · line 2431
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dp.c +7
-0+ pipe_config, + &pipe_config->dsc.slice_config)) { +drm_dbg_kms (display->drm, +"PCON DSC passthrough: no valid slice config\n" ); +return -EINVAL ; + } + }else if (!intel_dp_dsc_get_slice_config (connector, adjusted_mode->crtc_clock, adjusted_mode->crtc_hdisplay, num_joined_pipes, &pipe_config->dsc.slice_config))return -EINVAL ;
[Severity: High]
Does PCON DSC passthrough fundamentally break downstream DSC helpers like intel_dp_dsc_compute_params() and intel_dp_dsc_supports_format() due to the unhandled all-zero dsc_dpcd?
The patch notes that the PCON's DSC encoder DPCD is all-zero, but fails to update critical DSC calculation pathways to bypass the DPCD checks. For example, intel_dp_dsc_compute_params() and intel_dp_dsc_supports_format() continue to query connector->dp.dsc_dpcd. This causes them to calculate 0 for properties like line_buf_depth or return false for supported formats, causing the driver to immediately bail out with -EINVAL.
[ ... ]
drivers/gpu/drm/i915/display/intel_dp.c void intel_dp_check_frl_training(struct intel_dp *intel_dp) · line 4363
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_dp.c +4
-0@@ -4298,6 +4360,90 @@ void intel_dp_check_frl_training(struct intel_dp *intel_dp) +static void +intel_dp_pcon_set_dsc_passthrough_cap (struct intel_dp *intel_dp) +{ +struct intel_connector *connector = intel_dp->attached_connector;
[Severity: High]
Does this unconditionally modify the root SST connector state even when invoked for an MST branch device? Using intel_dp->attached_connector instead of the active connector could cause state corruption for MST setups.
[ ... ]
drivers/gpu/drm/i915/display/intel_dp.c void intel_dp_check_frl_training(struct intel_dp *intel_dp) · line 4404
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp.c +8
-0+static bool +intel_dp_pcon_passthrough_dsc_slice_config (struct intel_dp *intel_dp, +const struct intel_crtc_state *crtc_state, +struct intel_dsc_slice_config *config_ret) +{ +struct intel_display *display =to_intel_display (intel_dp); +struct intel_connector *connector = intel_dp->attached_connector; +const struct drm_display_info *info = &connector->base.display_info;
[Severity: High]
Will this read EDID capabilities from the wrong connector's display_info during DSC config computation for MST endpoints? Using intel_dp->attached_connector fetches the root connector's capabilities rather than the downstream MST leaf.
[ ... ]
drivers/gpu/drm/i915/display/intel_dp.c void intel_dp_check_frl_training(struct intel_dp *intel_dp) · line 4420
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_dp.c +10
-0+/* +* Derive the required slice count from the downstream HDMI 2.1 sink +* DSC capabilities in EDID (not from the PCON encoder DPCD which is +* all-zero for passthrough-only devices). +*/ + target_slices =intel_hdmi_dsc_get_num_slices (crtc_state, + hdmi_max_slices, + crtc_state->hw.adjusted_mode.hdisplay, + hdmi_max_slices, + hdmi_throughput);
[Severity: High]
Does this call to intel_hdmi_dsc_get_num_slices() fail to compile?
The function is being called with 5 arguments (passing crtc_state as the first argument), but it expects 6 arguments, with the first argument being a const struct drm_display_mode *mode. This would lead to a build failure.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Patchwork
CI✗ Fi.CI.BUILD: failure for drm/i915/dp: enable DSC passthrough for HDMI 2.1 PCON devices (rev2)
In reply to Xiao Lu== Series Details ==
== Series Details ==
Series: drm/i915/dp: enable DSC passthrough for HDMI 2.1 PCON devices (rev2)
URL : https://patchwork.freedesktop.org/series/173452/
State : failure
== Summary ==
Error: make failed
DESCEND objtool
CC [M] drivers/gpu/drm/i915/display/intel_dp.odrivers/gpu/drm/i915/display/intel_dp.c: In function ‘intel_dp_pcon_passthrough_dsc_slice_config’:drivers/gpu/drm/i915/display/intel_dp.c:4417:55: error: passing argument 1 of ‘intel_hdmi_dsc_get_num_slices’ from incompatible pointer type [-Werror=incompatible-pointer-types]
4417 | target_slices = intel_hdmi_dsc_get_num_slices(crtc_state,
| ^~~~~~~~~~
| |
| const struct intel_crtc_state *
In file included from drivers/gpu/drm/i915/display/intel_dp.c:84:
drivers/gpu/drm/i915/display/intel_hdmi.h:60:66: note: expected ‘const struct drm_display_mode *’ but argument is of type ‘const struct intel_crtc_state *’
60 | int intel_hdmi_dsc_get_num_slices(const struct drm_display_mode *mode,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
drivers/gpu/drm/i915/display/intel_dp.c:4417:25: error: too few arguments to function ‘intel_hdmi_dsc_get_num_slices’
4417 | target_slices = intel_hdmi_dsc_get_num_slices(crtc_state,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/display/intel_hdmi.h:60:5: note: declared here
60 | int intel_hdmi_dsc_get_num_slices(const struct drm_display_mode *mode,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errors
make[6]: *** [scripts/Makefile.build:290: drivers/gpu/drm/i915/display/intel_dp.o] Error 1 make[5]: *** [scripts/Makefile.build:551: drivers/gpu/drm/i915] Error 2 make[4]: *** [scripts/Makefile.build:551: drivers/gpu/drm] Error 2
make[3]: *** [scripts/Makefile.build:551: drivers/gpu] Error 2
make[2]: *** [scripts/Makefile.build:551: drivers] Error 2
make[1]: *** [/home/kbuild2/kernel/Makefile:2229: .] Error 2
make: *** [Makefile:248: __sub-make] Error 2
Build failed, no error log produced