summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2012-05-21 20:14:19 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2012-05-21 20:14:19 +0000
commitc3af4dac8c2adc170d3657f12942d3d140fc5e58 (patch)
tree0389a7818cd0d44668c1e4eba2f330f645ec2ee5
parent7fe6d7e57ad8637a9fcfd56730312b695cf7d019 (diff)
Always clear out the inactive list and make sure everything is unbound in
i915_gem_idle(). If we don't do that we end up with stale entries on the inactive list which will panic the kernel the next time we use the list. Fixes restarting X on Sandy Bridge.
-rw-r--r--sys/dev/pci/drm/i915_drv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c
index 524bfcdfa66..6ed1ddf0ee0 100644
--- a/sys/dev/pci/drm/i915_drv.c
+++ b/sys/dev/pci/drm/i915_drv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_drv.c,v 1.120 2012/05/19 18:02:53 kettenis Exp $ */
+/* $OpenBSD: i915_drv.c,v 1.121 2012/05/21 20:14:18 kettenis Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
@@ -3977,6 +3977,9 @@ i915_gem_idle(struct inteldrm_softc *dev_priv)
DRM_LOCK();
if (dev_priv->mm.suspended || dev_priv->ring.ring_obj == NULL) {
+ KASSERT(TAILQ_EMPTY(&dev_priv->mm.flushing_list));
+ KASSERT(TAILQ_EMPTY(&dev_priv->mm.active_list));
+ (void)i915_gem_evict_inactive(dev_priv, 0);
DRM_UNLOCK();
return (0);
}