[Intel-gfx] [PATCH] drm/i915/gt: Hold request reference while waiting for w/a verification
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Thu Nov 21 11:46:34 UTC 2019
On 21/11/2019 09:33, Chris Wilson wrote:
> 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: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
> drivers/gpu/drm/i915/gt/intel_workarounds.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> index 399acae2f33f..226bd4cccb48 100644
> --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
> +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
> @@ -1592,16 +1592,17 @@ static int engine_wa_list_verify(struct intel_context *ce,
> if (err)
> goto err_vma;
>
> + i915_request_get(rq);
> i915_request_add(rq);
> if (i915_request_wait(rq, 0, HZ / 5) < 0) {
> err = -ETIME;
> - goto err_vma;
> + goto err_rq;
> }
>
> results = i915_gem_object_pin_map(vma->obj, I915_MAP_WB);
> if (IS_ERR(results)) {
> err = PTR_ERR(results);
> - goto err_vma;
> + goto err_rq;
> }
>
> err = 0;
> @@ -1615,6 +1616,8 @@ static int engine_wa_list_verify(struct intel_context *ce,
>
> i915_gem_object_unpin_map(vma->obj);
>
> +err_rq:
> + i915_request_put(rq);
> err_vma:
> i915_vma_unpin(vma);
> i915_vma_put(vma);
>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Regards,
Tvrtko
More information about the Intel-gfx
mailing list