Skip to content

Commit

Permalink
drm/i915/selftests: Add the usual batch vma managements to st_workaro…
Browse files Browse the repository at this point in the history
…unds

To properly handle asynchronous migration of batch objects, we need to
couple the fences on the incoming batch into the request and should not
assume that they always start idle.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190826072149.9447-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Aug 27, 2019
1 parent acd674a commit 1d5b777
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions drivers/gpu/drm/i915/gt/selftest_workarounds.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,14 @@ static int check_dirty_whitelist(struct i915_gem_context *ctx,
goto err_request;
}

i915_vma_lock(batch);
err = i915_request_await_object(rq, batch->obj, false);
if (err == 0)
err = i915_vma_move_to_active(batch, rq, 0);
i915_vma_unlock(batch);
if (err)
goto err_request;

err = engine->emit_bb_start(rq,
batch->node.start, PAGE_SIZE,
0);
Expand Down Expand Up @@ -850,6 +858,14 @@ static int scrub_whitelisted_registers(struct i915_gem_context *ctx,
goto err_request;
}

i915_vma_lock(batch);
err = i915_request_await_object(rq, batch->obj, false);
if (err == 0)
err = i915_vma_move_to_active(batch, rq, 0);
i915_vma_unlock(batch);
if (err)
goto err_request;

/* Perform the writes from an unprivileged "user" batch */
err = engine->emit_bb_start(rq, batch->node.start, 0, 0);

Expand Down

0 comments on commit 1d5b777

Please sign in to comment.