summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_active.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-07-25 23:38:43 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-07-26 01:11:25 +0100
commit79c7a28e1f3a74b95ae2eae36ed0046fc8e6c7fd (patch)
tree3c6db6c855987070e2d8b9b76eb3b9c624136a3f /drivers/gpu/drm/i915/i915_active.h
parentabf30f235390b8da1cd28b73e7ec3f0ff96ac450 (diff)
drm/i915: Capture vma contents outside of spinlock
Currently we use the engine->active.lock to ensure that the request is not retired as we capture the data. However, we only need to ensure that the vma are not removed prior to use acquiring their contents, and since we have already relinquished our stop-machine protection, we assume that the user will not be overwriting the contents before we are able to record them. In order to capture the vma outside of the spinlock, we acquire a reference and mark the vma as active to prevent it from being unbound. However, since it is tricky allocate an entry in the fence tree (doing so would require taking a mutex) while inside the engine spinlock, we use an atomic bit and special case the handling for i915_active_wait. The core benefit is that we can use some non-atomic methods for mapping the device pages, we can remove the slow compression phase out of atomic context (i.e. stop antagonising the nmi-watchdog), and no we longer need large reserves of atomic pages. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111215 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Matthew Auld <matthew.william.auld@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190725223843.8971-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_active.h')
-rw-r--r--drivers/gpu/drm/i915/i915_active.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_active.h b/drivers/gpu/drm/i915/i915_active.h
index 134166d31251..ba68b077ec6c 100644
--- a/drivers/gpu/drm/i915/i915_active.h
+++ b/drivers/gpu/drm/i915/i915_active.h
@@ -395,6 +395,9 @@ int i915_active_acquire(struct i915_active *ref);
void i915_active_release(struct i915_active *ref);
void __i915_active_release_nested(struct i915_active *ref, int subclass);
+bool i915_active_trygrab(struct i915_active *ref);
+void i915_active_ungrab(struct i915_active *ref);
+
static inline bool
i915_active_is_idle(const struct i915_active *ref)
{