Skip to content

Commit

Permalink
drm/i915/gem: Perform all asynchronous waits prior to marking payload…
Browse files Browse the repository at this point in the history
… start

The initial breadcrumb marks the transition from context wait and setup
into the request payload. We use the marker to determine if the request
is merely waiting to begin, or is inside the payload and hung.
Forgetting to include a breadcrumb before the user payload would mean we
do not reset the guilty user request, and conversely if the initial
breadcrumb is too early we blame the user for a problem elsewhere.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201007090947.19950-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Nov 3, 2020
1 parent bc73e5d commit c648ae3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions drivers/gpu/drm/i915/gem/i915_gem_client_blt.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,6 @@ static void clear_pages_worker(struct work_struct *work)
if (unlikely(err))
goto out_request;

if (w->ce->engine->emit_init_breadcrumb) {
err = w->ce->engine->emit_init_breadcrumb(rq);
if (unlikely(err))
goto out_request;
}

/*
* w->dma is already exported via (vma|obj)->resv we need only
* keep track of the GPU activity within this vma/request, and
Expand All @@ -217,9 +211,15 @@ static void clear_pages_worker(struct work_struct *work)
if (err)
goto out_request;

err = w->ce->engine->emit_bb_start(rq,
batch->node.start, batch->node.size,
0);
if (rq->engine->emit_init_breadcrumb) {
err = rq->engine->emit_init_breadcrumb(rq);
if (unlikely(err))
goto out_request;
}

err = rq->engine->emit_bb_start(rq,
batch->node.start, batch->node.size,
0);
out_request:
if (unlikely(err)) {
i915_request_set_error_once(rq, err);
Expand Down

0 comments on commit c648ae3

Please sign in to comment.