diff options
author | Leonid Moiseichuk <lmoiseichuk@nvidia.com> | 2015-05-08 08:06:42 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2015-06-06 10:23:24 -0400 |
commit | 837ceffcab417865db8adbdf1a2038ebde8ec1a5 (patch) | |
tree | 8890ac07cd6cca9d5cff054dd899a8f6052b0669 /drivers/gpu/nvgpu/gk20a/gr_gk20a.h | |
parent | ef8fa4999fcd8c01275ef3790b0abd5e69c55ea5 (diff) |
gpu: nvgpu: cyclestats mode E snapshots support
That is a kernel supporting code for cyclestats mode E.
Cyclestats mode E implemented following Windows-design in user-space
and required the following operations to be implemented:
- attach a client for shared hardware buffer of device
- detach client from shared hardware buffer
- flush means copy of available data from hardware buffer to private
client buffers according to perfmon IDs assigned for clients
- perfmon IDs management for user-space clients
- a NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS_SNAPSHOT capability added
Bug 1573150
Change-Id: I9e09f0fbb2be5a95c47e6d80a2e23fa839b46f9a
Signed-off-by: Leonid Moiseichuk <lmoiseichuk@nvidia.com>
Reviewed-on: http://git-master/r/740653
(cherry picked from commit 79fe89fd4cea39d8ab9dbef0558cd806ddfda87f)
Reviewed-on: http://git-master/r/753274
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index b2213739..0909b660 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h | |||
@@ -170,6 +170,11 @@ struct sm_info { | |||
170 | u8 tpc_index; | 170 | u8 tpc_index; |
171 | }; | 171 | }; |
172 | 172 | ||
173 | #if defined(CONFIG_GK20A_CYCLE_STATS) | ||
174 | struct gk20a_cs_snapshot_client; | ||
175 | struct gk20a_cs_snapshot; | ||
176 | #endif | ||
177 | |||
173 | struct gr_gk20a { | 178 | struct gr_gk20a { |
174 | struct gk20a *g; | 179 | struct gk20a *g; |
175 | struct { | 180 | struct { |
@@ -294,6 +299,10 @@ struct gr_gk20a { | |||
294 | u32 fbp_en_mask; | 299 | u32 fbp_en_mask; |
295 | u32 no_of_sm; | 300 | u32 no_of_sm; |
296 | struct sm_info *sm_to_cluster; | 301 | struct sm_info *sm_to_cluster; |
302 | #if defined(CONFIG_GK20A_CYCLE_STATS) | ||
303 | struct mutex cs_lock; | ||
304 | struct gk20a_cs_snapshot *cs_data; | ||
305 | #endif | ||
297 | }; | 306 | }; |
298 | 307 | ||
299 | void gk20a_fecs_dump_falcon_stats(struct gk20a *g); | 308 | void gk20a_fecs_dump_falcon_stats(struct gk20a *g); |
@@ -497,4 +506,27 @@ void gr_gk20a_free_gr_ctx(struct gk20a *g, | |||
497 | int gr_gk20a_halt_pipe(struct gk20a *g); | 506 | int gr_gk20a_halt_pipe(struct gk20a *g); |
498 | int gr_gk20a_debugfs_init(struct gk20a *g); | 507 | int gr_gk20a_debugfs_init(struct gk20a *g); |
499 | 508 | ||
509 | #if defined(CONFIG_GK20A_CYCLE_STATS) | ||
510 | int gr_gk20a_css_attach(struct gk20a *g, /* in - main hw structure */ | ||
511 | u32 dmabuf_fd, /* in - dma mapped memory */ | ||
512 | u32 perfmon_id_count, /* in - number of perfmons*/ | ||
513 | u32 *perfmon_id_start, /* out- index of first pm */ | ||
514 | /* out - pointer to client data used in later */ | ||
515 | struct gk20a_cs_snapshot_client **css_client); | ||
516 | |||
517 | int gr_gk20a_css_detach(struct gk20a *g, | ||
518 | struct gk20a_cs_snapshot_client *css_client); | ||
519 | int gr_gk20a_css_flush(struct gk20a *g, | ||
520 | struct gk20a_cs_snapshot_client *css_client); | ||
521 | |||
522 | void gr_gk20a_free_cyclestats_snapshot_data(struct gk20a *g); | ||
523 | |||
524 | #else | ||
525 | /* fake empty cleanup function if no cyclestats snapshots enabled */ | ||
526 | static inline void gr_gk20a_free_cyclestats_snapshot_data(struct gk20a *g) | ||
527 | { | ||
528 | (void)g; | ||
529 | } | ||
530 | #endif | ||
531 | |||
500 | #endif /*__GR_GK20A_H__*/ | 532 | #endif /*__GR_GK20A_H__*/ |