From: Greg Kroah-Hartman Date: Fri, 28 Oct 2016 15:31:44 +0000 (-0400) Subject: 4.8-stable patches X-Git-Tag: v4.4.29~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=04d4dde205fe87cda1c18d1a299ea1be447d00ce;p=thirdparty%2Fkernel%2Fstable-queue.git 4.8-stable patches added patches: drm-i915-allow-dp-to-work-w-o-edid.patch drm-i915-allow-pch-dpll-sharing-regardless-of-dpll_sdvo_high_speed.patch drm-i915-just-clear-the-mmiodebug-before-a-register-access.patch drm-i915-move-long-hpd-handling-into-the-hotplug-work.patch drm-i915-skl-ensure-pipes-with-changed-wms-get-added-to-the-state.patch drm-i915-unalias-obj-phys_handle-and-obj-userptr.patch --- diff --git a/queue-4.8/drm-i915-allow-dp-to-work-w-o-edid.patch b/queue-4.8/drm-i915-allow-dp-to-work-w-o-edid.patch new file mode 100644 index 00000000000..418c1e777b0 --- /dev/null +++ b/queue-4.8/drm-i915-allow-dp-to-work-w-o-edid.patch @@ -0,0 +1,111 @@ +From 16c83fad79ca912b8b5bbdcb5272794a2be41262 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= +Date: Mon, 3 Oct 2016 10:55:16 +0300 +Subject: drm/i915: Allow DP to work w/o EDID +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ville Syrjälä + +commit 16c83fad79ca912b8b5bbdcb5272794a2be41262 upstream. + +Allow returning "connected" or "unknown" connector status for DP branch +devices that don't have an EDID. Currently we'd claim the thing as +"disconnected" if there is no EDID. + +This stuff used to broken already, I think, but it got more broken by +commit f21a21983ef1 ("drm/i915: Splitting intel_dp_detect") + +Cc: Damien Cassou +Cc: freedesktop.org@gp.mailgun.org +Cc: Arno +Cc: Shubhangi Shrivastava +Cc: Sivakumar Thulasimani +Cc: Ander Conselvan de Oliveira +Tested-by: Arno +Fixes: f21a21983ef1 ("drm/i915: Splitting intel_dp_detect") +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83348 +Signed-off-by: Ville Syrjälä +Link: http://patchwork.freedesktop.org/patch/msgid/1475481316-8194-2-git-send-email-ville.syrjala@linux.intel.com +Reviewed-by: Ander Conselvan de Oliveira +(cherry picked from commit 5cb651a7959310ef4dbb0b93f005b10286789656) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_dp.c | 22 +++++++++------------- + 1 file changed, 9 insertions(+), 13 deletions(-) + +--- a/drivers/gpu/drm/i915/intel_dp.c ++++ b/drivers/gpu/drm/i915/intel_dp.c +@@ -4207,7 +4207,7 @@ intel_dp_unset_edid(struct intel_dp *int + intel_dp->has_audio = false; + } + +-static void ++static enum drm_connector_status + intel_dp_long_pulse(struct intel_connector *intel_connector) + { + struct drm_connector *connector = &intel_connector->base; +@@ -4232,7 +4232,7 @@ intel_dp_long_pulse(struct intel_connect + else + status = connector_status_disconnected; + +- if (status != connector_status_connected) { ++ if (status == connector_status_disconnected) { + intel_dp->compliance_test_active = 0; + intel_dp->compliance_test_type = 0; + intel_dp->compliance_test_data = 0; +@@ -4284,8 +4284,8 @@ intel_dp_long_pulse(struct intel_connect + intel_dp->aux.i2c_defer_count = 0; + + intel_dp_set_edid(intel_dp); +- +- status = connector_status_connected; ++ if (is_edp(intel_dp) || intel_connector->detect_edid) ++ status = connector_status_connected; + intel_dp->detect_done = true; + + /* Try to read the source of the interrupt */ +@@ -4303,12 +4303,11 @@ intel_dp_long_pulse(struct intel_connect + } + + out: +- if ((status != connector_status_connected) && +- (intel_dp->is_mst == false)) ++ if (status != connector_status_connected && !intel_dp->is_mst) + intel_dp_unset_edid(intel_dp); + + intel_display_power_put(to_i915(dev), power_domain); +- return; ++ return status; + } + + static enum drm_connector_status +@@ -4317,7 +4316,7 @@ intel_dp_detect(struct drm_connector *co + struct intel_dp *intel_dp = intel_attached_dp(connector); + struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); + struct intel_encoder *intel_encoder = &intel_dig_port->base; +- struct intel_connector *intel_connector = to_intel_connector(connector); ++ enum drm_connector_status status = connector->status; + + DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", + connector->base.id, connector->name); +@@ -4332,14 +4331,11 @@ intel_dp_detect(struct drm_connector *co + + /* If full detect is not performed yet, do a full detect */ + if (!intel_dp->detect_done) +- intel_dp_long_pulse(intel_dp->attached_connector); ++ status = intel_dp_long_pulse(intel_dp->attached_connector); + + intel_dp->detect_done = false; + +- if (is_edp(intel_dp) || intel_connector->detect_edid) +- return connector_status_connected; +- else +- return connector_status_disconnected; ++ return status; + } + + static void diff --git a/queue-4.8/drm-i915-allow-pch-dpll-sharing-regardless-of-dpll_sdvo_high_speed.patch b/queue-4.8/drm-i915-allow-pch-dpll-sharing-regardless-of-dpll_sdvo_high_speed.patch new file mode 100644 index 00000000000..4cf6873a54a --- /dev/null +++ b/queue-4.8/drm-i915-allow-pch-dpll-sharing-regardless-of-dpll_sdvo_high_speed.patch @@ -0,0 +1,76 @@ +From a3fd4c67af3d8a81d241b3d51b3525f36f1d68bb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= +Date: Mon, 26 Sep 2016 11:30:46 +0300 +Subject: drm/i915: Allow PCH DPLL sharing regardless of DPLL_SDVO_HIGH_SPEED +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ville Syrjälä + +commit a3fd4c67af3d8a81d241b3d51b3525f36f1d68bb upstream. + +DPLL_SDVO_HIGH_SPEED must be set for SDVO/HDMI/DP, but nowhere is it +forbidden to set it for LVDS/CRT as well. So let's also set it on +CRT to make it possible to share the DPLL between HDMI and CRT. + +What that bit apparently does is enable the x5 clock to the port, +which then pumps out the bits on both edges of the clock. The DAC +doesn't need that clock since it's not pumping out bits, but I don't +think it hurts to have the DPLL output that clock anyway. + +This is fairly important on IVB since it has only two DPLLs with three +pipes. So trying to drive three or more PCH ports with three pipes +is only possible when at least one of the DPLLs gets shared between +two of the pipes. + +SNB doesn't really need to do this since it has only two pipes. It could +be done to avoid enabling the second DPLL at all in certain cases, but +I'm not sure that's such a huge win. So let's not do it for SNB, at +least for now. On ILK it never makes sense as the DPLLs can't be shared. + +v2: Just always enable the high speed clock to keep things simple (Daniel) + Beef up the commit message a bit (Daniel) + +Cc: Nick Yamane +Cc: Daniel Vetter +Tested-by: Nick Yamane +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97204 +Signed-off-by: Ville Syrjälä +Link: http://patchwork.freedesktop.org/patch/msgid/1474878646-17711-1-git-send-email-ville.syrjala@linux.intel.com +Reviewed-by: Ander Conselvan de Oliveira +(cherry picked from commit 7d7f8633a82763577727762ff3ac1df3017cb8fe) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_display.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +--- a/drivers/gpu/drm/i915/intel_display.c ++++ b/drivers/gpu/drm/i915/intel_display.c +@@ -9007,6 +9007,24 @@ static void ironlake_compute_dpll(struct + if (intel_crtc_has_dp_encoder(crtc_state)) + dpll |= DPLL_SDVO_HIGH_SPEED; + ++ /* ++ * The high speed IO clock is only really required for ++ * SDVO/HDMI/DP, but we also enable it for CRT to make it ++ * possible to share the DPLL between CRT and HDMI. Enabling ++ * the clock needlessly does no real harm, except use up a ++ * bit of power potentially. ++ * ++ * We'll limit this to IVB with 3 pipes, since it has only two ++ * DPLLs and so DPLL sharing is the only way to get three pipes ++ * driving PCH ports at the same time. On SNB we could do this, ++ * and potentially avoid enabling the second DPLL, but it's not ++ * clear if it''s a win or loss power wise. No point in doing ++ * this on ILK at all since it has a fixed DPLL<->pipe mapping. ++ */ ++ if (INTEL_INFO(dev_priv)->num_pipes == 3 && ++ intel_crtc_has_type(crtc_state, INTEL_OUTPUT_ANALOG)) ++ dpll |= DPLL_SDVO_HIGH_SPEED; ++ + /* compute bitmask from p1 value */ + dpll |= (1 << (crtc_state->dpll.p1 - 1)) << DPLL_FPA01_P1_POST_DIV_SHIFT; + /* also FPA1 */ diff --git a/queue-4.8/drm-i915-just-clear-the-mmiodebug-before-a-register-access.patch b/queue-4.8/drm-i915-just-clear-the-mmiodebug-before-a-register-access.patch new file mode 100644 index 00000000000..85b64a22ef7 --- /dev/null +++ b/queue-4.8/drm-i915-just-clear-the-mmiodebug-before-a-register-access.patch @@ -0,0 +1,43 @@ +From f856f847b22c52be82f712ea6ada946c6db884d7 Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Mon, 3 Oct 2016 13:45:14 +0100 +Subject: drm/i915: Just clear the mmiodebug before a register access + +From: Chris Wilson + +commit f856f847b22c52be82f712ea6ada946c6db884d7 upstream. + +When we enable the per-register access mmiodebug, it is to detect which +access is illegal. Reporting on earlier untraced access outside of the +mmiodebug does not help debugging (as the suspicion is immediately put +upon the current register which is not at fault)! + +References: https://bugs.freedesktop.org/show_bug.cgi?id=97985 +Signed-off-by: Chris Wilson +Cc: Mika Kuoppala +Reviewed-by: Mika Kuoppala +Link: http://patchwork.freedesktop.org/patch/msgid/20161003124516.12388-1-chris@chris-wilson.co.uk +(cherry picked from commit dda960335e020835f7f1c12760e7f0b525b451e2) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_uncore.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/drivers/gpu/drm/i915/intel_uncore.c ++++ b/drivers/gpu/drm/i915/intel_uncore.c +@@ -796,10 +796,9 @@ __unclaimed_reg_debug(struct drm_i915_pr + const bool read, + const bool before) + { +- if (WARN(check_for_unclaimed_mmio(dev_priv), +- "Unclaimed register detected %s %s register 0x%x\n", +- before ? "before" : "after", +- read ? "reading" : "writing to", ++ if (WARN(check_for_unclaimed_mmio(dev_priv) && !before, ++ "Unclaimed %s register 0x%x\n", ++ read ? "read from" : "write to", + i915_mmio_reg_offset(reg))) + i915.mmio_debug--; /* Only report the first N failures */ + } diff --git a/queue-4.8/drm-i915-move-long-hpd-handling-into-the-hotplug-work.patch b/queue-4.8/drm-i915-move-long-hpd-handling-into-the-hotplug-work.patch new file mode 100644 index 00000000000..5cb94eba592 --- /dev/null +++ b/queue-4.8/drm-i915-move-long-hpd-handling-into-the-hotplug-work.patch @@ -0,0 +1,102 @@ +From 1015811609c0328b5ed670d07748591b837e74eb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= +Date: Mon, 3 Oct 2016 10:55:15 +0300 +Subject: drm/i915: Move long hpd handling into the hotplug work +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ville Syrjälä + +commit 1015811609c0328b5ed670d07748591b837e74eb upstream. + +We can't rely on connector->status in the detect() hook if the long hpd +was already handled by the dig_port_work as that won't update +connector->status. Thus we have to defer the long hpd handling entirely +until the hotplug work runs to avoid the double long hpd handling +the "detect_done" flag is trying to prevent. + +We'll start to depend on connector->status being up to date in a +following patch. + +Cc: Damien Cassou +Cc: freedesktop.org@gp.mailgun.org +Cc: Arno +Cc: Shubhangi Shrivastava +Cc: Sivakumar Thulasimani +Cc: Ander Conselvan de Oliveira +Tested-by: Arno +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83348 +Signed-off-by: Ville Syrjälä +Link: http://patchwork.freedesktop.org/patch/msgid/1475481316-8194-1-git-send-email-ville.syrjala@linux.intel.com +Reviewed-by: Ander Conselvan de Oliveira +(cherry picked from commit 27d4efc5591a5853de54713bc717de73c8951e17) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_dp.c | 48 +++++++++++++++++++--------------------- + 1 file changed, 23 insertions(+), 25 deletions(-) + +--- a/drivers/gpu/drm/i915/intel_dp.c ++++ b/drivers/gpu/drm/i915/intel_dp.c +@@ -4696,36 +4696,34 @@ intel_dp_hpd_pulse(struct intel_digital_ + port_name(intel_dig_port->port), + long_hpd ? "long" : "short"); + ++ if (long_hpd) { ++ intel_dp->detect_done = false; ++ return IRQ_NONE; ++ } ++ + power_domain = intel_display_port_aux_power_domain(intel_encoder); + intel_display_power_get(dev_priv, power_domain); + +- if (long_hpd) { +- intel_dp_long_pulse(intel_dp->attached_connector); +- if (intel_dp->is_mst) +- ret = IRQ_HANDLED; +- goto put_power; +- +- } else { +- if (intel_dp->is_mst) { +- if (intel_dp_check_mst_status(intel_dp) == -EINVAL) { +- /* +- * If we were in MST mode, and device is not +- * there, get out of MST mode +- */ +- DRM_DEBUG_KMS("MST device may have disappeared %d vs %d\n", +- intel_dp->is_mst, intel_dp->mst_mgr.mst_state); +- intel_dp->is_mst = false; +- drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr, +- intel_dp->is_mst); +- goto put_power; +- } ++ if (intel_dp->is_mst) { ++ if (intel_dp_check_mst_status(intel_dp) == -EINVAL) { ++ /* ++ * If we were in MST mode, and device is not ++ * there, get out of MST mode ++ */ ++ DRM_DEBUG_KMS("MST device may have disappeared %d vs %d\n", ++ intel_dp->is_mst, intel_dp->mst_mgr.mst_state); ++ intel_dp->is_mst = false; ++ drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr, ++ intel_dp->is_mst); ++ intel_dp->detect_done = false; ++ goto put_power; + } ++ } + +- if (!intel_dp->is_mst) { +- if (!intel_dp_short_pulse(intel_dp)) { +- intel_dp_long_pulse(intel_dp->attached_connector); +- goto put_power; +- } ++ if (!intel_dp->is_mst) { ++ if (!intel_dp_short_pulse(intel_dp)) { ++ intel_dp->detect_done = false; ++ goto put_power; + } + } + diff --git a/queue-4.8/drm-i915-skl-ensure-pipes-with-changed-wms-get-added-to-the-state.patch b/queue-4.8/drm-i915-skl-ensure-pipes-with-changed-wms-get-added-to-the-state.patch new file mode 100644 index 00000000000..58ac3c6a1b3 --- /dev/null +++ b/queue-4.8/drm-i915-skl-ensure-pipes-with-changed-wms-get-added-to-the-state.patch @@ -0,0 +1,43 @@ +From 05a76d3d6ad1ee9f9814f88949cc9305fc165460 Mon Sep 17 00:00:00 2001 +From: Lyude +Date: Wed, 17 Aug 2016 15:55:57 -0400 +Subject: drm/i915/skl: Ensure pipes with changed wms get added to the state +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Lyude + +commit 05a76d3d6ad1ee9f9814f88949cc9305fc165460 upstream. + +If we're enabling a pipe, we'll need to modify the watermarks on all +active planes. Since those planes won't be added to the state on +their own, we need to add them ourselves. + +Signed-off-by: Lyude +Reviewed-by: Matt Roper +Cc: Ville Syrjälä +Cc: Daniel Vetter +Cc: Radhakrishna Sripada +Cc: Hans de Goede +Signed-off-by: Maarten Lankhorst +Link: http://patchwork.freedesktop.org/patch/msgid/1471463761-26796-6-git-send-email-cpaul@redhat.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/intel_pm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/gpu/drm/i915/intel_pm.c ++++ b/drivers/gpu/drm/i915/intel_pm.c +@@ -4065,6 +4065,10 @@ skl_compute_ddb(struct drm_atomic_state + ret = skl_ddb_add_affected_planes(cstate); + if (ret) + return ret; ++ ++ ret = drm_atomic_add_affected_planes(state, &intel_crtc->base); ++ if (ret) ++ return ret; + } + + return 0; diff --git a/queue-4.8/drm-i915-unalias-obj-phys_handle-and-obj-userptr.patch b/queue-4.8/drm-i915-unalias-obj-phys_handle-and-obj-userptr.patch new file mode 100644 index 00000000000..53219119054 --- /dev/null +++ b/queue-4.8/drm-i915-unalias-obj-phys_handle-and-obj-userptr.patch @@ -0,0 +1,61 @@ +From ca5732c53bf66ad755284786897e0dd10330de87 Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Mon, 3 Oct 2016 13:45:15 +0100 +Subject: drm/i915: Unalias obj->phys_handle and obj->userptr + +From: Chris Wilson + +commit ca5732c53bf66ad755284786897e0dd10330de87 upstream. + +We use obj->phys_handle to choose the pread/pwrite path, but as +obj->phys_handle is a union with obj->userptr, we then mistakenly use +the phys_handle path for userptr objects within pread/pwrite. + +Testcase: igt/gem_userptr_blits/forbidden-operations +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97519 +Signed-off-by: Chris Wilson +Reviewed-by: Joonas Lahtinen +Link: http://patchwork.freedesktop.org/patch/msgid/20161003124516.12388-2-chris@chris-wilson.co.uk +(cherry picked from commit 5f12b80a0b42da253691ca03828033014bb786eb) +Signed-off-by: Jani Nikula +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/i915/i915_drv.h | 24 +++++++++++------------- + 1 file changed, 11 insertions(+), 13 deletions(-) + +--- a/drivers/gpu/drm/i915/i915_drv.h ++++ b/drivers/gpu/drm/i915/i915_drv.h +@@ -2282,21 +2282,19 @@ struct drm_i915_gem_object { + /** Record of address bit 17 of each page at last unbind. */ + unsigned long *bit_17; + +- union { +- /** for phy allocated objects */ +- struct drm_dma_handle *phys_handle; +- +- struct i915_gem_userptr { +- uintptr_t ptr; +- unsigned read_only :1; +- unsigned workers :4; ++ struct i915_gem_userptr { ++ uintptr_t ptr; ++ unsigned read_only :1; ++ unsigned workers :4; + #define I915_GEM_USERPTR_MAX_WORKERS 15 + +- struct i915_mm_struct *mm; +- struct i915_mmu_object *mmu_object; +- struct work_struct *work; +- } userptr; +- }; ++ struct i915_mm_struct *mm; ++ struct i915_mmu_object *mmu_object; ++ struct work_struct *work; ++ } userptr; ++ ++ /** for phys allocated objects */ ++ struct drm_dma_handle *phys_handle; + }; + #define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base) + diff --git a/queue-4.8/series b/queue-4.8/series index 15dd60af2d3..26cf8fb4314 100644 --- a/queue-4.8/series +++ b/queue-4.8/series @@ -30,3 +30,9 @@ drm-i915-introduce-intel_has_sagv.patch drm-i915-kbl-kbl-also-needs-to-run-the-sagv-code.patch revert-drm-i915-check-live-status-before-reading-edid.patch drm-i915-account-for-tseg-size-when-determining-865g-stolen-base.patch +drm-i915-skl-ensure-pipes-with-changed-wms-get-added-to-the-state.patch +drm-i915-allow-pch-dpll-sharing-regardless-of-dpll_sdvo_high_speed.patch +drm-i915-move-long-hpd-handling-into-the-hotplug-work.patch +drm-i915-allow-dp-to-work-w-o-edid.patch +drm-i915-just-clear-the-mmiodebug-before-a-register-access.patch +drm-i915-unalias-obj-phys_handle-and-obj-userptr.patch