summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-09-25 16:15:20 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-09-25 16:15:20 +0000
commit476217eb29093d7f01f8034efd43f0be3d7cd08b (patch)
tree61b6323cef74d2e90ec3a08e33870a84f8716013 /sys
parente5270a9955f676e7149134e455e6375c4b5b842e (diff)
3.14 backports of some Broadwell fixes from
http://lists.freedesktop.org/archives/intel-gfx/2014-March/042121.html Ben Widawsky drm/i915/bdw: Restore PPAT on thaw a2319c08bfd849ea32b4f890ce92df86074c5731 Ville Syrjala drm/i915: We implement WaDisableAsyncFlipPerfMode:bdw 8285222c487b61c48b9b955b82598544c3c06050 Ben Widawsky drm/i915/bdw: Use scratch page table for GEN8 PPGTT 8407bb9129da95fc4099b84cdbbc23e6d4f66aee Jani Nikula drm/i915: don't flood the logs about bdw semaphores c923facd535b97972b5bb7d3df4fcafd61a63a5e Ville Syrjala drm/i915: Implement WaDisableSDEUnitClockGating:bdw 4f1ca9e94057de098d65bc7477e8f89dd51609aa Ville Syrjala drm/i915: Don't clobber CHICKEN_PIPESL_1 on BDW c7c656226842679bcd9f39dc24441b4ff398a850 Kenneth Graunke drm/i915: Add a partial instruction shootdown workaround on Broadwell. c8966e1058e1e8ae2eec4211157847032829697a Damien Lespiau drm/i915/bdw: The TLB invalidation mechanism has been removed from INSTPM dc616b89dbc4bb6a99884d214bd1ed1e0eef59a0 Kenneth Graunke drm/i915: Add thread stall DOP clock gating workaround on Broadwell. 1411e6a57a1836ba8a3d4f17c8733b2fbaf0f005 Ville Syrjala drm/i915: Disable semaphore wait event idle message on BDW 295e8bb73a4785b65db6655fbf6ad57c4177b551 Mika Kuoppala drm/i915: Do forcewake reset on gen8 0a089e3355d77f758e46db54a0a81d4b58a28cc3 Mika Kuoppala drm/i915: Fix forcewake counts for gen8 e9dbd2b20201b49b04476d2e5763faa822967913 ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/i915/i915_drv.c6
-rw-r--r--sys/dev/pci/drm/i915/i915_gem_gtt.c9
-rw-r--r--sys/dev/pci/drm/i915/i915_reg.h12
-rw-r--r--sys/dev/pci/drm/i915/intel_pm.c20
-rw-r--r--sys/dev/pci/drm/i915/intel_ringbuffer.c14
-rw-r--r--sys/dev/pci/drm/i915/intel_uncore.c31
6 files changed, 64 insertions, 28 deletions
diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c
index c8d60dbce80..a229f758d0b 100644
--- a/sys/dev/pci/drm/i915/i915_drv.c
+++ b/sys/dev/pci/drm/i915/i915_drv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_drv.c,v 1.88 2015/09/25 16:05:59 kettenis Exp $ */
+/* $OpenBSD: i915_drv.c,v 1.89 2015/09/25 16:15:19 jsg Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
@@ -589,10 +589,8 @@ bool i915_semaphore_is_enabled(struct drm_device *dev)
return false;
/* Until we get further testing... */
- if (IS_GEN8(dev)) {
- WARN_ON(!i915_preliminary_hw_support);
+ if (IS_GEN8(dev))
return false;
- }
if (i915_semaphores >= 0)
return i915_semaphores;
diff --git a/sys/dev/pci/drm/i915/i915_gem_gtt.c b/sys/dev/pci/drm/i915/i915_gem_gtt.c
index 0736212eb37..836d20ee5af 100644
--- a/sys/dev/pci/drm/i915/i915_gem_gtt.c
+++ b/sys/dev/pci/drm/i915/i915_gem_gtt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_gem_gtt.c,v 1.10 2015/09/23 23:12:12 kettenis Exp $ */
+/* $OpenBSD: i915_gem_gtt.c,v 1.11 2015/09/25 16:15:19 jsg Exp $ */
/*
* Copyright © 2010 Daniel Vetter
*
@@ -36,6 +36,8 @@
#define _PAGE_PWT PG_WT
#define _PAGE_PCD PG_N
+static void gen8_setup_private_ppat(struct drm_i915_private *dev_priv);
+
#define GEN6_PPGTT_PD_ENTRIES 512
#define I915_PPGTT_PT_ENTRIES (PAGE_SIZE / sizeof(gen6_gtt_pte_t))
typedef uint64_t gen8_gtt_pte_t;
@@ -368,6 +370,7 @@ static void gen8_ppgtt_cleanup(struct i915_address_space *vm)
**/
static int gen8_ppgtt_init(struct i915_hw_ppgtt *ppgtt, uint64_t size)
{
+ struct drm_i915_private *dev_priv = ppgtt->base.dev->dev_private;
struct page *pt_pages;
int i, j, ret = -ENOMEM;
const int max_pdp = DIV_ROUND_UP(size, 1 << 30);
@@ -398,6 +401,7 @@ static int gen8_ppgtt_init(struct i915_hw_ppgtt *ppgtt, uint64_t size)
ppgtt->base.clear_range = gen8_ppgtt_clear_range;
ppgtt->base.insert_entries = gen8_ppgtt_insert_entries;
ppgtt->base.cleanup = gen8_ppgtt_cleanup;
+ ppgtt->base.scratch = dev_priv->gtt.base.scratch;
ppgtt->base.start = 0;
ppgtt->base.total = ppgtt->num_pt_pages * GEN8_PTES_PER_PAGE * PAGE_SIZE;
@@ -890,6 +894,9 @@ void i915_gem_restore_gtt_mappings(struct drm_device *dev)
i915_gem_gtt_bind_object(obj, obj->cache_level);
}
+ if (INTEL_INFO(dev)->gen >= 8)
+ gen8_setup_private_ppat(dev_priv);
+
i915_ggtt_flush(dev_priv);
}
diff --git a/sys/dev/pci/drm/i915/i915_reg.h b/sys/dev/pci/drm/i915/i915_reg.h
index 7d1696428c4..8aab4400005 100644
--- a/sys/dev/pci/drm/i915/i915_reg.h
+++ b/sys/dev/pci/drm/i915/i915_reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_reg.h,v 1.10 2015/09/23 23:12:12 kettenis Exp $ */
+/* $OpenBSD: i915_reg.h,v 1.11 2015/09/25 16:15:19 jsg Exp $ */
/* Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
@@ -946,6 +946,9 @@
#define GEN6_BLITTER_LOCK_SHIFT 16
#define GEN6_BLITTER_FBC_NOTIFY (1<<3)
+#define GEN6_RC_SLEEP_PSMI_CONTROL 0x2050
+#define GEN8_RC_SEMA_IDLE_MSG_DISABLE (1 << 12)
+
#define GEN6_BSD_SLEEP_PSMI_CONTROL 0x12050
#define GEN6_BSD_SLEEP_MSG_DISABLE (1 << 0)
#define GEN6_BSD_SLEEP_FLUSH_DISABLE (1 << 2)
@@ -4871,6 +4874,9 @@
#define GEN7_UCGCTL4 0x940c
#define GEN7_L3BANK2X_CLOCK_GATE_DISABLE (1<<25)
+#define GEN8_UCGCTL6 0x9430
+#define GEN8_SDEUNIT_CLOCK_GATE_DISABLE (1<<14)
+
#define GEN6_RPNSWREQ 0xA008
#define GEN6_TURBO_DISABLE (1<<31)
#define GEN6_FREQUENCY(x) ((x)<<25)
@@ -5012,6 +5018,10 @@
#define GEN7_SINGLE_SUBSCAN_DISPATCH_ENABLE (1<<10)
#define GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE (1<<3)
+#define GEN8_ROW_CHICKEN 0xe4f0
+#define PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE (1<<8)
+#define STALL_DOP_GATING_DISABLE (1<<5)
+
#define GEN7_ROW_CHICKEN2 0xe4f4
#define GEN7_ROW_CHICKEN2_GT2 0xf4f4
#define DOP_CLOCK_GATING_DISABLE (1<<0)
diff --git a/sys/dev/pci/drm/i915/intel_pm.c b/sys/dev/pci/drm/i915/intel_pm.c
index ff43a4288e1..c112f08d7dc 100644
--- a/sys/dev/pci/drm/i915/intel_pm.c
+++ b/sys/dev/pci/drm/i915/intel_pm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_pm.c,v 1.37 2015/09/23 23:12:12 kettenis Exp $ */
+/* $OpenBSD: intel_pm.c,v 1.38 2015/09/25 16:15:19 jsg Exp $ */
/*
* Copyright © 2012 Intel Corporation
*
@@ -4723,6 +4723,13 @@ static void gen8_init_clock_gating(struct drm_device *dev)
WARN(!i915_preliminary_hw_support,
"GEN8_CENTROID_PIXEL_OPT_DIS not be needed for production\n");
+
+ /* WaDisablePartialInstShootdown:bdw */
+ /* WaDisableThreadStallDopClockGating:bdw */
+ I915_WRITE(GEN8_ROW_CHICKEN,
+ _MASKED_BIT_ENABLE(PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE |
+ STALL_DOP_GATING_DISABLE));
+
I915_WRITE(HALF_SLICE_CHICKEN3,
_MASKED_BIT_ENABLE(GEN8_CENTROID_PIXEL_OPT_DIS));
I915_WRITE(HALF_SLICE_CHICKEN3,
@@ -4748,8 +4755,8 @@ static void gen8_init_clock_gating(struct drm_device *dev)
/* WaPsrDPRSUnmaskVBlankInSRD:bdw */
for_each_pipe(i) {
I915_WRITE(CHICKEN_PIPESL_1(i),
- I915_READ(CHICKEN_PIPESL_1(i) |
- DPRS_MASK_VBLANK_SRD));
+ I915_READ(CHICKEN_PIPESL_1(i)) |
+ DPRS_MASK_VBLANK_SRD);
}
/* Use Force Non-Coherent whenever executing a 3D context. This is a
@@ -4765,6 +4772,13 @@ static void gen8_init_clock_gating(struct drm_device *dev)
I915_WRITE(GEN7_FF_THREAD_MODE,
I915_READ(GEN7_FF_THREAD_MODE) &
~(GEN8_FF_DS_REF_CNT_FFME | GEN7_FF_VS_REF_CNT_FFME));
+
+ I915_WRITE(GEN6_RC_SLEEP_PSMI_CONTROL,
+ _MASKED_BIT_ENABLE(GEN8_RC_SEMA_IDLE_MSG_DISABLE));
+
+ /* WaDisableSDEUnitClockGating:bdw */
+ I915_WRITE(GEN8_UCGCTL6, I915_READ(GEN8_UCGCTL6) |
+ GEN8_SDEUNIT_CLOCK_GATE_DISABLE);
}
static void haswell_init_clock_gating(struct drm_device *dev)
diff --git a/sys/dev/pci/drm/i915/intel_ringbuffer.c b/sys/dev/pci/drm/i915/intel_ringbuffer.c
index 3cde2403662..7c450eba16f 100644
--- a/sys/dev/pci/drm/i915/intel_ringbuffer.c
+++ b/sys/dev/pci/drm/i915/intel_ringbuffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_ringbuffer.c,v 1.30 2015/09/23 23:12:12 kettenis Exp $ */
+/* $OpenBSD: intel_ringbuffer.c,v 1.31 2015/09/25 16:15:19 jsg Exp $ */
/*
* Copyright © 2008-2010 Intel Corporation
*
@@ -582,7 +582,7 @@ static int init_render_ring(struct intel_ring_buffer *ring)
* to use MI_WAIT_FOR_EVENT within the CS. It should already be
* programmed to '1' on all products.
*
- * WaDisableAsyncFlipPerfMode:snb,ivb,hsw,vlv
+ * WaDisableAsyncFlipPerfMode:snb,ivb,hsw,vlv,bdw
*/
if (INTEL_INFO(dev)->gen >= 6)
I915_WRITE(MI_MODE, _MASKED_BIT_ENABLE(ASYNC_FLIP_PERF_DISABLE));
@@ -991,8 +991,14 @@ void intel_ring_setup_status_page(struct intel_ring_buffer *ring)
I915_WRITE(mmio, (u32)ring->status_page.gfx_addr);
POSTING_READ(mmio);
- /* Flush the TLB for this page */
- if (INTEL_INFO(dev)->gen >= 6) {
+ /*
+ * Flush the TLB for this page
+ *
+ * FIXME: These two bits have disappeared on gen8, so a question
+ * arises: do we still need this and if so how should we go about
+ * invalidating the TLB?
+ */
+ if (INTEL_INFO(dev)->gen >= 6 && INTEL_INFO(dev)->gen < 8) {
u32 reg = RING_INSTPM(ring->mmio_base);
I915_WRITE(reg,
_MASKED_BIT_ENABLE(INSTPM_TLB_INVALIDATE |
diff --git a/sys/dev/pci/drm/i915/intel_uncore.c b/sys/dev/pci/drm/i915/intel_uncore.c
index fcf9f6dbe17..91e98ab319a 100644
--- a/sys/dev/pci/drm/i915/intel_uncore.c
+++ b/sys/dev/pci/drm/i915/intel_uncore.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_uncore.c,v 1.1 2015/09/23 23:12:12 kettenis Exp $ */
+/* $OpenBSD: intel_uncore.c,v 1.2 2015/09/25 16:15:19 jsg Exp $ */
/*
* Copyright © 2013 Intel Corporation
*
@@ -308,13 +308,13 @@ static void intel_uncore_forcewake_reset(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
- if (IS_VALLEYVIEW(dev)) {
+ if (IS_VALLEYVIEW(dev))
vlv_force_wake_reset(dev_priv);
- } else if (INTEL_INFO(dev)->gen >= 6) {
+ else if (IS_GEN6(dev) || IS_GEN7(dev))
__gen6_gt_force_wake_reset(dev_priv);
- if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev))
- __gen6_gt_force_wake_mt_reset(dev_priv);
- }
+
+ if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev) || IS_GEN8(dev))
+ __gen6_gt_force_wake_mt_reset(dev_priv);
}
void intel_uncore_early_sanitize(struct drm_device *dev)
@@ -637,16 +637,17 @@ static bool is_gen8_shadowed(struct drm_i915_private *dev_priv, u32 reg)
#define __gen8_write(x) \
static void \
gen8_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool trace) { \
- bool __needs_put = reg < 0x40000 && !is_gen8_shadowed(dev_priv, reg); \
REG_WRITE_HEADER; \
- if (__needs_put) { \
- dev_priv->uncore.funcs.force_wake_get(dev_priv, \
- FORCEWAKE_ALL); \
- } \
- __raw_i915_write##x(dev_priv, reg, val); \
- if (__needs_put) { \
- dev_priv->uncore.funcs.force_wake_put(dev_priv, \
- FORCEWAKE_ALL); \
+ if (reg < 0x40000 && !is_gen8_shadowed(dev_priv, reg)) { \
+ if (dev_priv->uncore.forcewake_count == 0) \
+ dev_priv->uncore.funcs.force_wake_get(dev_priv, \
+ FORCEWAKE_ALL); \
+ __raw_i915_write##x(dev_priv, reg, val); \
+ if (dev_priv->uncore.forcewake_count == 0) \
+ dev_priv->uncore.funcs.force_wake_put(dev_priv, \
+ FORCEWAKE_ALL); \
+ } else { \
+ __raw_i915_write##x(dev_priv, reg, val); \
} \
REG_WRITE_FOOTER; \
}