2 * SPDX-License-Identifier: MIT
4 * Copyright © 2019 Intel Corporation
7 #ifndef _I915_ACTIVE_TYPES_H_
8 #define _I915_ACTIVE_TYPES_H_
10 #include <linux/atomic.h>
11 #include <linux/llist.h>
12 #include <linux/mutex.h>
13 #include <linux/rbtree.h>
14 #include <linux/rcupdate.h>
16 struct drm_i915_private;
17 struct i915_active_request;
20 typedef void (*i915_active_retire_fn)(struct i915_active_request *,
21 struct i915_request *);
23 struct i915_active_request {
24 struct i915_request __rcu *request;
25 struct list_head link;
26 i915_active_retire_fn retire;
27 #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM)
31 * Updates to the i915_active_request must be serialised under a lock
32 * to ensure that the timeline is ordered. Normally, this is the
33 * timeline->mutex, but another mutex may be used so long as it is
34 * done so consistently.
36 * For lockdep tracking of the above, we store the lock we intend
37 * to always use for updates of this i915_active_request during
38 * construction and assert that is held on every update.
47 struct drm_i915_private *i915;
49 struct active_node *cache;
55 #define I915_ACTIVE_GRAB_BIT 0
57 int (*active)(struct i915_active *ref);
58 void (*retire)(struct i915_active *ref);
60 struct llist_head preallocated_barriers;
63 #endif /* _I915_ACTIVE_TYPES_H_ */