From 54c2ae59f0010c75bc03719e7b5ece4040c102d3 Mon Sep 17 00:00:00 2001 From: Leonid Moiseichuk Date: Tue, 11 Aug 2015 13:38:51 +0300 Subject: gpu: nvgpu: cyclestats snapshot permissions rework Cyclestats snapshot feature is expected for new devices. The detection code was isolated in separate function and run-time check added to validate/allow ioctl calls on the current GPU. Bug 1674079 Change-Id: Icc2f1e5cc50d39b395d31d5292c314f99d67f3eb Signed-off-by: Leonid Moiseichuk Reviewed-on: http://git-master/r/781697 (cherry picked from commit bdd23136b182c933841f91dd2829061e278a46d4) Reviewed-on: http://git-master/r/793630 Reviewed-by: Konsta Holtta Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gm20b/gr_gm20b.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers/gpu/nvgpu/gm20b/gr_gm20b.c') diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c index 6c7831d5..17b4b8ea 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c @@ -1040,6 +1040,18 @@ static u32 gr_gm20b_get_max_fbps_count(struct gk20a *g) return max_fbps_count; } +static void gr_gm20b_init_cyclestats(struct gk20a *g) +{ +#if defined(CONFIG_GK20A_CYCLE_STATS) + g->gpu_characteristics.flags |= + NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS; + g->gpu_characteristics.flags |= + NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS_SNAPSHOT; +#else + (void)g; +#endif +} + void gm20b_init_gr(struct gpu_ops *gops) { gops->gr.init_gpc_mmu = gr_gm20b_init_gpc_mmu; @@ -1094,4 +1106,5 @@ void gm20b_init_gr(struct gpu_ops *gops) gops->gr.get_max_fbps_count = gr_gm20b_get_max_fbps_count; gops->gr.init_sm_dsm_reg_info = gr_gm20b_init_sm_dsm_reg_info; gops->gr.wait_empty = gr_gk20a_wait_idle; + gops->gr.init_cyclestats = gr_gm20b_init_cyclestats; } -- cgit v1.2.2