Commit 090a82e9 authored by Chris Wilson's avatar Chris Wilson

drm/i915/gt: Hold request reference while waiting for w/a verification

As we wait upon a request, we must be holding a reference to it, and be
wary that i915_request_add() consumes the passed in reference.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191121093326.134774-1-chris@chris-wilson.co.uk
parent 2d0fb251
...@@ -1592,16 +1592,17 @@ static int engine_wa_list_verify(struct intel_context *ce, ...@@ -1592,16 +1592,17 @@ static int engine_wa_list_verify(struct intel_context *ce,
if (err) if (err)
goto err_vma; goto err_vma;
i915_request_get(rq);
i915_request_add(rq); i915_request_add(rq);
if (i915_request_wait(rq, 0, HZ / 5) < 0) { if (i915_request_wait(rq, 0, HZ / 5) < 0) {
err = -ETIME; err = -ETIME;
goto err_vma; goto err_rq;
} }
results = i915_gem_object_pin_map(vma->obj, I915_MAP_WB); results = i915_gem_object_pin_map(vma->obj, I915_MAP_WB);
if (IS_ERR(results)) { if (IS_ERR(results)) {
err = PTR_ERR(results); err = PTR_ERR(results);
goto err_vma; goto err_rq;
} }
err = 0; err = 0;
...@@ -1615,6 +1616,8 @@ static int engine_wa_list_verify(struct intel_context *ce, ...@@ -1615,6 +1616,8 @@ static int engine_wa_list_verify(struct intel_context *ce,
i915_gem_object_unpin_map(vma->obj); i915_gem_object_unpin_map(vma->obj);
err_rq:
i915_request_put(rq);
err_vma: err_vma:
i915_vma_unpin(vma); i915_vma_unpin(vma);
i915_vma_put(vma); i915_vma_put(vma);
......
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