]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/execlists: Track inflight CCID
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 28 Apr 2020 18:47:50 +0000 (19:47 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 28 Apr 2020 21:17:36 +0000 (22:17 +0100)
commit4af2736b04fd7af8d903885b57c2cdb5737e086a
tree0639281ac4195dac184b629c272624a457c33b45
parentcd3ca42041e6802c2381dfdb2a96641b3d486169
drm/i915/execlists: Track inflight CCID

The presumption is that by using a circular counter that is twice as
large as the maximum ELSP submission, we would never reuse the same CCID
for two inflight contexts.

However, if we continually preempt an active context such that it always
remains inflight, it can be resubmitted with an arbitrary number of
paired contexts. As each of its paired contexts will use a new CCID,
eventually it will wrap and submit two ELSP with the same CCID.

Rather than use a simple circular counter, switch over to a small bitmap
of inflight ids so we can avoid reusing one that is still potentially
active.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1796
Fixes: fb8e4b80bcc0 ("drm/i915: Remove logical HW ID")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: <stable@vger.kernel.org> # v5.5+
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200428184751.11257-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/intel_engine_types.h
drivers/gpu/drm/i915/gt/intel_lrc.c
drivers/gpu/drm/i915/i915_perf.c
drivers/gpu/drm/i915/selftests/i915_vma.c