提交 83cc84c5 编写于 作者: C Chris Wilson

drm/i915: Assert all signalers we depended on did indeed signal

Back up our comment that all signalers should have been signaled before
we ourselves were retired with an assert to that effect.
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: NMichał Winiarski <michal.winiarski@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180102151235.3949-9-chris@chris-wilson.co.uk
上级 65c475c6
...@@ -161,12 +161,16 @@ i915_priotree_fini(struct drm_i915_private *i915, struct i915_priotree *pt) ...@@ -161,12 +161,16 @@ i915_priotree_fini(struct drm_i915_private *i915, struct i915_priotree *pt)
GEM_BUG_ON(!list_empty(&pt->link)); GEM_BUG_ON(!list_empty(&pt->link));
/* Everyone we depended upon (the fences we wait to be signaled) /*
* Everyone we depended upon (the fences we wait to be signaled)
* should retire before us and remove themselves from our list. * should retire before us and remove themselves from our list.
* However, retirement is run independently on each timeline and * However, retirement is run independently on each timeline and
* so we may be called out-of-order. * so we may be called out-of-order.
*/ */
list_for_each_entry_safe(dep, next, &pt->signalers_list, signal_link) { list_for_each_entry_safe(dep, next, &pt->signalers_list, signal_link) {
GEM_BUG_ON(!i915_priotree_signaled(dep->signaler));
GEM_BUG_ON(!list_empty(&dep->dfs_link));
list_del(&dep->wait_link); list_del(&dep->wait_link);
if (dep->flags & I915_DEPENDENCY_ALLOC) if (dep->flags & I915_DEPENDENCY_ALLOC)
i915_dependency_free(i915, dep); i915_dependency_free(i915, dep);
...@@ -174,6 +178,9 @@ i915_priotree_fini(struct drm_i915_private *i915, struct i915_priotree *pt) ...@@ -174,6 +178,9 @@ i915_priotree_fini(struct drm_i915_private *i915, struct i915_priotree *pt)
/* Remove ourselves from everyone who depends upon us */ /* Remove ourselves from everyone who depends upon us */
list_for_each_entry_safe(dep, next, &pt->waiters_list, wait_link) { list_for_each_entry_safe(dep, next, &pt->waiters_list, wait_link) {
GEM_BUG_ON(dep->signaler != pt);
GEM_BUG_ON(!list_empty(&dep->dfs_link));
list_del(&dep->signal_link); list_del(&dep->signal_link);
if (dep->flags & I915_DEPENDENCY_ALLOC) if (dep->flags & I915_DEPENDENCY_ALLOC)
i915_dependency_free(i915, dep); i915_dependency_free(i915, dep);
......
...@@ -329,6 +329,14 @@ i915_gem_request_completed(const struct drm_i915_gem_request *req) ...@@ -329,6 +329,14 @@ i915_gem_request_completed(const struct drm_i915_gem_request *req)
return __i915_gem_request_completed(req, seqno); return __i915_gem_request_completed(req, seqno);
} }
static inline bool i915_priotree_signaled(const struct i915_priotree *pt)
{
const struct drm_i915_gem_request *rq =
container_of(pt, const struct drm_i915_gem_request, priotree);
return i915_gem_request_completed(rq);
}
/* We treat requests as fences. This is not be to confused with our /* We treat requests as fences. This is not be to confused with our
* "fence registers" but pipeline synchronisation objects ala GL_ARB_sync. * "fence registers" but pipeline synchronisation objects ala GL_ARB_sync.
* We use the fences to synchronize access from the CPU with activity on the * We use the fences to synchronize access from the CPU with activity on the
......
...@@ -1037,7 +1037,7 @@ static void execlists_schedule(struct drm_i915_gem_request *request, int prio) ...@@ -1037,7 +1037,7 @@ static void execlists_schedule(struct drm_i915_gem_request *request, int prio)
* engines. * engines.
*/ */
list_for_each_entry(p, &pt->signalers_list, signal_link) { list_for_each_entry(p, &pt->signalers_list, signal_link) {
if (i915_gem_request_completed(pt_to_request(p->signaler))) if (i915_priotree_signaled(p->signaler))
continue; continue;
GEM_BUG_ON(p->signaler->priority < pt->priority); GEM_BUG_ON(p->signaler->priority < pt->priority);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册