From cddf69c549c5c6fb2c69e4620636e96c698a4201 Mon Sep 17 00:00:00 2001 From: Peter Daifuku Date: Tue, 7 Nov 2017 16:05:58 -0800 Subject: gpu: nvgpu: vgpu: cyclestat characteristics fixes Fix characteristics for cyclestats: - SUPPORT_TSG and SUPPORT_CYCLE_STATS_SNAPSHOT were assigned the same value - For vgpu, SUPPORT_CYCLE_STATS was set redundantly (but differently) - For vgpu, if the css buffer size is 0, set the support flag to False JIRA ESRM-88 Bug 200296210 Change-Id: Iaf98dafec55f171b5968c2a8248290284bf30922 Signed-off-by: Peter Daifuku Reviewed-on: https://git-master.nvidia.com/r/1593939 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Konsta Holtta Reviewed-by: Alex Waterman GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/vgpu/gm20b') diff --git a/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c b/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c index 56b1edbc..fca6525a 100644 --- a/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c +++ b/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c @@ -30,10 +30,20 @@ void vgpu_gr_gm20b_init_cyclestats(struct gk20a *g) { #if defined(CONFIG_GK20A_CYCLE_STATS) - __nvgpu_set_enabled(g, NVGPU_SUPPORT_CYCLE_STATS, true); - __nvgpu_set_enabled(g, NVGPU_SUPPORT_CYCLE_STATS_SNAPSHOT, true); + bool snapshots_supported = true; + + /* cyclestats not supported on vgpu */ + __nvgpu_set_enabled(g, NVGPU_SUPPORT_CYCLE_STATS, false); + g->gpu_characteristics.max_css_buffer_size = vgpu_css_get_buffer_size(g); + + /* snapshots not supported if the buffer size is 0 */ + if (g->gpu_characteristics.max_css_buffer_size == 0) + snapshots_supported = false; + + __nvgpu_set_enabled(g, NVGPU_SUPPORT_CYCLE_STATS_SNAPSHOT, + snapshots_supported); #endif } -- cgit v1.2.2