drm/i915/gvt: Change fb_info->size from pages to bytes
[linux-2.6-block.git] / drivers / gpu / drm / i915 / i915_timeline_types.h
1 /*
2  * SPDX-License-Identifier: MIT
3  *
4  * Copyright © 2016 Intel Corporation
5  */
6
7 #ifndef __I915_TIMELINE_TYPES_H__
8 #define __I915_TIMELINE_TYPES_H__
9
10 #include <linux/list.h>
11 #include <linux/kref.h>
12 #include <linux/mutex.h>
13 #include <linux/types.h>
14
15 #include "i915_active_types.h"
16
17 struct drm_i915_private;
18 struct i915_vma;
19 struct i915_timeline_cacheline;
20 struct i915_syncmap;
21
22 struct i915_timeline {
23         u64 fence_context;
24         u32 seqno;
25
26         spinlock_t lock;
27 #define TIMELINE_CLIENT 0 /* default subclass */
28 #define TIMELINE_ENGINE 1
29         struct mutex mutex; /* protects the flow of requests */
30
31         unsigned int pin_count;
32         const u32 *hwsp_seqno;
33         struct i915_vma *hwsp_ggtt;
34         u32 hwsp_offset;
35
36         struct i915_timeline_cacheline *hwsp_cacheline;
37
38         bool has_initial_breadcrumb;
39
40         /**
41          * List of breadcrumbs associated with GPU requests currently
42          * outstanding.
43          */
44         struct list_head requests;
45
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
49          * struct_mutex.
50          */
51         struct i915_active_request last_request;
52
53         /**
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.
61          */
62         struct i915_syncmap *sync;
63
64         struct list_head link;
65         struct drm_i915_private *i915;
66
67         struct kref kref;
68 };
69
70 #endif /* __I915_TIMELINE_TYPES_H__ */