Commit 9b05a609 authored by Chris Wilson's avatar Chris Wilson Committed by Jani Nikula

drm/i915: Distinguish last emitted request from last submitted request

In order not to trigger hangcheck on a idle-but-waiting engine, we need
to distinguish between the pending request queue and the actual
execution queue. This is done later in "drm/i915: Enable multiple
timelines" but for now we need a temporary fix to prevent blaming the
wrong engine for a GPU hang.

(Note that this causes a temporary subtle change in how we decide when
to allow a waitboost to be re-awarded back to the waiter, the temporary
effect is that if the wait is upon the most current execution the wait
is given for free, instead of checking to see if the client stalled
itself. This will be repaired in "drm/i915: Enable multiple timelines".)

Fixes: 0a046a0e ("drm/i915: Nonblocking request submission")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98104Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161007065327.24515-1-chris@chris-wilson.co.uk
(cherry picked from commit 8687b3ec)
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 16c83fad
...@@ -328,6 +328,7 @@ submit_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state) ...@@ -328,6 +328,7 @@ submit_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state)
switch (state) { switch (state) {
case FENCE_COMPLETE: case FENCE_COMPLETE:
request->engine->last_submitted_seqno = request->fence.seqno;
request->engine->submit_request(request); request->engine->submit_request(request);
break; break;
...@@ -641,8 +642,8 @@ void __i915_add_request(struct drm_i915_gem_request *request, bool flush_caches) ...@@ -641,8 +642,8 @@ void __i915_add_request(struct drm_i915_gem_request *request, bool flush_caches)
&request->submitq); &request->submitq);
request->emitted_jiffies = jiffies; request->emitted_jiffies = jiffies;
request->previous_seqno = engine->last_submitted_seqno; request->previous_seqno = engine->last_pending_seqno;
engine->last_submitted_seqno = request->fence.seqno; engine->last_pending_seqno = request->fence.seqno;
i915_gem_active_set(&engine->last_request, request); i915_gem_active_set(&engine->last_request, request);
list_add_tail(&request->link, &engine->request_list); list_add_tail(&request->link, &engine->request_list);
list_add_tail(&request->ring_link, &ring->request_list); list_add_tail(&request->ring_link, &ring->request_list);
......
...@@ -328,6 +328,7 @@ struct intel_engine_cs { ...@@ -328,6 +328,7 @@ struct intel_engine_cs {
* inspecting request list. * inspecting request list.
*/ */
u32 last_submitted_seqno; u32 last_submitted_seqno;
u32 last_pending_seqno;
/* An RCU guarded pointer to the last request. No reference is /* An RCU guarded pointer to the last request. No reference is
* held to the request, users must carefully acquire a reference to * held to the request, users must carefully acquire a reference to
......
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