summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2015-10-18 18:00:46 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2015-10-18 18:00:46 +0000
commita2a0c2fe7144c320a8cfa618814fe682b00229a9 (patch)
tree954f64e51de1741c331fc3895769e1c710276d69 /sys/dev/pci/drm
parentad414ae7d52a58072ec30b1bf7e2506384356499 (diff)
Backport another Broadwell fix from Linux 3.15
Ben Widawsky drm/i915: Provide PDP updates via MMIO e178f7057b81c87a7ceaae0ca204487b6f7eedcf Doesn't make resume work, but at least it prevents the machine from hanging and/or resetting.
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/i915/i915_gem_gtt.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/i915/i915_gem_gtt.c b/sys/dev/pci/drm/i915/i915_gem_gtt.c
index d2d5d2b767c..9372f974fbb 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.13 2015/09/26 13:15:25 kettenis Exp $ */
+/* $OpenBSD: i915_gem_gtt.c,v 1.14 2015/10/18 18:00:45 kettenis Exp $ */
/*
* Copyright © 2010 Daniel Vetter
*
@@ -209,12 +209,19 @@ static gen6_gtt_pte_t iris_pte_encode(dma_addr_t addr,
/* Broadwell Page Directory Pointer Descriptors */
static int gen8_write_pdp(struct intel_ring_buffer *ring, unsigned entry,
- uint64_t val)
+ uint64_t val, bool synchronous)
{
+ struct drm_i915_private *dev_priv = ring->dev->dev_private;
int ret;
BUG_ON(entry >= 4);
+ if (synchronous) {
+ I915_WRITE(GEN8_RING_PDP_UDW(ring, entry), val >> 32);
+ I915_WRITE(GEN8_RING_PDP_LDW(ring, entry), (u32)val);
+ return 0;
+ }
+
ret = intel_ring_begin(ring, 6);
if (ret)
return ret;
@@ -248,7 +255,8 @@ static int gen8_ppgtt_enable(struct drm_device *dev)
for (i = used_pd - 1; i >= 0; i--) {
dma_addr_t addr = ppgtt->pd_dma_addr[i];
for_each_ring(ring, dev_priv, j) {
- ret = gen8_write_pdp(ring, i, addr);
+ ret = gen8_write_pdp(ring, i, addr,
+ i915_reset_in_progress(&dev_priv->gpu_error));
if (ret)
goto err_out;
}