summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fifo_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fifo_gk20a.h39
1 files changed, 38 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h
index 147d1bea..75c801c6 100644
--- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h
@@ -30,6 +30,15 @@
30#define FIFO_INVAL_CHANNEL_ID ((u32)~0) 30#define FIFO_INVAL_CHANNEL_ID ((u32)~0)
31#define FIFO_INVAL_TSG_ID ((u32)~0) 31#define FIFO_INVAL_TSG_ID ((u32)~0)
32 32
33/*
34 * Number of entries in the kickoff latency buffer, used to calculate
35 * the profiling and histogram. This number is calculated to be statistically
36 * significative on a histogram on a 5% step
37 */
38#ifdef CONFIG_DEBUG_FS
39#define FIFO_PROFILING_ENTRIES 16384
40#endif
41
33/* generally corresponds to the "pbdma" engine */ 42/* generally corresponds to the "pbdma" engine */
34 43
35struct fifo_runlist_info_gk20a { 44struct fifo_runlist_info_gk20a {
@@ -99,6 +108,20 @@ struct fifo_engine_info_gk20a {
99 108
100}; 109};
101 110
111enum {
112 PROFILE_IOCTL_ENTRY = 0,
113 PROFILE_ENTRY,
114 PROFILE_JOB_TRACKING,
115 PROFILE_APPEND,
116 PROFILE_END,
117 PROFILE_IOCTL_EXIT,
118 PROFILE_MAX
119};
120
121struct fifo_profile_gk20a {
122 u64 timestamp[PROFILE_MAX];
123};
124
102struct fifo_gk20a { 125struct fifo_gk20a {
103 struct gk20a *g; 126 struct gk20a *g;
104 unsigned int num_channels; 127 unsigned int num_channels;
@@ -115,7 +138,16 @@ struct fifo_gk20a {
115 138
116 struct fifo_runlist_info_gk20a *runlist_info; 139 struct fifo_runlist_info_gk20a *runlist_info;
117 u32 max_runlists; 140 u32 max_runlists;
118 141#ifdef CONFIG_DEBUG_FS
142 struct {
143 struct fifo_profile_gk20a *data;
144 atomic_t get;
145 bool enabled;
146 u64 *sorted;
147 struct kref ref;
148 struct nvgpu_mutex lock;
149 } profile;
150#endif
119 struct mem_desc userd; 151 struct mem_desc userd;
120 u32 userd_entry_size; 152 u32 userd_entry_size;
121 153
@@ -275,5 +307,10 @@ void gk20a_get_ch_runlist_entry(struct channel_gk20a *ch, u32 *runlist);
275u32 gk20a_userd_gp_get(struct gk20a *g, struct channel_gk20a *c); 307u32 gk20a_userd_gp_get(struct gk20a *g, struct channel_gk20a *c);
276void gk20a_userd_gp_put(struct gk20a *g, struct channel_gk20a *c); 308void gk20a_userd_gp_put(struct gk20a *g, struct channel_gk20a *c);
277bool gk20a_is_fault_engine_subid_gpc(struct gk20a *g, u32 engine_subid); 309bool gk20a_is_fault_engine_subid_gpc(struct gk20a *g, u32 engine_subid);
310#ifdef CONFIG_DEBUG_FS
311struct fifo_profile_gk20a *gk20a_fifo_profile_acquire(struct gk20a *g);
312void gk20a_fifo_profile_release(struct gk20a *g,
313 struct fifo_profile_gk20a *profile);
314#endif
278 315
279#endif /*__GR_GK20A_H__*/ 316#endif /*__GR_GK20A_H__*/