This source file includes following definitions.
- intel_frontbuffer_invalidate
- intel_frontbuffer_flush
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #ifndef __INTEL_FRONTBUFFER_H__
25 #define __INTEL_FRONTBUFFER_H__
26
27 #include <linux/atomic.h>
28 #include <linux/kref.h>
29
30 #include "i915_active.h"
31
32 struct drm_i915_private;
33 struct drm_i915_gem_object;
34
35 enum fb_op_origin {
36 ORIGIN_GTT,
37 ORIGIN_CPU,
38 ORIGIN_CS,
39 ORIGIN_FLIP,
40 ORIGIN_DIRTYFB,
41 };
42
43 struct intel_frontbuffer {
44 struct kref ref;
45 atomic_t bits;
46 struct i915_active write;
47 struct drm_i915_gem_object *obj;
48 };
49
50 void intel_frontbuffer_flip_prepare(struct drm_i915_private *i915,
51 unsigned frontbuffer_bits);
52 void intel_frontbuffer_flip_complete(struct drm_i915_private *i915,
53 unsigned frontbuffer_bits);
54 void intel_frontbuffer_flip(struct drm_i915_private *i915,
55 unsigned frontbuffer_bits);
56
57 struct intel_frontbuffer *
58 intel_frontbuffer_get(struct drm_i915_gem_object *obj);
59
60 void __intel_fb_invalidate(struct intel_frontbuffer *front,
61 enum fb_op_origin origin,
62 unsigned int frontbuffer_bits);
63
64
65
66
67
68
69
70
71
72
73
74
75 static inline bool intel_frontbuffer_invalidate(struct intel_frontbuffer *front,
76 enum fb_op_origin origin)
77 {
78 unsigned int frontbuffer_bits;
79
80 if (!front)
81 return false;
82
83 frontbuffer_bits = atomic_read(&front->bits);
84 if (!frontbuffer_bits)
85 return false;
86
87 __intel_fb_invalidate(front, origin, frontbuffer_bits);
88 return true;
89 }
90
91 void __intel_fb_flush(struct intel_frontbuffer *front,
92 enum fb_op_origin origin,
93 unsigned int frontbuffer_bits);
94
95
96
97
98
99
100
101
102
103 static inline void intel_frontbuffer_flush(struct intel_frontbuffer *front,
104 enum fb_op_origin origin)
105 {
106 unsigned int frontbuffer_bits;
107
108 if (!front)
109 return;
110
111 frontbuffer_bits = atomic_read(&front->bits);
112 if (!frontbuffer_bits)
113 return;
114
115 __intel_fb_flush(front, origin, frontbuffer_bits);
116 }
117
118 void intel_frontbuffer_track(struct intel_frontbuffer *old,
119 struct intel_frontbuffer *new,
120 unsigned int frontbuffer_bits);
121
122 void intel_frontbuffer_put(struct intel_frontbuffer *front);
123
124 #endif