Commit f900db47 authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

drm/i915: Perform pageflip using mmio if the GPU is terminally wedged

After a hang and failed reset, we cannot use the GPU to execute the page
flip instructions. Instead we can force a synchronous mmio flip. (Later,
we can reduce the synchronicity of the mmio flip by moving some of the
delays off to a worker, like the current page flip code; see vblank
tasks.)

References: https://bugs.freedesktop.org/show_bug.cgi?id=72631Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 6f0ea9e2
...@@ -8653,6 +8653,9 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, ...@@ -8653,6 +8653,9 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
fb->pitches[0] != crtc->fb->pitches[0])) fb->pitches[0] != crtc->fb->pitches[0]))
return -EINVAL; return -EINVAL;
if (i915_terminally_wedged(&dev_priv->gpu_error))
goto out_hang;
work = kzalloc(sizeof(*work), GFP_KERNEL); work = kzalloc(sizeof(*work), GFP_KERNEL);
if (work == NULL) if (work == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -8727,6 +8730,13 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, ...@@ -8727,6 +8730,13 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
free_work: free_work:
kfree(work); kfree(work);
if (ret == -EIO) {
out_hang:
intel_crtc_wait_for_pending_flips(crtc);
ret = intel_pipe_set_base(crtc, crtc->x, crtc->y, fb);
if (ret == 0 && event)
drm_send_vblank_event(dev, intel_crtc->pipe, event);
}
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment