提交 735e0eb6 编写于 作者: C Chris Wilson

drm/i915: Skip adding the request to the signal tree is complete

Enabling the interrupt for the signaler takes a finite amount of time (a
few microseconds) during which it is possible for the request to
complete. Check afterwards and skip adding the request to the signal
rbtree if it complete.
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170608111405.16466-3-chris@chris-wilson.co.uk
上级 bac2ef4b
...@@ -678,8 +678,6 @@ void intel_engine_enable_signaling(struct drm_i915_gem_request *request, ...@@ -678,8 +678,6 @@ void intel_engine_enable_signaling(struct drm_i915_gem_request *request,
{ {
struct intel_engine_cs *engine = request->engine; struct intel_engine_cs *engine = request->engine;
struct intel_breadcrumbs *b = &engine->breadcrumbs; struct intel_breadcrumbs *b = &engine->breadcrumbs;
struct rb_node *parent, **p;
bool first;
u32 seqno; u32 seqno;
/* Note that we may be called from an interrupt handler on another /* Note that we may be called from an interrupt handler on another
...@@ -714,9 +712,13 @@ void intel_engine_enable_signaling(struct drm_i915_gem_request *request, ...@@ -714,9 +712,13 @@ void intel_engine_enable_signaling(struct drm_i915_gem_request *request,
*/ */
wakeup &= __intel_engine_add_wait(engine, &request->signaling.wait); wakeup &= __intel_engine_add_wait(engine, &request->signaling.wait);
/* Now insert ourselves into the retirement ordered list of signals if (!__i915_gem_request_completed(request, seqno)) {
* on this engine. We track the oldest seqno as that will be the struct rb_node *parent, **p;
* first signal to complete. bool first;
/* Now insert ourselves into the retirement ordered list of
* signals on this engine. We track the oldest seqno as that
* will be the first signal to complete.
*/ */
parent = NULL; parent = NULL;
first = true; first = true;
...@@ -735,6 +737,11 @@ void intel_engine_enable_signaling(struct drm_i915_gem_request *request, ...@@ -735,6 +737,11 @@ void intel_engine_enable_signaling(struct drm_i915_gem_request *request,
rb_insert_color(&request->signaling.node, &b->signals); rb_insert_color(&request->signaling.node, &b->signals);
if (first) if (first)
rcu_assign_pointer(b->first_signal, request); rcu_assign_pointer(b->first_signal, request);
} else {
__intel_engine_remove_wait(engine, &request->signaling.wait);
i915_gem_request_put(request);
wakeup = false;
}
spin_unlock(&b->rb_lock); spin_unlock(&b->rb_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册