--- /dev/null
+From 14676ec6b1a6f2f7fa0bafd98ab42ce77be7a7d4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
+Date: Mon, 14 Nov 2016 18:35:09 +0200
+Subject: drm/i915: Fix cdclk vs. dev_cdclk mess when not recomputing things
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Ville Syrjälä <ville.syrjala@linux.intel.com>
+
+commit 14676ec6b1a6f2f7fa0bafd98ab42ce77be7a7d4 upstream.
+
+When we end up not recomputing the cdclk, we need to populate
+intel_state->cdclk with the "atomic_cdclk_freq" instead of the
+current cdclk_freq. When no pipes are active, the actual cdclk_freq
+may be lower than what the configuration of the planes and
+pipes would require from the point of view of the software state.
+
+This fixes bogus WARNS from skl_max_scale() which is trying to check
+the plane software state against the cdclk frequency. So any time
+it got called during DPMS off for instance, we might have tripped
+the warn if the current mode would have required a higher than
+minimum cdclk.
+
+v2: Drop the dev_cdclk stuff (Maarten)
+
+Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
+Cc: Mika Kahola <mika.kahola@intel.com>
+Cc: bruno.pagani@ens-lyon.org
+Cc: Daniel J Blueman <daniel.blueman@gmail.com>
+Cc: Paul Bolle <pebolle@tiscali.nl>
+Cc: Joseph Yasi <joe.yasi@gmail.com>
+Tested-by: Paul Bolle <pebolle@tiscali.nl>
+Tested-by: Joseph Yasi <joe.yasi@gmail.com> (v1)
+Fixes: 1a617b77658e ("drm/i915: Keep track of the cdclk as if all crtc's were active.")
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98214
+Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
+Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
+Link: http://patchwork.freedesktop.org/patch/msgid/1479141311-11904-2-git-send-email-ville.syrjala@linux.intel.com
+(cherry picked from commit e0ca7a6be38ce603d26df5707c22e53870a623e0)
+Signed-off-by: Jani Nikula <jani.nikula@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/intel_display.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/drivers/gpu/drm/i915/intel_display.c
++++ b/drivers/gpu/drm/i915/intel_display.c
+@@ -13970,8 +13970,9 @@ static int intel_modeset_checks(struct d
+
+ DRM_DEBUG_KMS("New cdclk calculated to be atomic %u, actual %u\n",
+ intel_state->cdclk, intel_state->dev_cdclk);
+- } else
++ } else {
+ to_intel_atomic_state(state)->cdclk = dev_priv->atomic_cdclk_freq;
++ }
+
+ intel_modeset_clear_plls(state);
+
+@@ -14072,8 +14073,9 @@ static int intel_atomic_check(struct drm
+
+ if (ret)
+ return ret;
+- } else
+- intel_state->cdclk = dev_priv->cdclk_freq;
++ } else {
++ intel_state->cdclk = dev_priv->atomic_cdclk_freq;
++ }
+
+ ret = drm_atomic_helper_check_planes(dev, state);
+ if (ret)
--- /dev/null
+From b1b7ec985805e005055d1d471ca586a715ffc10a Mon Sep 17 00:00:00 2001
+From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
+Date: Wed, 14 Dec 2016 14:26:20 +0200
+Subject: drm/i915: Fix setting of boost freq tunable
+
+From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
+
+commit b1b7ec985805e005055d1d471ca586a715ffc10a upstream.
+
+For limiting the max frequency of gpu, the max freq tunable
+is not enough to hard limit the max gap. We now have also per
+client boost max freq. When this tunable was introduced,
+it was mistakenly made read only. Allow user to gain control by
+setting it writable.
+
+Fixes: 29ecd78d3b79 ("drm/i915: Define a separate variable and control for RPS waitboost frequency")
+Cc: Chris Wilson <chris@chris-wilson.co.uk>
+Cc: Mika Kuoppala <mika.kuoppala@intel.com>
+Cc: Daniel Vetter <daniel.vetter@intel.com>
+Cc: Jani Nikula <jani.nikula@linux.intel.com>
+Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
+Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
+Link: http://patchwork.freedesktop.org/patch/msgid/1481718380-9170-1-git-send-email-mika.kuoppala@intel.com
+(cherry picked from commit 73a798711314b54cbd4fe224e24db92c306a8d8c)
+Signed-off-by: Jani Nikula <jani.nikula@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/i915_sysfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/i915/i915_sysfs.c
++++ b/drivers/gpu/drm/i915/i915_sysfs.c
+@@ -460,7 +460,7 @@ static ssize_t gt_min_freq_mhz_store(str
+
+ static DEVICE_ATTR(gt_act_freq_mhz, S_IRUGO, gt_act_freq_mhz_show, NULL);
+ static DEVICE_ATTR(gt_cur_freq_mhz, S_IRUGO, gt_cur_freq_mhz_show, NULL);
+-static DEVICE_ATTR(gt_boost_freq_mhz, S_IRUGO, gt_boost_freq_mhz_show, gt_boost_freq_mhz_store);
++static DEVICE_ATTR(gt_boost_freq_mhz, S_IRUGO | S_IWUSR, gt_boost_freq_mhz_show, gt_boost_freq_mhz_store);
+ static DEVICE_ATTR(gt_max_freq_mhz, S_IRUGO | S_IWUSR, gt_max_freq_mhz_show, gt_max_freq_mhz_store);
+ static DEVICE_ATTR(gt_min_freq_mhz, S_IRUGO | S_IWUSR, gt_min_freq_mhz_show, gt_min_freq_mhz_store);
+
--- /dev/null
+From 1f3dc3e334c1192ebe2939ea17ba12f4776f90c3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
+Date: Tue, 29 Nov 2016 16:13:57 +0200
+Subject: drm/i915: Initialize dev_priv->atomic_cdclk_freq at init time
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Ville Syrjälä <ville.syrjala@linux.intel.com>
+
+commit 1f3dc3e334c1192ebe2939ea17ba12f4776f90c3 upstream.
+
+Looks like we're only initializing dev_priv->atomic_cdclk_freq
+at resume and commit times, not at init time. Let's do that as
+well.
+
+We're now hitting the 'WARN_ON(intel_state->cdclk == 0)' in
+hsw_compute_linetime_wm() on account of populating
+intel_state->cdclk from dev_priv->atomic_cdclk_freq.
+Previously we were mispopulating intel_state->cdclk with
+dev_priv->cdclk_freq which always had a proper value at init
+time and hence the WARN_ON() didn't trigger.
+
+Cc: Matthew Auld <matthew.auld@intel.com>
+Reported-by: Matthew Auld <matthew.auld@intel.com>
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98902
+Fixes: 14676ec6b1a6 ("drm/i915: Fix cdclk vs. dev_cdclk mess when not recomputing things")
+Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
+Link: http://patchwork.freedesktop.org/patch/msgid/1480428837-4207-1-git-send-email-ville.syrjala@linux.intel.com
+Tested-by: Matthew Auld <matthew.auld@intel.com>
+Reviewed-by: Matthew Auld <matthew.auld@intel.com>
+(cherry picked from commit 6a259b1f8a9e99b1ed114f8bf8b0cfccee130e54)
+Signed-off-by: Jani Nikula <jani.nikula@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/intel_display.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/gpu/drm/i915/intel_display.c
++++ b/drivers/gpu/drm/i915/intel_display.c
+@@ -16443,6 +16443,7 @@ void intel_modeset_init(struct drm_devic
+
+ intel_update_czclk(dev_priv);
+ intel_update_cdclk(dev);
++ dev_priv->atomic_cdclk_freq = dev_priv->cdclk_freq;
+
+ intel_shared_dpll_init(dev);
+
--- /dev/null
+From 6ba0566cf2afcdb17bff882e3a95cbbcb22c4a83 Mon Sep 17 00:00:00 2001
+From: Paulo Zanoni <paulo.r.zanoni@intel.com>
+Date: Wed, 14 Dec 2016 12:55:37 -0200
+Subject: drm/i915: skip the first 4k of stolen memory on everything >= gen8
+
+From: Paulo Zanoni <paulo.r.zanoni@intel.com>
+
+commit 6ba0566cf2afcdb17bff882e3a95cbbcb22c4a83 upstream.
+
+BSpec got updated and this workaround is now listed as standard
+required programming for all subsequent projects. This is confirmed to
+fix Skylake screen flickering issues (probably caused by the fact that
+we initialized a ring in the first page of stolen, but I didn't 100%
+confirm this theory).
+
+v2: this is the patch that fixes the screen flickering, document it.
+
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94605
+Tested-by: Dominik Klementowski <dominik232@gmail.com>
+Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
+Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
+Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Link: http://patchwork.freedesktop.org/patch/msgid/1481727338-9901-1-git-send-email-paulo.r.zanoni@intel.com
+(cherry picked from commit d43537610470d8829ebd17cd7842f47176e35ebd)
+Signed-off-by: Jani Nikula <jani.nikula@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/i915_gem_stolen.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
++++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
+@@ -55,10 +55,9 @@ int i915_gem_stolen_insert_node_in_range
+ return -ENODEV;
+
+ /* See the comment at the drm_mm_init() call for more about this check.
+- * WaSkipStolenMemoryFirstPage:bdw,chv,kbl (incomplete)
++ * WaSkipStolenMemoryFirstPage:bdw+ (incomplete)
+ */
+- if (start < 4096 && (IS_GEN8(dev_priv) ||
+- IS_KBL_REVID(dev_priv, 0, KBL_REVID_A0)))
++ if (start < 4096 && INTEL_GEN(dev_priv) >= 8)
+ start = 4096;
+
+ mutex_lock(&dev_priv->mm.stolen_lock);
net-mvpp2-fix-dma-unmapping-of-tx-buffers-for-fragments.patch
drm-i915-dsi-fix-chv_exec_gpio-disabling-the-gpios-it-is-setting.patch
drm-i915-dsi-do-not-clear-dpounit_clock_gate_disable-from-vlv_init_display_clock_gating.patch
+drm-i915-fix-cdclk-vs.-dev_cdclk-mess-when-not-recomputing-things.patch
+drm-i915-initialize-dev_priv-atomic_cdclk_freq-at-init-time.patch
+drm-i915-skip-the-first-4k-of-stolen-memory-on-everything-gen8.patch
+drm-i915-fix-setting-of-boost-freq-tunable.patch