Skip to content

Commit

Permalink
drm/i915/execlists: Record the active CCID from before reset
Browse files Browse the repository at this point in the history
If we cannot trust the reset will flush out the CS event queue such that
process_csb() reports an accurate view of HW, we will need to search the
active and pending contexts to determine which was actually running at
the time we issued the reset.

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/20200505084629.31365-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed May 5, 2020
1 parent f136c58 commit b68be5c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/i915/gt/intel_engine_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ struct intel_engine_execlists {
*/
u32 error_interrupt;

/**
* @reset_ccid: Active CCID [EXECLISTS_STATUS_HI] at the time of reset
*/
u32 reset_ccid;

/**
* @no_priolist: priority lists disabled
*/
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/i915/gt/intel_lrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4074,6 +4074,8 @@ static void execlists_reset_prepare(struct intel_engine_cs *engine)
*/
ring_set_paused(engine, 1);
intel_engine_stop_cs(engine);

engine->execlists.reset_ccid = active_ccid(engine);
}

static void __reset_stop_ring(u32 *regs, const struct intel_engine_cs *engine)
Expand Down Expand Up @@ -4116,7 +4118,7 @@ static void __execlists_reset(struct intel_engine_cs *engine, bool stalled)
* its request, it was still running at the time of the
* reset and will have been clobbered.
*/
rq = execlists_active(execlists);
rq = active_context(engine, engine->execlists.reset_ccid);
if (!rq)
goto unwind;

Expand Down

0 comments on commit b68be5c

Please sign in to comment.