linux/drivers/gpu/drm/i915/selftests
Chris Wilson 8ab3a3812a drm/i915/gt: Incrementally check for rewinding
In commit 5ba32c7be8 ("drm/i915/execlists: Always force a context
reload when rewinding RING_TAIL"), we placed the check for rewinding a
context on actually submitting the next request in that context. This
was so that we only had to check once, and could do so with precision
avoiding as many forced restores as possible. For example, to ensure
that we can resubmit the same request a couple of times, we include a
small wa_tail such that on the next submission, the ring->tail will
appear to move forwards when resubmitting the same request. This is very
common as it will happen for every lite-restore to fill the second port
after a context switch.

However, intel_ring_direction() is limited in precision to movements of
upto half the ring size. The consequence being that if we tried to
unwind many requests, we could exceed half the ring and flip the sense
of the direction, so missing a force restore. As no request can be
greater than half the ring (i.e. 2048 bytes in the smallest case), we
can check for rollback incrementally. As we check against the tail that
would be submitted, we do not lose any sensitivity and allow lite
restores for the simple case. We still need to double check upon
submitting the context, to allow for multiple preemptions and
resubmissions.

Fixes: 5ba32c7be8 ("drm/i915/execlists: Always force a context reload when rewinding RING_TAIL")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: <stable@vger.kernel.org> # v5.4+
Reviewed-by: Bruce Chang <yu.bruce.chang@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200609151723.12971-1-chris@chris-wilson.co.uk
(cherry picked from commit e36ba817fa)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2020-06-16 11:34:23 +03:00
..
i915_active.c drm/i915: Allow for different modes of interruptible i915_active_wait 2020-03-30 18:20:33 +01:00
i915_buddy.c drm/i915/selftests: try to rein in alloc_smoke 2020-03-06 14:33:15 +00:00
i915_gem_evict.c drm/i915/gem: Drop cached obj->bind_count 2020-04-02 01:17:39 +01:00
i915_gem_gtt.c drm/i915: Only close vma we open 2020-04-24 11:24:45 +01:00
i915_gem.c drm/i915/gt: Pull restoration of GGTT fences underneath the GT 2020-03-16 20:28:28 +00:00
i915_live_selftests.h drm/i915/gem: Implement legacy MI_STORE_DATA_IMM 2020-05-04 15:15:04 +01:00
i915_mock_selftests.h drm/i915/gt: Incrementally check for rewinding 2020-06-16 11:34:23 +03:00
i915_perf_selftests.h drm/i915/selftests: Add request throughput measurement to perf 2020-04-23 16:40:30 +01:00
i915_perf.c drm/i915: Extract i915_cs_timestamp_{ns_to_ticks,tick_to_ns}() 2020-05-14 20:04:02 +03:00
i915_random.c drm/i915/selftests: Extract random_offset() for use with a prng 2019-10-02 15:30:44 +01:00
i915_random.h drm/i915: Add missing include file <linux/math64.h> 2020-01-07 14:04:31 +00:00
i915_request.c drm/i915/selftests: Always flush before unpining after writing 2020-05-11 16:50:04 +01:00
i915_selftest.c drm/i915/gem: Implement legacy MI_STORE_DATA_IMM 2020-05-04 15:15:04 +01:00
i915_sw_fence.c
i915_syncmap.c
i915_vma.c drm/i915/execlists: Track inflight CCID 2020-04-28 22:17:36 +01:00
igt_atomic.c drm/i915/selftests: Move igt_atomic_section[] out of the header 2020-01-03 13:31:39 +00:00
igt_atomic.h drm/i915/selftests: Move igt_atomic_section[] out of the header 2020-01-03 13:31:39 +00:00
igt_flush_test.c drm/i915: Move request runtime management onto gt 2019-10-04 15:39:26 +01:00
igt_flush_test.h drm/i915: Drop struct_mutex from around i915_retire_requests() 2019-10-04 15:39:17 +01:00
igt_live_test.c drm/i915/selftests: Use GT engines in igt_live_test 2019-10-22 12:16:42 +01:00
igt_live_test.h drm/i915/selftests: Make headers self-contained 2020-01-03 13:33:36 +00:00
igt_mmap.c drm/i915/selftests: Wrap vm_mmap() around GEM objects 2019-11-07 21:22:58 +00:00
igt_mmap.h drm/i915/selftests: Wrap vm_mmap() around GEM objects 2019-11-07 21:22:58 +00:00
igt_reset.c drm/i915: Pass in intel_gt at some for_each_engine sites 2019-10-18 00:06:27 +01:00
igt_reset.h drm/i915/gt: Use intel_gt as the primary object for handling resets 2019-07-12 21:06:56 +01:00
igt_spinner.c drm/i915/selftests: Always call the provided engine->emit_init_breadcrumb 2020-05-14 09:01:54 +01:00
igt_spinner.h drm/i915/selftests: Pass intel_context to igt_spinner 2019-07-31 09:45:27 +01:00
intel_memory_region.c drm/i915/selftests/perf: watch out for stolen objects 2020-03-23 11:52:34 +00:00
intel_uncore.c drm/i915/selftests: Move uncore fw selftests to operate on intel_gt 2019-10-22 20:44:52 +01:00
lib_sw_fence.c drm/i915: Propagate fence errors 2019-08-18 12:38:09 +01:00
lib_sw_fence.h
librapl.c drm/i915/selftests: Move gpu energy measurement into its own little lib 2020-04-17 18:48:51 +01:00
librapl.h drm/i915/selftests: Move gpu energy measurement into its own little lib 2020-04-17 18:48:51 +01:00
mock_drm.h drm/i915/selftests: make mock_drm.h self-contained 2019-12-23 12:38:43 +02:00
mock_gem_device.c drm-misc-next for 5.8: 2020-04-22 10:41:35 +10:00
mock_gem_device.h
mock_gtt.c drm/i915/gtt: split up i915_gem_gtt 2020-01-07 19:27:36 +00:00
mock_gtt.h drm/i915: make more headers self-contained 2019-11-08 10:16:13 +00:00
mock_region.c drm/i915/gem: Distinguish each object type 2019-10-22 16:23:32 +01:00
mock_region.h drm/i915: make more headers self-contained 2019-11-08 10:16:13 +00:00
mock_request.c drm/i915/selftests: Pass intel_context to mock_request 2019-08-08 13:44:31 +01:00
mock_request.h drm/i915/selftests: Pass intel_context to mock_request 2019-08-08 13:44:31 +01:00
mock_uncore.c drm/i915/selftests: Assign the intel_runtime_pm pointer for mock_uncore 2019-10-08 16:21:50 +01:00
mock_uncore.h drm/i915: make more headers self-contained 2019-11-08 10:16:13 +00:00
scatterlist.c