summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_gem.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-05-16 19:33:49 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2018-05-16 20:20:33 +0100
commitf351d087d8329a08eca9e69872c3906c139e1f11 (patch)
treec1dcdfdc8da5b55653026e8df6c992a77986daeb /drivers/gpu/drm/i915/i915_gem.h
parentb8444cf85b629413ad23f5b6ed9bf5267f38acab (diff)
drm/i915: Only sync tasklets once for recursive reset preparation
When setting up reset, we may need to recursively prepare an engine. In which case we should only synchronously flush the tasklets on the outer most call, the inner calls will then be inside an atomic section where the tasklet will never be run (and so the sync will never complete). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180516183355.10553-2-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.h')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
index 525920404ede..5bf24cfc218c 100644
--- a/drivers/gpu/drm/i915/i915_gem.h
+++ b/drivers/gpu/drm/i915/i915_gem.h
@@ -26,6 +26,7 @@
#define __I915_GEM_H__
#include <linux/bug.h>
+#include <linux/interrupt.h>
struct drm_i915_private;
@@ -72,4 +73,10 @@ struct drm_i915_private;
void i915_gem_park(struct drm_i915_private *i915);
void i915_gem_unpark(struct drm_i915_private *i915);
+static inline void __tasklet_disable_sync_once(struct tasklet_struct *t)
+{
+ if (atomic_inc_return(&t->count) == 1)
+ tasklet_unlock_wait(t);
+}
+
#endif /* __I915_GEM_H__ */