From f2fdb0da83d6208c884ffde2bb30d0a67fc75217 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 4 Jul 2012 21:43:22 +0100 Subject: [PATCH] sna: Use throttle() to confirm a GPU hang This has two effects. The first is that we confirm that the EIO was indeed a GPU hang and not some other form of I/O failure (for example swapin). And the second is that it means we also print the warning to look for an i915_error_state when we detect a GPU hang. Signed-off-by: Chris Wilson --- src/sna/kgem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 944b8f28..7f8c89e0 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -1604,7 +1604,7 @@ static void kgem_commit(struct kgem *kgem) set_domain.write_domain = I915_GEM_DOMAIN_GTT; if (drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain)) { DBG(("%s: sync: GPU hang detected\n", __FUNCTION__)); - kgem->wedged = 1; + kgem_throttle(kgem); } kgem_retire(kgem); @@ -1983,7 +1983,7 @@ void _kgem_submit(struct kgem *kgem) } if (ret == -1 && (errno == EIO || errno == EBUSY)) { DBG(("%s: GPU hang detected\n", __FUNCTION__)); - kgem->wedged = 1; + kgem_throttle(kgem); ret = 0; } #if !NDEBUG @@ -2047,7 +2047,7 @@ void _kgem_submit(struct kgem *kgem) ret = drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain); if (ret == -1) { DBG(("%s: sync: GPU hang detected\n", __FUNCTION__)); - kgem->wedged = 1; + kgem_throttle(kgem); } } }