2 * SPDX-License-Identifier: MIT
4 * Copyright © 2016 Intel Corporation
7 #ifndef __I915_TIMELINE_TYPES_H__
8 #define __I915_TIMELINE_TYPES_H__
10 #include <linux/list.h>
11 #include <linux/kref.h>
12 #include <linux/mutex.h>
13 #include <linux/types.h>
15 #include "i915_active_types.h"
17 struct drm_i915_private;
19 struct i915_timeline_cacheline;
22 struct i915_timeline {
26 struct mutex mutex; /* protects the flow of requests */
28 unsigned int pin_count;
29 const u32 *hwsp_seqno;
30 struct i915_vma *hwsp_ggtt;
33 struct i915_timeline_cacheline *hwsp_cacheline;
35 bool has_initial_breadcrumb;
38 * List of breadcrumbs associated with GPU requests currently
41 struct list_head requests;
43 /* Contains an RCU guarded pointer to the last request. No reference is
44 * held to the request, users must carefully acquire a reference to
45 * the request using i915_active_request_get_request_rcu(), or hold the
48 struct i915_active_request last_request;
51 * We track the most recent seqno that we wait on in every context so
52 * that we only have to emit a new await and dependency on a more
53 * recent sync point. As the contexts may be executed out-of-order, we
54 * have to track each individually and can not rely on an absolute
55 * global_seqno. When we know that all tracked fences are completed
56 * (i.e. when the driver is idle), we know that the syncmap is
57 * redundant and we can discard it without loss of generality.
59 struct i915_syncmap *sync;
61 struct list_head link;
62 struct drm_i915_private *i915;
67 #endif /* __I915_TIMELINE_TYPES_H__ */