drm/i915/dp: Link train Fallback on eDP only if fallback link BW can fit panel's native mode
Subsystems (2)
PATCH v3 1/1 drm/i915/dp: Link train Fallback on eDP only if fallback link BW can fit panel's native mode
This patch fixes the original commit c0cfb10d9e1de49 ("drm/i915/edp:
Do not do link training fallback or prune modes on EDP") that causes a blank screen in case of certain eDP panels (Eg: seen on Dell XPS13 9350) where first link training fails and a retraining is required by falling back to lower link rate/lane count.
In case of some panels they advertise higher link rate/lane count than whats required for supporting the panel's native mode. But we always link train at highest link rate/lane count for eDP and if that fails we can still fallback to lower link rate/lane count as long as the fallback link BW still fits the native mode to avoid pruning the panel's native mode yet retraining at fallback values to recover from a blank screen.
v3:
* Add const for fixed_mode (Ville)
v2:
* Send uevent if link failure on eDP unconditionally
Cc: Clinton Taylor <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Ville Syrjala <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Lucas De Marchi <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107489
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105338
--- drivers/gpu/drm/i915/intel_dp.c | 30 +++++++++++++++++++ drivers/gpu/drm/i915/intel_dp_link_training.c | 26 ++++++---------- 2 files changed, 39 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +30 -0
@@ -557,6 +557,22 @@ static bool intel_dp_link_params_valid(struct intel_dp *intel_dp, int link_rate,return true; } +static bool intel_dp_can_link_train_fallback_for_edp (struct intel_dp *intel_dp, +int link_rate, +uint8_t lane_count) +{ +const struct drm_display_mode *fixed_mode = + intel_dp->attached_connector->panel.fixed_mode; +int mode_rate, max_rate; + + mode_rate =intel_dp_link_required (fixed_mode->clock,18 ); + max_rate =intel_dp_max_data_rate (link_rate, lane_count); +if (mode_rate > max_rate) +return false; + +return true; +} +int intel_dp_get_link_train_fallback_values (struct intel_dp *intel_dp,int link_rate,uint8_t lane_count) {
@@ -566,9 +582,23 @@ int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp, intel_dp->num_common_rates, link_rate);if (index >0 ) { +if (intel_dp_is_edp (intel_dp) && + !intel_dp_can_link_train_fallback_for_edp (intel_dp, + intel_dp->common_rates[index -1 ], + lane_count)) { +DRM_DEBUG_KMS ("Retrying Link training for eDP with same parameters\n" ); +return 0 ; + } intel_dp->max_link_rate = intel_dp->common_rates[index -1 ]; intel_dp->max_link_lane_count = lane_count; }else if (lane_count >1 ) { +if (intel_dp_is_edp (intel_dp) && + !intel_dp_can_link_train_fallback_for_edp (intel_dp, +intel_dp_max_common_rate (intel_dp), + lane_count >>1 )) { +DRM_DEBUG_KMS ("Retrying Link training for eDP with same parameters\n" ); +return 0 ; + } intel_dp->max_link_rate =intel_dp_max_common_rate (intel_dp); intel_dp->max_link_lane_count = lane_count >>1 ; }else {
drivers/gpu/drm/i915/intel_dp_link_training.c +9 -17
@@ -367,22 +367,14 @@ intel_dp_start_link_train(struct intel_dp *intel_dp)return ; failure_handling: -/* Dont fallback and prune modes if its eDP */ -if (!intel_dp_is_edp (intel_dp)) { -DRM_DEBUG_KMS ("[CONNECTOR:%d:%s] Link Training failed at link rate = %d, lane count = %d" , - intel_connector->base.base.id, - intel_connector->base.name, - intel_dp->link_rate, intel_dp->lane_count); -if (!intel_dp_get_link_train_fallback_values (intel_dp, - intel_dp->link_rate, - intel_dp->lane_count)) -/* Schedule a Hotplug Uevent to userspace to start modeset */ -schedule_work (&intel_connector->modeset_retry_work); - }else { -DRM_ERROR ("[CONNECTOR:%d:%s] Link Training failed at link rate = %d, lane count = %d" , - intel_connector->base.base.id, - intel_connector->base.name, - intel_dp->link_rate, intel_dp->lane_count); - } +DRM_DEBUG_KMS ("[CONNECTOR:%d:%s] Link Training failed at link rate = %d, lane count = %d" , + intel_connector->base.base.id, + intel_connector->base.name, + intel_dp->link_rate, intel_dp->lane_count); +if (!intel_dp_get_link_train_fallback_values (intel_dp, + intel_dp->link_rate, + intel_dp->lane_count)) +/* Schedule a Hotplug Uevent to userspace to start modeset */ +schedule_work (&intel_connector->modeset_retry_work);return ; }
Signature · 6 lines
2.18.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915/dp: Link train Fallback on eDP only if fallback link BW can fit panel's native mode (rev2)
== Series Details ==
== Series Details ==
Series: drm/i915/dp: Link train Fallback on eDP only if fallback link BW can fit panel's native mode (rev2)
URL : https://patchwork.freedesktop.org/series/43291/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4956 -> Patchwork_10404 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/43291/revisions/2/mbox/
== Known issues ==
Here are the changes found in Patchwork_10404 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@amdgpu/amd_basic@cs-compute:
fi-kbl-8809g: NOTRUN -> FAIL (fdo#108094)
igt@amdgpu/amd_prime@amd-to-i915:
fi-kbl-8809g: NOTRUN -> FAIL (fdo#107341)
igt@drv_module_reload@basic-reload:
fi-glk-j4005: PASS -> DMESG-WARN (fdo#106248, fdo#106725)
igt@kms_flip@basic-flip-vs-wf_vblank:
fi-glk-j4005: PASS -> FAIL (fdo#103928)
==== Possible fixes ====
igt@prime_vgem@basic-fence-flip:
fi-ilk-650: FAIL (fdo#104008) -> PASS fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fdo#106248 https://bugs.freedesktop.org/show_bug.cgi?id=106248
fdo#106725 https://bugs.freedesktop.org/show_bug.cgi?id=106725
fdo#107341 https://bugs.freedesktop.org/show_bug.cgi?id=107341
fdo#108094 https://bugs.freedesktop.org/show_bug.cgi?id=108094
== Participating hosts (48 -> 39) ==
Missing (9): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-icl-u2 fi-bsw-cyan fi-snb-2520m fi-ctg-p8600 fi-gdg-551 fi-pnv-d510
== Build changes ==
* Linux: CI_DRM_4956 -> Patchwork_10404
CI_DRM_4956: 61d9f59ad3592dd6fb724d72014f03b4f222571b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4672: 4497591d2572831a9f07fd9e48a2571bfcffe354 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10404: f554f71565e72b567fd800a40b7cca371e38911c @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
f554f71565e7 drm/i915/dp: Link train Fallback on eDP only if fallback link BW can fit panel's native mode
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10404/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915/dp: Link train Fallback on eDP only if fallback link BW can fit panel's native mode (rev2)
In reply to Manasi Navare== Series Details ==
== Series Details ==
Series: drm/i915/dp: Link train Fallback on eDP only if fallback link BW can fit panel's native mode (rev2)
URL : https://patchwork.freedesktop.org/series/43291/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4956_full -> Patchwork_10404_full =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_10404_full need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_10404_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_10404_full:
=== IGT changes ===
==== Warnings ====
igt@pm_rc6_residency@rc6-accuracy:
shard-kbl: SKIP -> PASS== Known issues ==
Here are the changes found in Patchwork_10404_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@debugfs_test@read_all_entries_display_off:
shard-skl: PASS -> INCOMPLETE (fdo#104108)
igt@gem_cpu_reloc@full:
shard-skl: NOTRUN -> INCOMPLETE (fdo#108073)
igt@gem_exec_await@wide-contexts:
shard-apl: PASS -> FAIL (fdo#106680)
igt@kms_cursor_crc@cursor-128x128-sliding:
shard-apl: PASS -> FAIL (fdo#103232) +1
igt@kms_cursor_crc@cursor-256x85-offscreen:
shard-skl: PASS -> FAIL (fdo#103232)
igt@kms_cursor_crc@cursor-64x21-sliding:
shard-glk: PASS -> FAIL (fdo#103232)
igt@kms_cursor_legacy@cursorb-vs-flipb-toggle:
shard-glk: PASS -> DMESG-WARN (fdo#106538, fdo#105763) +2
igt@kms_flip@flip-vs-expired-vblank-interruptible:
shard-skl: PASS -> FAIL (fdo#105363)
shard-apl: PASS -> INCOMPLETE (fdo#103927)
igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-render:
shard-skl: PASS -> FAIL (fdo#103167) +1
igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
shard-apl: PASS -> FAIL (fdo#103167) +3
igt@kms_frontbuffer_tracking@fbc-2p-primscrn-shrfb-pgflip-blt:
shard-glk: PASS -> FAIL (fdo#103167) +1
igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-render:
shard-skl: PASS -> FAIL (fdo#105682)
igt@kms_plane@pixel-format-pipe-a-planes:
shard-skl: NOTRUN -> DMESG-FAIL (fdo#106885, fdo#103166)
{igt@kms_plane_alpha_blend@pipe-a-coverage-7efc}:
shard-skl: PASS -> FAIL (fdo#108145)
igt@kms_plane_multiple@atomic-pipe-a-tiling-yf:
shard-apl: PASS -> FAIL (fdo#103166)
igt@perf_pmu@rc6-runtime-pm-long:
shard-skl: PASS -> FAIL (fdo#105010)
==== Possible fixes ====
igt@kms_available_modes_crc@available_mode_test_crc:
shard-apl: FAIL (fdo#106641) -> PASS
igt@kms_busy@extended-pageflip-hang-newfb-render-b:
shard-glk: DMESG-WARN (fdo#107956) -> PASS
igt@kms_ccs@pipe-b-crc-sprite-planes-basic:
shard-glk: FAIL (fdo#108145) -> PASS
igt@kms_cursor_crc@cursor-128x128-suspend:
shard-skl: INCOMPLETE (fdo#104108) -> PASS
igt@kms_cursor_crc@cursor-128x42-onscreen:
shard-apl: FAIL (fdo#103232) -> PASS
igt@kms_cursor_crc@cursor-256x256-dpms:
shard-glk: FAIL (fdo#103232) -> PASS +1
igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-wc:
shard-apl: FAIL (fdo#103167) -> PASS +1
igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-onoff:
shard-glk: FAIL (fdo#103167) -> PASS +4
igt@kms_plane@plane-position-covered-pipe-a-planes:
shard-apl: FAIL (fdo#103166) -> PASS +1
igt@kms_plane@plane-position-covered-pipe-b-planes:
shard-glk: FAIL (fdo#103166) -> PASS +3
igt@kms_setmode@basic:
shard-kbl: FAIL (fdo#99912) -> PASS
igt@pm_rpm@universal-planes:
shard-skl: INCOMPLETE (fdo#107807) -> PASS {name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#105010 https://bugs.freedesktop.org/show_bug.cgi?id=105010
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105682 https://bugs.freedesktop.org/show_bug.cgi?id=105682
fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
fdo#106680 https://bugs.freedesktop.org/show_bug.cgi?id=106680
fdo#106885 https://bugs.freedesktop.org/show_bug.cgi?id=106885
fdo#107807 https://bugs.freedesktop.org/show_bug.cgi?id=107807
fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
fdo#108073 https://bugs.freedesktop.org/show_bug.cgi?id=108073
fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (6 -> 6) ==
No changes in participating hosts
== Build changes ==
* Linux: CI_DRM_4956 -> Patchwork_10404
CI_DRM_4956: 61d9f59ad3592dd6fb724d72014f03b4f222571b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4672: 4497591d2572831a9f07fd9e48a2571bfcffe354 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10404: f554f71565e72b567fd800a40b7cca371e38911c @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10404/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx