diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-10-04 14:39:59 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-10-04 15:39:10 +0100 |
commit | 274cbf20fd108fa26d0497282b102e00371210fd (patch) | |
tree | 6aa8f12665f337ac9ea94d0198be2f33ee214d3c /drivers/gpu/drm/i915/i915_active_types.h | |
parent | 2850748ef8763ab46958e43a4d1c445f29eeb37d (diff) | |
download | linux-274cbf20fd108fa26d0497282b102e00371210fd.tar.bz2 |
drm/i915: Push the i915_active.retire into a worker
As we need to use a mutex to serialise i915_active activation
(because we want to allow the callback to sleep), we need to push the
i915_active.retire into a worker callback in case we get need to retire
from an atomic context.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191004134015.13204-5-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_active_types.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_active_types.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_active_types.h b/drivers/gpu/drm/i915/i915_active_types.h index 86e7a232ea3c..021167f0004d 100644 --- a/drivers/gpu/drm/i915/i915_active_types.h +++ b/drivers/gpu/drm/i915/i915_active_types.h @@ -13,6 +13,9 @@ #include <linux/mutex.h> #include <linux/rbtree.h> #include <linux/rcupdate.h> +#include <linux/workqueue.h> + +#include "i915_utils.h" struct drm_i915_private; struct i915_active_request; @@ -44,6 +47,11 @@ struct i915_active_request { struct active_node; +#define I915_ACTIVE_MAY_SLEEP BIT(0) + +#define __i915_active_call __aligned(4) +#define i915_active_may_sleep(fn) ptr_pack_bits(&(fn), I915_ACTIVE_MAY_SLEEP, 2) + struct i915_active { struct drm_i915_private *i915; @@ -57,11 +65,14 @@ struct i915_active { struct dma_fence_cb excl_cb; unsigned long flags; -#define I915_ACTIVE_GRAB_BIT 0 +#define I915_ACTIVE_RETIRE_SLEEPS BIT(0) +#define I915_ACTIVE_GRAB_BIT 1 int (*active)(struct i915_active *ref); void (*retire)(struct i915_active *ref); + struct work_struct work; + struct llist_head preallocated_barriers; }; |