Skip to content

Commit 86b27d8

Browse files
committed
drm/i915: Ignore a hung GPU when flushing the framebuffer prior to a switch
If the gpu is hung, then whatever was inside the render cache is lost and there is little point waiting for it. Or complaining if we see an EIO or EAGAIN instead. So, if the GPU is indeed in its death throes when we need to rewrite the registers for a new framebuffer, just ignore the error and proceed with the update. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
1 parent f5412be commit 86b27d8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎drivers/gpu/drm/i915/intel_display.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,19 +1630,19 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
16301630
struct drm_i915_gem_object *obj = to_intel_framebuffer(old_fb)->obj;
16311631

16321632
wait_event(dev_priv->pending_flip_queue,
1633+
atomic_read(&dev_priv->mm.wedged) ||
16331634
atomic_read(&obj->pending_flip) == 0);
16341635

16351636
/* Big Hammer, we also need to ensure that any pending
16361637
* MI_WAIT_FOR_EVENT inside a user batch buffer on the
16371638
* current scanout is retired before unpinning the old
16381639
* framebuffer.
1640+
*
1641+
* This should only fail upon a hung GPU, in which case we
1642+
* can safely continue.
16391643
*/
16401644
ret = i915_gem_object_flush_gpu(obj, false);
1641-
if (ret) {
1642-
i915_gem_object_unpin(to_intel_framebuffer(crtc->fb)->obj);
1643-
mutex_unlock(&dev->struct_mutex);
1644-
return ret;
1645-
}
1645+
(void) ret;
16461646
}
16471647

16481648
ret = intel_pipe_set_base_atomic(crtc, crtc->fb, x, y,

0 commit comments

Comments
 (0)