This source file includes following definitions.
- i915_pmu_register
- i915_pmu_unregister
- i915_pmu_gt_parked
- i915_pmu_gt_unparked
1
2
3
4
5
6
7 #ifndef __I915_PMU_H__
8 #define __I915_PMU_H__
9
10 #include <linux/hrtimer.h>
11 #include <linux/perf_event.h>
12 #include <linux/spinlock_types.h>
13 #include <drm/i915_drm.h>
14
15 struct drm_i915_private;
16
17 enum {
18 __I915_SAMPLE_FREQ_ACT = 0,
19 __I915_SAMPLE_FREQ_REQ,
20 __I915_SAMPLE_RC6,
21 __I915_SAMPLE_RC6_ESTIMATED,
22 __I915_NUM_PMU_SAMPLERS
23 };
24
25
26
27
28
29
30 #define I915_PMU_MASK_BITS \
31 ((1 << I915_PMU_SAMPLE_BITS) + \
32 (I915_PMU_LAST + 1 - __I915_PMU_OTHER(0)))
33
34 #define I915_ENGINE_SAMPLE_COUNT (I915_SAMPLE_SEMA + 1)
35
36 struct i915_pmu_sample {
37 u64 cur;
38 };
39
40 struct i915_pmu {
41
42
43
44 struct hlist_node node;
45
46
47
48 struct pmu base;
49
50
51
52 spinlock_t lock;
53
54
55
56 struct hrtimer timer;
57
58
59
60
61
62
63
64
65
66
67
68
69 u64 enable;
70
71
72
73
74
75
76 ktime_t timer_last;
77
78
79
80
81
82
83
84
85 unsigned int enable_count[I915_PMU_MASK_BITS];
86
87
88
89 bool timer_enabled;
90
91
92
93
94
95
96
97
98 struct i915_pmu_sample sample[__I915_NUM_PMU_SAMPLERS];
99
100
101
102 u64 suspended_time_last;
103
104
105
106 void *i915_attr;
107
108
109
110 void *pmu_attr;
111 };
112
113 #ifdef CONFIG_PERF_EVENTS
114 void i915_pmu_register(struct drm_i915_private *i915);
115 void i915_pmu_unregister(struct drm_i915_private *i915);
116 void i915_pmu_gt_parked(struct drm_i915_private *i915);
117 void i915_pmu_gt_unparked(struct drm_i915_private *i915);
118 #else
119 static inline void i915_pmu_register(struct drm_i915_private *i915) {}
120 static inline void i915_pmu_unregister(struct drm_i915_private *i915) {}
121 static inline void i915_pmu_gt_parked(struct drm_i915_private *i915) {}
122 static inline void i915_pmu_gt_unparked(struct drm_i915_private *i915) {}
123 #endif
124
125 #endif