linux/drivers/gpu/drm/i915/selftests
Chris Wilson 288f1ced5e drm/i915: Reduce context HW ID lifetime
Future gen reduce the number of bits we will have available to
differentiate between contexts, so reduce the lifetime of the ID
assignment from that of the context to its current active cycle (i.e.
only while it is pinned for use by the HW, will it have a constant ID).
This means that instead of a max of 2k allocated contexts (worst case
before fun with bit twiddling), we instead have a limit of 2k in flight
contexts (minus a few that have been pinned by the kernel or by perf).

To reduce the number of contexts id we require, we allocate a context id
on first and mark it as pinned for as long as the GEM context itself is,
that is we keep it pinned it while active on each engine. If we exhaust
our context id space, then we try to reclaim an id from an idle context.
In the extreme case where all context ids are pinned by active contexts,
we force the system to idle in order to recover ids.

We cannot reduce the scope of an HW-ID to an engine (allowing the same
gem_context to have different ids on each engine) as in the future we
will need to preassign an id before we know which engine the
context is being executed on.

v2: Improved commentary (Tvrtko) [I tried at least]

References: https://bugs.freedesktop.org/show_bug.cgi?id=107788
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Michel Thierry <michel.thierry@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180904153117.3907-1-chris@chris-wilson.co.uk
2018-09-05 11:58:08 +01:00
..
huge_gem_object.c
huge_gem_object.h
huge_pages.c drm/i915/selftests: Unconditionally do a chipset flush before emit_bb_start 2018-08-06 20:34:49 +01:00
i915_gem_coherency.c drm/i915/selftests: Replace opencoded clflush with drm_clflush_virt_range 2018-07-30 10:33:21 +01:00
i915_gem_context.c drm/i915: Prevent writing into a read-only object via a GGTT mmap 2018-07-13 16:14:04 +01:00
i915_gem_dmabuf.c drm/i915: Replace drm_dev_unref with drm_dev_put 2018-06-28 19:09:46 +02:00
i915_gem_evict.c drm/i915/selftests: Skip live eviction tests when wedged 2018-07-06 11:25:06 +01:00
i915_gem_gtt.c drm/i915/selftests: Constrain mock_gtt tests to fit within RAM 2018-07-10 09:53:41 +01:00
i915_gem_object.c drm/i915/selftests: Hold rpm for unparking 2018-08-09 14:48:55 +01:00
i915_gem.c drm/i915/selftests: Add a simple exerciser for suspend/hibernate 2018-08-31 10:21:00 +01:00
i915_live_selftests.h drm/i915/selftests: Add a simple exerciser for suspend/hibernate 2018-08-31 10:21:00 +01:00
i915_mock_selftests.h
i915_random.c
i915_random.h
i915_request.c drm/i915: Provide a timeout to i915_gem_wait_for_idle() 2018-07-09 13:55:41 +01:00
i915_selftest.c drm/i915/selftests: Include the start of each subtest in the GEM trace 2018-07-13 22:30:56 +01:00
i915_sw_fence.c
i915_syncmap.c
i915_timeline.c
i915_vma.c drm/i915: Replace drm_dev_unref with drm_dev_put 2018-06-28 19:09:46 +02:00
igt_flush_test.c drm/i915/selftests: Replace wait-on-timeout with explicit timeout 2018-07-09 13:56:42 +01:00
igt_flush_test.h
igt_wedge_me.h drm/i915/selftests: Add a safety net to live_workarounds 2018-07-11 14:13:56 +01:00
intel_breadcrumbs.c drm/i915: Replace drm_dev_unref with drm_dev_put 2018-06-28 19:09:46 +02:00
intel_engine_cs.c
intel_guc.c drm/i915/selftests: ring all doorbells in igt_guc_doorbells 2018-08-28 13:41:27 +01:00
intel_hangcheck.c drm/i915/selftests: Exercise resetting in the middle of a wait-on-fence 2018-07-26 13:32:08 +01:00
intel_lrc.c drm/i915/selftests: Force a preemption hang 2018-07-16 17:17:27 +01:00
intel_uncore.c drm/i915: Restore user forcewake domains across suspend 2018-08-09 14:25:46 +01:00
intel_workarounds.c drm/i915/selftests: Add a safety net to live_workarounds 2018-07-11 14:13:56 +01:00
lib_sw_fence.c
lib_sw_fence.h
mock_context.c drm/i915: Reduce context HW ID lifetime 2018-09-05 11:58:08 +01:00
mock_context.h
mock_dmabuf.c drm/i915/selftests: Remove unused dmabuf->kmap routines, fix the build 2018-06-20 17:48:24 +01:00
mock_dmabuf.h
mock_drm.c
mock_drm.h
mock_engine.c drm/i915: Replace nested subclassing with explicit subclasses 2018-07-07 08:09:43 +01:00
mock_engine.h
mock_gem_device.c drm/i915/selftests: Avoid warning if runtime pm is disabled 2018-07-06 23:33:34 +01:00
mock_gem_device.h
mock_gem_object.h
mock_gtt.c drm/i915: Explicitly mark Global GTT address spaces 2018-09-01 10:25:38 +01:00
mock_gtt.h
mock_request.c
mock_request.h
mock_timeline.c
mock_timeline.h
mock_uncore.c
mock_uncore.h
scatterlist.c