--- /dev/null
+From 88a9c66d998b1d2dac412fcd458c5d17d70513c8 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue, 14 Jan 2020 10:56:47 +0000
+Subject: drm/i915/pmu: Correct the rc6 offset upon enabling
+
+From: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 88a9c66d998b1d2dac412fcd458c5d17d70513c8 upstream.
+
+The rc6 residency starts ticking from 0 from BIOS POST, but the kernel
+starts measuring the time from its boot. If we start measuruing
+I915_PMU_RC6_RESIDENCY while the GT is idle, we start our sampling from
+0 and then upon first activity (park/unpark) add in all the rc6
+residency since boot. After the first park with the sampler engaged, the
+sleep/active counters are aligned.
+
+v2: With a wakeref to be sure
+
+Closes: https://gitlab.freedesktop.org/drm/intel/issues/973
+Fixes: df6a42053513 ("drm/i915/pmu: Ensure monotonic rc6")
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
+Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20200114105648.2172026-1-chris@chris-wilson.co.uk
+(cherry picked from commit f4e9894b6952a2819937f363cd42e7cd7894a1e4)
+Signed-off-by: Jani Nikula <jani.nikula@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/i915/i915_pmu.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+--- a/drivers/gpu/drm/i915/i915_pmu.c
++++ b/drivers/gpu/drm/i915/i915_pmu.c
+@@ -594,8 +594,10 @@ static void i915_pmu_enable(struct perf_
+ container_of(event->pmu, typeof(*i915), pmu.base);
+ unsigned int bit = event_enabled_bit(event);
+ struct i915_pmu *pmu = &i915->pmu;
++ intel_wakeref_t wakeref;
+ unsigned long flags;
+
++ wakeref = intel_runtime_pm_get(&i915->runtime_pm);
+ spin_lock_irqsave(&pmu->lock, flags);
+
+ /*
+@@ -605,6 +607,14 @@ static void i915_pmu_enable(struct perf_
+ BUILD_BUG_ON(ARRAY_SIZE(pmu->enable_count) != I915_PMU_MASK_BITS);
+ GEM_BUG_ON(bit >= ARRAY_SIZE(pmu->enable_count));
+ GEM_BUG_ON(pmu->enable_count[bit] == ~0);
++
++ if (pmu->enable_count[bit] == 0 &&
++ config_enabled_mask(I915_PMU_RC6_RESIDENCY) & BIT_ULL(bit)) {
++ pmu->sample[__I915_SAMPLE_RC6_LAST_REPORTED].cur = 0;
++ pmu->sample[__I915_SAMPLE_RC6].cur = __get_rc6(&i915->gt);
++ pmu->sleep_last = ktime_get();
++ }
++
+ pmu->enable |= BIT_ULL(bit);
+ pmu->enable_count[bit]++;
+
+@@ -645,6 +655,8 @@ static void i915_pmu_enable(struct perf_
+ * an existing non-zero value.
+ */
+ local64_set(&event->hw.prev_count, __i915_pmu_event_read(event));
++
++ intel_runtime_pm_put(&i915->runtime_pm, wakeref);
+ }
+
+ static void i915_pmu_disable(struct perf_event *event)
--- /dev/null
+From cf913e9683273f2640501094fa63a67e29f437b3 Mon Sep 17 00:00:00 2001
+From: Jernej Skrabec <jernej.skrabec@siol.net>
+Date: Sun, 26 Jan 2020 07:59:37 +0100
+Subject: Revert "drm/sun4i: drv: Allow framebuffer modifiers in mode config"
+
+From: Jernej Skrabec <jernej.skrabec@siol.net>
+
+commit cf913e9683273f2640501094fa63a67e29f437b3 upstream.
+
+This reverts commit 9db9c0cf5895e4ddde2814360cae7bea9282edd2.
+
+Setting mode_config.allow_fb_modifiers manually is completely
+unnecessary. It is set automatically by drm_universal_plane_init() based
+on the fact if modifier list is provided or not. Even more, it breaks
+DE2 and DE3 as they don't support any modifiers beside linear. Modifiers
+aware applications can be confused by provided empty modifier list - at
+least linear modifier should be included, but it's not for DE2 and DE3.
+
+Fixes: 9db9c0cf5895 ("drm/sun4i: drv: Allow framebuffer modifiers in mode config")
+Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
+Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+Link: https://patchwork.freedesktop.org/patch/msgid/20200126065937.9564-1-jernej.skrabec@siol.net
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/sun4i/sun4i_drv.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
++++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
+@@ -85,7 +85,6 @@ static int sun4i_drv_bind(struct device
+ }
+
+ drm_mode_config_init(drm);
+- drm->mode_config.allow_fb_modifiers = true;
+
+ ret = component_bind_all(drm->dev, drm);
+ if (ret) {