From 837ceffcab417865db8adbdf1a2038ebde8ec1a5 Mon Sep 17 00:00:00 2001 From: Leonid Moiseichuk Date: Fri, 8 May 2015 15:06:42 +0300 Subject: 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 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 Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 7c007622..85d1a886 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -2847,6 +2847,8 @@ static void gk20a_remove_gr_support(struct gr_gk20a *gr) gk20a_dbg_fn(""); + gr_gk20a_free_cyclestats_snapshot_data(g); + gr_gk20a_free_global_ctx_buffers(g); gk20a_gmmu_free(g, &gr->mmu_wr_mem); @@ -4523,6 +4525,11 @@ int gk20a_init_gr_support(struct gk20a *g) gk20a_dbg_fn(""); +#if defined(CONFIG_GK20A_CYCLE_STATS) + mutex_init(&g->gr.cs_lock); + g->gr.cs_data = NULL; +#endif + /* this is required before gr_gk20a_init_ctx_state */ mutex_init(&g->gr.fecs_mutex); -- cgit v1.2.2