Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ffb7d07 authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915: Construct a request even if the GPU is currently hung



As we now have the ability to directly reset the GPU from the waiter
(and so do not need to drop the lock in order to let the reset proceed)
and also do not lose requests over a reset, we can now simply queue the
request to occur after the reset rather than roundtripping to userspace
(or worse failing with EIO).

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20170114162334.10271-1-chris@chris-wilson.co.uk


Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
parent 9734ad13
Loading
Loading
Loading
Loading
+3 −25
Original line number Original line Diff line number Diff line
@@ -307,26 +307,6 @@ void i915_gem_request_retire_upto(struct drm_i915_gem_request *req)
	} while (tmp != req);
	} while (tmp != req);
}
}


static int i915_gem_check_wedge(struct drm_i915_private *dev_priv)
{
	struct i915_gpu_error *error = &dev_priv->gpu_error;

	if (i915_terminally_wedged(error))
		return -EIO;

	if (i915_reset_in_progress(error)) {
		/* Non-interruptible callers can't handle -EAGAIN, hence return
		 * -EIO unconditionally for these.
		 */
		if (!dev_priv->mm.interruptible)
			return -EIO;

		return -EAGAIN;
	}

	return 0;
}

static int i915_gem_init_global_seqno(struct drm_i915_private *i915, u32 seqno)
static int i915_gem_init_global_seqno(struct drm_i915_private *i915, u32 seqno)
{
{
	struct i915_gem_timeline *timeline = &i915->gt.global_timeline;
	struct i915_gem_timeline *timeline = &i915->gt.global_timeline;
@@ -521,12 +501,10 @@ i915_gem_request_alloc(struct intel_engine_cs *engine,
	lockdep_assert_held(&dev_priv->drm.struct_mutex);
	lockdep_assert_held(&dev_priv->drm.struct_mutex);


	/* ABI: Before userspace accesses the GPU (e.g. execbuffer), report
	/* ABI: Before userspace accesses the GPU (e.g. execbuffer), report
	 * EIO if the GPU is already wedged, or EAGAIN to drop the struct_mutex
	 * EIO if the GPU is already wedged.
	 * and restart.
	 */
	 */
	ret = i915_gem_check_wedge(dev_priv);
	if (i915_terminally_wedged(&dev_priv->gpu_error))
	if (ret)
		return ERR_PTR(-EIO);
		return ERR_PTR(ret);


	/* Pinning the contexts may generate requests in order to acquire
	/* Pinning the contexts may generate requests in order to acquire
	 * GGTT space, so do this first before we reserve a seqno for
	 * GGTT space, so do this first before we reserve a seqno for