Skip to content

Commit 939bc3e

Browse files
committed
drm/i915/dp: Return early if dsc is required but not supported
Currently, when bandwidth is insufficient for a given mode, we attempt to use DSC. This is indicated by a debug print, followed by a check for DSC support. The debug message states that we are trying DSC, but DSC might not be supported, which can give an incorrect picture in the logs if we bail out later. Correct the order for both DP and DP MST to: - Check if DSC is required and supported, and return early if DSC is not supported. - Print a debug message to indicate that DSC will be tried next. Suggested-by: Jani Nikula <[email protected]> Signed-off-by: Ankit Nautiyal <[email protected]> Reviewed-by: Suraj Kandpal <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 173876a commit 939bc3e

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,15 +2642,17 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
26422642
dsc_needed = true;
26432643
}
26442644

2645+
if (dsc_needed && !intel_dp_supports_dsc(intel_dp, connector, pipe_config)) {
2646+
drm_dbg_kms(display->drm, "DSC required but not available\n");
2647+
return -EINVAL;
2648+
}
2649+
26452650
if (dsc_needed) {
26462651
drm_dbg_kms(display->drm,
26472652
"Try DSC (fallback=%s, joiner=%s, force=%s)\n",
26482653
str_yes_no(ret), str_yes_no(joiner_needs_dsc),
26492654
str_yes_no(intel_dp->force_dsc_en));
26502655

2651-
if (!intel_dp_supports_dsc(intel_dp, connector, pipe_config))
2652-
return -EINVAL;
2653-
26542656
if (!intel_dp_compute_config_limits(intel_dp, pipe_config,
26552657
respect_downstream_limits,
26562658
true,

drivers/gpu/drm/i915/display/intel_dp_mst.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,14 +633,17 @@ static int mst_stream_compute_config(struct intel_encoder *encoder,
633633
dsc_needed = true;
634634
}
635635

636+
if (dsc_needed && !intel_dp_supports_dsc(intel_dp, connector, pipe_config)) {
637+
drm_dbg_kms(display->drm, "DSC required but not available\n");
638+
return -EINVAL;
639+
}
640+
636641
/* enable compression if the mode doesn't fit available BW */
637642
if (dsc_needed) {
638643
drm_dbg_kms(display->drm, "Try DSC (fallback=%s, joiner=%s, force=%s)\n",
639644
str_yes_no(ret), str_yes_no(joiner_needs_dsc),
640645
str_yes_no(intel_dp->force_dsc_en));
641646

642-
if (!intel_dp_supports_dsc(intel_dp, connector, pipe_config))
643-
return -EINVAL;
644647

645648
if (!mst_stream_compute_config_limits(intel_dp, connector,
646649
pipe_config, true,

0 commit comments

Comments
 (0)