From 15f66a1443c60b45fb7501baebfa08bb8e4f2ec4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 8 May 2016 19:04:19 +0200 Subject: [PATCH] 4.4-stable patches added patches: drm-i915-ddi-fix-edp-vdd-handling-during-booting-and-suspend-resume.patch drm-i915-fake-hdmi-live-status.patch drm-i915-fix-edp-low-vswing-for-broadwell.patch drm-i915-make-rps-ei-thresholds-multiple-of-25-on-snb-bdw.patch --- ...ng-during-booting-and-suspend-resume.patch | 111 ++++++++++++++++++ .../drm-i915-fake-hdmi-live-status.patch | 63 ++++++++++ ...915-fix-edp-low-vswing-for-broadwell.patch | 60 ++++++++++ ...thresholds-multiple-of-25-on-snb-bdw.patch | 110 +++++++++++++++++ queue-4.4/series | 4 + 5 files changed, 348 insertions(+) create mode 100644 queue-4.4/drm-i915-ddi-fix-edp-vdd-handling-during-booting-and-suspend-resume.patch create mode 100644 queue-4.4/drm-i915-fake-hdmi-live-status.patch create mode 100644 queue-4.4/drm-i915-fix-edp-low-vswing-for-broadwell.patch create mode 100644 queue-4.4/drm-i915-make-rps-ei-thresholds-multiple-of-25-on-snb-bdw.patch diff --git a/queue-4.4/drm-i915-ddi-fix-edp-vdd-handling-during-booting-and-suspend-resume.patch b/queue-4.4/drm-i915-ddi-fix-edp-vdd-handling-during-booting-and-suspend-resume.patch new file mode 100644 index 00000000000..46cd932b493 --- /dev/null +++ b/queue-4.4/drm-i915-ddi-fix-edp-vdd-handling-during-booting-and-suspend-resume.patch @@ -0,0 +1,111 @@ +From 5eaa60c7109b40f17ac81090bc8b90482da76cd1 Mon Sep 17 00:00:00 2001 +From: Imre Deak +Date: Mon, 18 Apr 2016 10:04:21 +0300 +Subject: drm/i915/ddi: Fix eDP VDD handling during booting and suspend/resume +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Imre Deak + +commit 5eaa60c7109b40f17ac81090bc8b90482da76cd1 upstream. + +The driver's VDD on/off logic assumes that whenever the VDD is on we +also hold an AUX power domain reference. Since BIOS can leave the VDD on +during booting and resuming and on DDI platforms we won't take a +corresponding power reference, the above assumption won't hold on those +platforms and an eventual delayed VDD off work will do an extraneous AUX +power domain put resulting in a refcount underflow. Fix this the same +way we did this for non-DDI DP encoders: + +commit 6d93c0c41760c0 ("drm/i915: fix VDD state tracking after system +resume") + +At the same time call the DP encoder suspend handler the same way as the +non-DDI DP encoders do to flush any pending VDD off work. Leaving the +work running may cause a HW access where we don't expect this (at a point +where power domains are suspended already). + +While at it remove an unnecessary function call indirection. + +This fixed for me AUX refcount underflow problems on BXT during +suspend/resume. + +CC: Ville Syrjälä +Signed-off-by: Imre Deak +Reviewed-by: Ville Syrjälä +Link: http://patchwork.freedesktop.org/patch/msgid/1460963062-13211-4-git-send-email-imre.deak@intel.com +(cherry picked from commit bf93ba67e9c05882f05b7ca2d773cfc8bf462c2a) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_ddi.c | 10 +++------- + drivers/gpu/drm/i915/intel_dp.c | 4 ++-- + drivers/gpu/drm/i915/intel_drv.h | 2 ++ + 3 files changed, 7 insertions(+), 9 deletions(-) + +--- a/drivers/gpu/drm/i915/intel_ddi.c ++++ b/drivers/gpu/drm/i915/intel_ddi.c +@@ -3188,12 +3188,6 @@ void intel_ddi_get_config(struct intel_e + intel_ddi_clock_get(encoder, pipe_config); + } + +-static void intel_ddi_destroy(struct drm_encoder *encoder) +-{ +- /* HDMI has nothing special to destroy, so we can go with this. */ +- intel_dp_encoder_destroy(encoder); +-} +- + static bool intel_ddi_compute_config(struct intel_encoder *encoder, + struct intel_crtc_state *pipe_config) + { +@@ -3212,7 +3206,8 @@ static bool intel_ddi_compute_config(str + } + + static const struct drm_encoder_funcs intel_ddi_funcs = { +- .destroy = intel_ddi_destroy, ++ .reset = intel_dp_encoder_reset, ++ .destroy = intel_dp_encoder_destroy, + }; + + static struct intel_connector * +@@ -3284,6 +3279,7 @@ void intel_ddi_init(struct drm_device *d + intel_encoder->post_disable = intel_ddi_post_disable; + intel_encoder->get_hw_state = intel_ddi_get_hw_state; + intel_encoder->get_config = intel_ddi_get_config; ++ intel_encoder->suspend = intel_dp_encoder_suspend; + + intel_dig_port->port = port; + intel_dig_port->saved_port_bits = I915_READ(DDI_BUF_CTL(port)) & +--- a/drivers/gpu/drm/i915/intel_dp.c ++++ b/drivers/gpu/drm/i915/intel_dp.c +@@ -5035,7 +5035,7 @@ void intel_dp_encoder_destroy(struct drm + kfree(intel_dig_port); + } + +-static void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder) ++void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder) + { + struct intel_dp *intel_dp = enc_to_intel_dp(&intel_encoder->base); + +@@ -5077,7 +5077,7 @@ static void intel_edp_panel_vdd_sanitize + edp_panel_vdd_schedule_off(intel_dp); + } + +-static void intel_dp_encoder_reset(struct drm_encoder *encoder) ++void intel_dp_encoder_reset(struct drm_encoder *encoder) + { + struct intel_dp *intel_dp; + +--- a/drivers/gpu/drm/i915/intel_drv.h ++++ b/drivers/gpu/drm/i915/intel_drv.h +@@ -1204,6 +1204,8 @@ void intel_dp_set_link_params(struct int + void intel_dp_start_link_train(struct intel_dp *intel_dp); + void intel_dp_stop_link_train(struct intel_dp *intel_dp); + void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode); ++void intel_dp_encoder_reset(struct drm_encoder *encoder); ++void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder); + void intel_dp_encoder_destroy(struct drm_encoder *encoder); + int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc); + bool intel_dp_compute_config(struct intel_encoder *encoder, diff --git a/queue-4.4/drm-i915-fake-hdmi-live-status.patch b/queue-4.4/drm-i915-fake-hdmi-live-status.patch new file mode 100644 index 00000000000..6c24863f696 --- /dev/null +++ b/queue-4.4/drm-i915-fake-hdmi-live-status.patch @@ -0,0 +1,63 @@ +From 60b3143c7cac7e8d2ca65c0b347466c5776395d1 Mon Sep 17 00:00:00 2001 +From: Shashank Sharma +Date: Thu, 21 Apr 2016 16:48:32 +0530 +Subject: drm/i915: Fake HDMI live status +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Shashank Sharma + +commit 60b3143c7cac7e8d2ca65c0b347466c5776395d1 upstream. + +This patch does the following: +- Fakes live status of HDMI as connected (even if that's not). + While testing certain (monitor + cable) combinations with + various intel platforms, it seems that live status register + doesn't work reliably on some older devices. So limit the + live_status check for HDMI detection, only for platforms + from gen7 onwards. + +V2: restrict faking live_status to certain platforms +V3: (Ville) + - keep the debug message for !live_status case + - fix indentation of comment + - remove "warning" from the debug message + + (Jani) + - Change format of fix details in the commit message + +Fixes: 237ed86c693d ("drm/i915: Check live status before reading edid") +Suggested-by: Ville Syrjala +Signed-off-by: Shashank Sharma +Link: http://patchwork.freedesktop.org/patch/msgid/1461237606-16491-1-git-send-email-shashank.sharma@intel.com +Signed-off-by: Ville Syrjälä +(cherry picked from commit 4f4a8185011773f7520d9916c6857db946e7f9d1) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_hdmi.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/i915/intel_hdmi.c ++++ b/drivers/gpu/drm/i915/intel_hdmi.c +@@ -1388,8 +1388,16 @@ intel_hdmi_detect(struct drm_connector * + hdmi_to_dig_port(intel_hdmi)); + } + +- if (!live_status) +- DRM_DEBUG_KMS("Live status not up!"); ++ if (!live_status) { ++ DRM_DEBUG_KMS("HDMI live status down\n"); ++ /* ++ * Live status register is not reliable on all intel platforms. ++ * So consider live_status only for certain platforms, for ++ * others, read EDID to determine presence of sink. ++ */ ++ if (INTEL_INFO(dev_priv)->gen < 7 || IS_IVYBRIDGE(dev_priv)) ++ live_status = true; ++ } + + intel_hdmi_unset_edid(connector); + diff --git a/queue-4.4/drm-i915-fix-edp-low-vswing-for-broadwell.patch b/queue-4.4/drm-i915-fix-edp-low-vswing-for-broadwell.patch new file mode 100644 index 00000000000..d106b34c7b5 --- /dev/null +++ b/queue-4.4/drm-i915-fix-edp-low-vswing-for-broadwell.patch @@ -0,0 +1,60 @@ +From 992e7a41f9fcc7bcd10e7d346aee5ed7a2c241cb Mon Sep 17 00:00:00 2001 +From: Mika Kahola +Date: Wed, 20 Apr 2016 15:39:02 +0300 +Subject: drm/i915: Fix eDP low vswing for Broadwell +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Mika Kahola + +commit 992e7a41f9fcc7bcd10e7d346aee5ed7a2c241cb upstream. + +It was noticed on bug #94087 that module parameter +i915.edp_vswing=2 that should override the VBT setting +to use default voltage swing (400 mV) was not applied +for Broadwell. + +This patch provides a fix for this by checking if default +i.e. higher voltage swing is requested to be used and +applies the DDI translations table for DP instead of eDP +(low vswing) table. + +v2: Combine two if statements into one (Jani) +v3: Change dev_priv->edp_low_vswing to use dev_priv->vbt.edp.low_vswing + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94087 +Signed-off-by: Mika Kahola +Link: http://patchwork.freedesktop.org/patch/msgid/1461155942-7749-1-git-send-email-mika.kahola@intel.com +Signed-off-by: Ville Syrjälä +(cherry picked from commit 00983519214b61c1b9371ec2ed55a4dde773e384) +[Jani: s/dev_priv->vbt.edp.low_vswing/dev_priv->edp_low_vswing/ to backport] +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_ddi.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/i915/intel_ddi.c ++++ b/drivers/gpu/drm/i915/intel_ddi.c +@@ -464,9 +464,17 @@ static void intel_prepare_ddi_buffers(st + } else if (IS_BROADWELL(dev)) { + ddi_translations_fdi = bdw_ddi_translations_fdi; + ddi_translations_dp = bdw_ddi_translations_dp; +- ddi_translations_edp = bdw_ddi_translations_edp; ++ ++ if (dev_priv->edp_low_vswing) { ++ ddi_translations_edp = bdw_ddi_translations_edp; ++ n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp); ++ } else { ++ ddi_translations_edp = bdw_ddi_translations_dp; ++ n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_dp); ++ } ++ + ddi_translations_hdmi = bdw_ddi_translations_hdmi; +- n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp); ++ + n_dp_entries = ARRAY_SIZE(bdw_ddi_translations_dp); + n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi); + hdmi_default_entry = 7; diff --git a/queue-4.4/drm-i915-make-rps-ei-thresholds-multiple-of-25-on-snb-bdw.patch b/queue-4.4/drm-i915-make-rps-ei-thresholds-multiple-of-25-on-snb-bdw.patch new file mode 100644 index 00000000000..3e34cbc6324 --- /dev/null +++ b/queue-4.4/drm-i915-make-rps-ei-thresholds-multiple-of-25-on-snb-bdw.patch @@ -0,0 +1,110 @@ +From 4ea3959018d09edfa36a9e7b5ccdbd4ec4b99e49 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= +Date: Wed, 20 Apr 2016 16:43:56 +0300 +Subject: drm/i915: Make RPS EI/thresholds multiple of 25 on SNB-BDW +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ville Syrjälä + +commit 4ea3959018d09edfa36a9e7b5ccdbd4ec4b99e49 upstream. + +Somehow my SNB GT1 (Dell XPS 8300) gets very unhappy around +GPU hangs if the RPS EI/thresholds aren't suitably aligned. +It seems like scheduling/timer interupts stop working somehow +and things get stuck eg. in usleep_range(). + +I bisected the problem down to +commit 8a5864377b12 ("drm/i915/skl: Restructured the gen6_set_rps_thresholds function") +I observed that before all the values were at least multiples of 25, +but afterwards they are not. And rounding things up to the next multiple +of 25 does seem to help, so lets' do that. I also tried roundup(..., 5) +but that wasn't sufficient. Also I have no idea if we might need this sort of +thing on gen9+ as well. + +These are the original EI/thresholds: + LOW_POWER + GEN6_RP_UP_EI 12500 + GEN6_RP_UP_THRESHOLD 11800 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 21250 + BETWEEN + GEN6_RP_UP_EI 10250 + GEN6_RP_UP_THRESHOLD 9225 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 18750 + HIGH_POWER + GEN6_RP_UP_EI 8000 + GEN6_RP_UP_THRESHOLD 6800 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 15000 + +These are after 8a5864377b12: + LOW_POWER + GEN6_RP_UP_EI 12500 + GEN6_RP_UP_THRESHOLD 11875 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 21250 + BETWEEN + GEN6_RP_UP_EI 10156 + GEN6_RP_UP_THRESHOLD 9140 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 18750 + HIGH_POWER + GEN6_RP_UP_EI 7812 + GEN6_RP_UP_THRESHOLD 6640 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 15000 + +And these are what we have after this patch: + LOW_POWER + GEN6_RP_UP_EI 12500 + GEN6_RP_UP_THRESHOLD 11875 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 21250 + BETWEEN + GEN6_RP_UP_EI 10175 + GEN6_RP_UP_THRESHOLD 9150 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 18750 + HIGH_POWER + GEN6_RP_UP_EI 7825 + GEN6_RP_UP_THRESHOLD 6650 + GEN6_RP_DOWN_EI 25000 + GEN6_RP_DOWN_THRESHOLD 15000 + +Cc: Akash Goel +Cc: Chris Wilson +Testcase: igt/kms_pipe_crc_basic/hang-read-crc-pipe-B +Fixes: 8a5864377b12 ("drm/i915/skl: Restructured the gen6_set_rps_thresholds function") +Signed-off-by: Ville Syrjälä +Link: http://patchwork.freedesktop.org/patch/msgid/1461159836-9108-1-git-send-email-ville.syrjala@linux.intel.com +Acked-by: Chris Wilson +Reviewed-by: Patrik Jakobsson +(cherry picked from commit 8a292d016d1cc4938ff14b4df25328230b08a408) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/i915_reg.h | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/i915/i915_reg.h ++++ b/drivers/gpu/drm/i915/i915_reg.h +@@ -2838,7 +2838,14 @@ enum skl_disp_power_wells { + #define GEN6_RP_STATE_CAP (MCHBAR_MIRROR_BASE_SNB + 0x5998) + #define BXT_RP_STATE_CAP 0x138170 + +-#define INTERVAL_1_28_US(us) (((us) * 100) >> 7) ++/* ++ * Make these a multiple of magic 25 to avoid SNB (eg. Dell XPS ++ * 8300) freezing up around GPU hangs. Looks as if even ++ * scheduling/timer interrupts start misbehaving if the RPS ++ * EI/thresholds are "bad", leading to a very sluggish or even ++ * frozen machine. ++ */ ++#define INTERVAL_1_28_US(us) roundup(((us) * 100) >> 7, 25) + #define INTERVAL_1_33_US(us) (((us) * 3) >> 2) + #define INTERVAL_0_833_US(us) (((us) * 6) / 5) + #define GT_INTERVAL_FROM_US(dev_priv, us) (IS_GEN9(dev_priv) ? \ diff --git a/queue-4.4/series b/queue-4.4/series index bb4cf96fd1f..71f21baf375 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -58,3 +58,7 @@ drm-amdgpu-set-metadata-pointer-to-null-after-freeing.patch iio-ak8975-fix-null-pointer-exception-on-early-interrupt.patch iio-ak8975-fix-maybe-uninitialized-warning.patch drm-radeon-make-sure-vertical-front-porch-is-at-least-1.patch +drm-i915-ddi-fix-edp-vdd-handling-during-booting-and-suspend-resume.patch +drm-i915-fix-edp-low-vswing-for-broadwell.patch +drm-i915-make-rps-ei-thresholds-multiple-of-25-on-snb-bdw.patch +drm-i915-fake-hdmi-live-status.patch -- 2.47.2