summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Daifuku <pdaifuku@nvidia.com>2017-11-07 19:05:58 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-11-08 20:56:47 -0500
commitcddf69c549c5c6fb2c69e4620636e96c698a4201 (patch)
tree7f02b61ece3e032caca55ac1b8f3d2414f4b33f9
parent016231c045bfaa9f21feed00b88ac507c4935ebc (diff)
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 <pdaifuku@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1593939 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/enabled.h18
-rw-r--r--drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c14
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.c1
3 files changed, 21 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h
index 82f9e6d2..f2b5dbf7 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/enabled.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h
@@ -78,28 +78,28 @@ struct gk20a;
78/* NVGPU_IOCTL_CHANNEL_CYCLE_STATS_SNAPSHOT is available */ 78/* NVGPU_IOCTL_CHANNEL_CYCLE_STATS_SNAPSHOT is available */
79#define NVGPU_SUPPORT_CYCLE_STATS_SNAPSHOT 33 79#define NVGPU_SUPPORT_CYCLE_STATS_SNAPSHOT 33
80/* Both gpu driver and device support TSG */ 80/* Both gpu driver and device support TSG */
81#define NVGPU_SUPPORT_TSG 33 81#define NVGPU_SUPPORT_TSG 34
82/* Fast deterministic submits with no job tracking are supported */ 82/* Fast deterministic submits with no job tracking are supported */
83#define NVGPU_SUPPORT_DETERMINISTIC_SUBMIT_NO_JOBTRACKING 34 83#define NVGPU_SUPPORT_DETERMINISTIC_SUBMIT_NO_JOBTRACKING 35
84/* Deterministic submits are supported even with job tracking */ 84/* Deterministic submits are supported even with job tracking */
85#define NVGPU_SUPPORT_DETERMINISTIC_SUBMIT_FULL 35 85#define NVGPU_SUPPORT_DETERMINISTIC_SUBMIT_FULL 36
86/* NVGPU_SUBMIT_GPFIFO_FLAGS_RESCHEDULE_RUNLIST is available */ 86/* NVGPU_SUBMIT_GPFIFO_FLAGS_RESCHEDULE_RUNLIST is available */
87#define NVGPU_SUPPORT_RESCHEDULE_RUNLIST 36 87#define NVGPU_SUPPORT_RESCHEDULE_RUNLIST 37
88 88
89/* NVGPU_GPU_IOCTL_GET_EVENT_FD is available */ 89/* NVGPU_GPU_IOCTL_GET_EVENT_FD is available */
90#define NVGPU_SUPPORT_DEVICE_EVENTS 37 90#define NVGPU_SUPPORT_DEVICE_EVENTS 38
91/* FECS context switch tracing is available */ 91/* FECS context switch tracing is available */
92#define NVGPU_SUPPORT_FECS_CTXSW_TRACE 38 92#define NVGPU_SUPPORT_FECS_CTXSW_TRACE 39
93 93
94/* NVGPU_GPU_IOCTL_SET_DETERMINISTIC_OPTS is available */ 94/* NVGPU_GPU_IOCTL_SET_DETERMINISTIC_OPTS is available */
95#define NVGPU_SUPPORT_DETERMINISTIC_OPTS 39 95#define NVGPU_SUPPORT_DETERMINISTIC_OPTS 40
96 96
97/* 97/*
98 * Security flags 98 * Security flags
99 */ 99 */
100 100
101#define NVGPU_SEC_SECUREGPCCS 40 101#define NVGPU_SEC_SECUREGPCCS 41
102#define NVGPU_SEC_PRIVSECURITY 41 102#define NVGPU_SEC_PRIVSECURITY 42
103 103
104/* 104/*
105 * PMU flags. 105 * PMU flags.
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 @@
30void vgpu_gr_gm20b_init_cyclestats(struct gk20a *g) 30void vgpu_gr_gm20b_init_cyclestats(struct gk20a *g)
31{ 31{
32#if defined(CONFIG_GK20A_CYCLE_STATS) 32#if defined(CONFIG_GK20A_CYCLE_STATS)
33 __nvgpu_set_enabled(g, NVGPU_SUPPORT_CYCLE_STATS, true); 33 bool snapshots_supported = true;
34 __nvgpu_set_enabled(g, NVGPU_SUPPORT_CYCLE_STATS_SNAPSHOT, true); 34
35 /* cyclestats not supported on vgpu */
36 __nvgpu_set_enabled(g, NVGPU_SUPPORT_CYCLE_STATS, false);
37
35 g->gpu_characteristics.max_css_buffer_size = 38 g->gpu_characteristics.max_css_buffer_size =
36 vgpu_css_get_buffer_size(g); 39 vgpu_css_get_buffer_size(g);
40
41 /* snapshots not supported if the buffer size is 0 */
42 if (g->gpu_characteristics.max_css_buffer_size == 0)
43 snapshots_supported = false;
44
45 __nvgpu_set_enabled(g, NVGPU_SUPPORT_CYCLE_STATS_SNAPSHOT,
46 snapshots_supported);
37#endif 47#endif
38} 48}
39 49
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c
index 2cd99e8c..c753fd97 100644
--- a/drivers/gpu/nvgpu/vgpu/vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/vgpu.c
@@ -371,7 +371,6 @@ int vgpu_init_gpu_characteristics(struct gk20a *g)
371 g->gpu_characteristics.map_buffer_batch_limit = 0; 371 g->gpu_characteristics.map_buffer_batch_limit = 0;
372 372
373 /* features vgpu does not support */ 373 /* features vgpu does not support */
374 __nvgpu_set_enabled(g, NVGPU_SUPPORT_CYCLE_STATS, false);
375 __nvgpu_set_enabled(g, NVGPU_SUPPORT_RESCHEDULE_RUNLIST, false); 374 __nvgpu_set_enabled(g, NVGPU_SUPPORT_RESCHEDULE_RUNLIST, false);
376 375
377 return 0; 376 return 0;