]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gt: Keep a no-frills swappable copy of the default context state
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 29 Apr 2020 17:24:29 +0000 (18:24 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 29 Apr 2020 18:02:37 +0000 (19:02 +0100)
commitf94aa951713740349220f8bbbecb2b0eb74b3bbd
tree8b16a9f5d13242752e21691a8881695960a9ea4e
parentd2fe6da01387908eab4f4c3e71900c3c0b6bc1da
drm/i915/gt: Keep a no-frills swappable copy of the default context state

We need to keep the default context state around to instantiate new
contexts (aka golden rendercontext), and we also keep it pinned while
the engine is active so that we can quickly reset a hanging context.
However, the default contexts are large enough to merit keeping in
swappable memory as opposed to kernel memory, so we store them inside
shmemfs. Currently, we use the normal GEM objects to create the default
context image, but we can throw away all but the shmemfs file.

This greatly simplifies the tricky power management code which wants to
run underneath the normal GT locking, and we definitely do not want to
use any high level objects that may appear to recurse back into the GT.
Though perhaps the primary advantage of the complex GEM object is that
we aggressively cache the mapping, but here we are recreating the
vm_area everytime time we unpark. At the worst, we add a lightweight
cache, but first find a microbenchmark that is impacted.

Having started to create some utility functions to make working with
shmemfs objects easier, we can start putting them to wider use, where
GEM objects are overkill, such as storing persistent error state.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Ramalingam C <ramalingam.c@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200429172429.6054-1-chris@chris-wilson.co.uk
14 files changed:
drivers/gpu/drm/i915/Makefile
drivers/gpu/drm/i915/gt/intel_engine_cs.c
drivers/gpu/drm/i915/gt/intel_engine_pm.c
drivers/gpu/drm/i915/gt/intel_engine_types.h
drivers/gpu/drm/i915/gt/intel_gt.c
drivers/gpu/drm/i915/gt/intel_lrc.c
drivers/gpu/drm/i915/gt/intel_ring_submission.c
drivers/gpu/drm/i915/gt/selftest_context.c
drivers/gpu/drm/i915/gt/selftest_lrc.c
drivers/gpu/drm/i915/gt/shmem_utils.c [new file with mode: 0644]
drivers/gpu/drm/i915/gt/shmem_utils.h [new file with mode: 0644]
drivers/gpu/drm/i915/gt/st_shmem_utils.c [new file with mode: 0644]
drivers/gpu/drm/i915/i915_gpu_error.c
drivers/gpu/drm/i915/selftests/i915_mock_selftests.h