]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gem: Require per-engine reset support for non-persistent contexts
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 30 Jan 2020 16:45:53 +0000 (16:45 +0000)
committerJani Nikula <jani.nikula@intel.com>
Mon, 17 Feb 2020 17:17:02 +0000 (19:17 +0200)
commit588f031f0df57f5019e86bd8e3423e9e22f8274c
treece02ffcb7d4c60595003653feccf435ebd99e491
parent80b2d47f70ccd2a60c3e607ab0470ddb354d8917
drm/i915/gem: Require per-engine reset support for non-persistent contexts

To enable non-persistent contexts, we require a means of cancelling any
inflight work from that context. This is first done "gracefully" by
using preemption to kick the active context off the engine, and then
forcefully by resetting the engine if it is active. If we are unable to
reset the engine to remove hostile userspace, we should not allow
userspace to opt into using non-persistent contexts.

If the per-engine reset fails, we still do a full GPU reset, but that is
rare and usually indicative of much deeper issues. The damage is already
done. However, the goal of the interface to allow long running compute
jobs without causing collateral damage elsewhere, and if we are unable
to support that we should make that known by not providing the
interface (and falsely pretending we can).

Fixes: e3c4e67ff4ec ("drm/i915/gem: Make context persistence optional")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jon Bloomfield <jon.bloomfield@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200130164553.1937718-1-chris@chris-wilson.co.uk
(cherry picked from commit d1b9b5f127bc3797fc274cfa4f363e039f045c3a)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/gem/i915_gem_context.c