linux/drivers/gpu/drm/i915/gem
Chris Wilson ce476c80b8 drm/i915: Keep contexts pinned until after the next kernel context switch
We need to keep the context image pinned in memory until after the GPU
has finished writing into it. Since it continues to write as we signal
the final breadcrumb, we need to keep it pinned until the request after
it is complete. Currently we know the order in which requests execute on
each engine, and so to remove that presumption we need to identify a
request/context-switch we know must occur after our completion. Any
request queued after the signal must imply a context switch, for
simplicity we use a fresh request from the kernel context.

The sequence of operations for keeping the context pinned until saved is:

 - On context activation, we preallocate a node for each physical engine
   the context may operate on. This is to avoid allocations during
   unpinning, which may be from inside FS_RECLAIM context (aka the
   shrinker)

 - On context deactivation on retirement of the last active request (which
   is before we know the context has been saved), we add the
   preallocated node onto a barrier list on each engine

 - On engine idling, we emit a switch to kernel context. When this
   switch completes, we know that all previous contexts must have been
   saved, and so on retiring this request we can finally unpin all the
   contexts that were marked as deactivated prior to the switch.

We can enhance this in future by flushing all the idle contexts on a
regular heartbeat pulse of a switch to kernel context, which will also
be used to check for hung engines.

v2: intel_context_active_acquire/_release

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190614164606.15633-1-chris@chris-wilson.co.uk
2019-06-14 19:03:32 +01:00
..
selftests drm/i915: update with_intel_runtime_pm to use the rpm structure 2019-06-14 15:58:33 +01:00
i915_gem_busy.c drm/i915: Move GEM object busy checking to its own file 2019-05-28 12:45:29 +01:00
i915_gem_clflush.c drm/i915: Move GEM object domain management from struct_mutex to local 2019-05-28 12:45:29 +01:00
i915_gem_clflush.h drm/i915: Move more GEM objects under gem/ 2019-05-28 12:45:29 +01:00
i915_gem_client_blt.c drm/i915: Pull kref into i915_address_space 2019-06-11 11:44:24 +01:00
i915_gem_client_blt.h drm/i915: add in-kernel blitter client 2019-05-30 12:01:44 +01:00
i915_gem_context_types.h drm/i915: Pull kref into i915_address_space 2019-06-11 11:44:24 +01:00
i915_gem_context.c drm/i915: Keep contexts pinned until after the next kernel context switch 2019-06-14 19:03:32 +01:00
i915_gem_context.h drm/i915: Keep contexts pinned until after the next kernel context switch 2019-06-14 19:03:32 +01:00
i915_gem_dmabuf.c drm/i915: Move GEM object domain management from struct_mutex to local 2019-05-28 12:45:29 +01:00
i915_gem_domain.c drm/i915: Combine unbound/bound list tracking for objects 2019-06-12 13:36:43 +01:00
i915_gem_execbuffer.c drm/i915: Pull kref into i915_address_space 2019-06-11 11:44:24 +01:00
i915_gem_fence.c drm/i915: Move GEM object domain management from struct_mutex to local 2019-05-28 12:45:29 +01:00
i915_gem_internal.c drm/i915: Pull scatterlist utils out of i915_gem.h 2019-05-28 12:45:29 +01:00
i915_gem_ioctls.h
i915_gem_mman.c drm/i915: update rpm_get/put to use the rpm structure 2019-06-14 15:58:33 +01:00
i915_gem_object_blt.c drm/i915: Pull kref into i915_address_space 2019-06-11 11:44:24 +01:00
i915_gem_object_blt.h drm/i915: add in-kernel blitter client 2019-05-30 12:01:44 +01:00
i915_gem_object_types.h drm/i915: Combine unbound/bound list tracking for objects 2019-06-12 13:36:43 +01:00
i915_gem_object.c drm/i915: update rpm_get/put to use the rpm structure 2019-06-14 15:58:33 +01:00
i915_gem_object.h drm/i915: Drop the deferred active reference 2019-05-28 12:45:29 +01:00
i915_gem_pages.c drm/i915: Combine unbound/bound list tracking for objects 2019-06-12 13:36:43 +01:00
i915_gem_phys.c drm/i915: Pull scatterlist utils out of i915_gem.h 2019-05-28 12:45:29 +01:00
i915_gem_pm.c drm/i915: Keep contexts pinned until after the next kernel context switch 2019-06-14 19:03:32 +01:00
i915_gem_pm.h drm/i915: Move more GEM objects under gem/ 2019-05-28 12:45:29 +01:00
i915_gem_shmem.c drm/i915: Track the purgeable objects on a separate eviction list 2019-05-31 21:23:51 +01:00
i915_gem_shrinker.c drm/i915: Keep contexts pinned until after the next kernel context switch 2019-06-14 19:03:32 +01:00
i915_gem_stolen.c drm/i915: Combine unbound/bound list tracking for objects 2019-06-12 13:36:43 +01:00
i915_gem_throttle.c drm/i915: Move GEM client throttling to its own file 2019-05-28 12:45:29 +01:00
i915_gem_tiling.c drm/i915: Move more GEM objects under gem/ 2019-05-28 12:45:29 +01:00
i915_gem_userptr.c drm/i915: Pull kref into i915_address_space 2019-06-11 11:44:24 +01:00
i915_gem_wait.c drm/i915: Move GEM object waiting to its own file 2019-05-28 12:45:29 +01:00
i915_gemfs.c drm/i915: Move more GEM objects under gem/ 2019-05-28 12:45:29 +01:00
i915_gemfs.h drm/i915: Move more GEM objects under gem/ 2019-05-28 12:45:29 +01:00
Makefile
Makefile.header-test