Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-10-30 12:03:36 +0100
committerTakashi Iwai <tiwai@suse.de>2018-10-30 12:03:56 +0100
commitdaf120f1175202a9ca98d77247f3ec269740986a (patch)
tree1d6179499d3b902b787d3a1ed32b52838d13ae0d
parentc930da78c5040810ce7a9349f56e7ce99b8e7b4b (diff)
drm/i915/dp: Link train Fallback on eDP only if fallback link
BW can fit panel's native mode (bsc#1051510).
-rw-r--r--patches.drivers/drm-i915-dp-Link-train-Fallback-on-eDP-only-if-fallb.patch143
-rw-r--r--series.conf1
2 files changed, 144 insertions, 0 deletions
diff --git a/patches.drivers/drm-i915-dp-Link-train-Fallback-on-eDP-only-if-fallb.patch b/patches.drivers/drm-i915-dp-Link-train-Fallback-on-eDP-only-if-fallb.patch
new file mode 100644
index 0000000000..2d19f28cdf
--- /dev/null
+++ b/patches.drivers/drm-i915-dp-Link-train-Fallback-on-eDP-only-if-fallb.patch
@@ -0,0 +1,143 @@
+From 041444458835d7fb2c9f042598bfe16bf375b15d Mon Sep 17 00:00:00 2001
+From: Manasi Navare <manasi.d.navare@intel.com>
+Date: Tue, 9 Oct 2018 14:28:04 -0700
+Subject: [PATCH] drm/i915/dp: Link train Fallback on eDP only if fallback link BW can fit panel's native mode
+Mime-version: 1.0
+Content-type: text/plain; charset=UTF-8
+Content-transfer-encoding: 8bit
+Git-commit: 041444458835d7fb2c9f042598bfe16bf375b15d
+Patch-mainline: v4.20-rc1
+No-fix: 1e712535c51ab025ebc776d4405683d81521996d
+References: bsc#1051510
+
+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
+
+Fixes: c0cfb10d9e1d ("drm/i915/edp: Do not do link training fallback or prune modes on EDP")
+Cc: Clinton Taylor <clinton.a.taylor@intel.com>
+Cc: Jani Nikula <jani.nikula@linux.intel.com>
+Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
+Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
+Cc: Lucas De Marchi <lucas.demarchi@intel.com>
+Cc: <stable@vger.kernel.org> # v4.17+
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107489
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105338
+Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
+Tested-by: Alexander Wilson <alexander.wilson@ncf.edu>
+Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20181009212804.702-1-manasi.d.navare@intel.com
+(cherry picked from commit 1e712535c51ab025ebc776d4405683d81521996d)
+
+Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ 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(-)
+
+diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
+index 6b4c19123f2a..06e91d7b6d8e 100644
+--- a/drivers/gpu/drm/i915/intel_dp.c
++++ b/drivers/gpu/drm/i915/intel_dp.c
+@@ -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 {
+diff --git a/drivers/gpu/drm/i915/intel_dp_link_training.c b/drivers/gpu/drm/i915/intel_dp_link_training.c
+index a9f40985a621..30be0e39bd5f 100644
+--- a/drivers/gpu/drm/i915/intel_dp_link_training.c
++++ b/drivers/gpu/drm/i915/intel_dp_link_training.c
+@@ -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;
+ }
+--
+2.19.1
+
diff --git a/series.conf b/series.conf
index d4e8d79f60..de7430e7a0 100644
--- a/series.conf
+++ b/series.conf
@@ -18292,6 +18292,7 @@
patches.fixes/0001-drm-cirrus-Use-drm_framebuffer_put-to-avoid-kernel-o.patch
patches.drivers/drm-i915-cfl-Add-a-new-CFL-PCI-ID
patches.drivers/drm-i915-Restore-vblank-interrupts-earlier.patch
+ patches.drivers/drm-i915-dp-Link-train-Fallback-on-eDP-only-if-fallb.patch
# dhowells/linux-fs keys-uefi
patches.suse/0001-KEYS-Allow-unrestricted-boot-time-addition-of-keys-t.patch