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 {
27 #define TIMELINE_CLIENT 0 /* default subclass */
28 #define TIMELINE_ENGINE 1
29 struct mutex mutex; /* protects the flow of requests */
31 unsigned int pin_count;
32 const u32 *hwsp_seqno;
33 struct i915_vma *hwsp_ggtt;
36 struct i915_timeline_cacheline *hwsp_cacheline;
38 bool has_initial_breadcrumb;
41 * List of breadcrumbs associated with GPU requests currently
44 struct list_head requests;
46 /* Contains an RCU guarded pointer to the last request. No reference is
47 * held to the request, users must carefully acquire a reference to
48 * the request using i915_active_request_get_request_rcu(), or hold the
51 struct i915_active_request last_request;
54 * We track the most recent seqno that we wait on in every context so
55 * that we only have to emit a new await and dependency on a more
56 * recent sync point. As the contexts may be executed out-of-order, we
57 * have to track each individually and can not rely on an absolute
58 * global_seqno. When we know that all tracked fences are completed
59 * (i.e. when the driver is idle), we know that the syncmap is
60 * redundant and we can discard it without loss of generality.
62 struct i915_syncmap *sync;
64 struct list_head link;
65 struct drm_i915_private *i915;
70 #endif /* __I915_TIMELINE_TYPES_H__ */