diff options
author | Leonid Moiseichuk <lmoiseichuk@nvidia.com> | 2015-08-11 06:38:51 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2015-09-04 12:03:07 -0400 |
commit | 54c2ae59f0010c75bc03719e7b5ece4040c102d3 (patch) | |
tree | 549ea910d4de7dde2d335e3f0198baab51354177 /drivers/gpu/nvgpu/gk20a/gk20a.c | |
parent | eeb604c23d4ea7a6a7900b99a2ae92cff0488112 (diff) |
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 <lmoiseichuk@nvidia.com>
Reviewed-on: http://git-master/r/781697
(cherry picked from commit bdd23136b182c933841f91dd2829061e278a46d4)
Reviewed-on: http://git-master/r/793630
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 7875d621..c0889571 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -1965,20 +1965,13 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) | |||
1965 | gk20a_platform_has_syncpoints(g->dev)) | 1965 | gk20a_platform_has_syncpoints(g->dev)) |
1966 | gpu->flags |= NVGPU_GPU_FLAGS_HAS_SYNCPOINTS; | 1966 | gpu->flags |= NVGPU_GPU_FLAGS_HAS_SYNCPOINTS; |
1967 | 1967 | ||
1968 | if (IS_ENABLED(CONFIG_GK20A_CYCLE_STATS)) { | ||
1969 | gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS; | ||
1970 | /* the snapshots must be supported only for t210 */ | ||
1971 | if (NVGPU_GPU_ARCH_GM200 == gpu->arch && | ||
1972 | NVGPU_GPU_IMPL_GM20B == gpu->impl) { | ||
1973 | gpu->flags |= | ||
1974 | NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS_SNAPSHOT; | ||
1975 | } | ||
1976 | } | ||
1977 | |||
1978 | gpu->gpc_mask = 1; | 1968 | gpu->gpc_mask = 1; |
1979 | 1969 | ||
1980 | g->ops.gr.detect_sm_arch(g); | 1970 | g->ops.gr.detect_sm_arch(g); |
1981 | 1971 | ||
1972 | if (g->ops.gr.init_cyclestats) | ||
1973 | g->ops.gr.init_cyclestats(g); | ||
1974 | |||
1982 | gpu->gpu_ioctl_nr_last = NVGPU_GPU_IOCTL_LAST; | 1975 | gpu->gpu_ioctl_nr_last = NVGPU_GPU_IOCTL_LAST; |
1983 | gpu->tsg_ioctl_nr_last = NVGPU_TSG_IOCTL_LAST; | 1976 | gpu->tsg_ioctl_nr_last = NVGPU_TSG_IOCTL_LAST; |
1984 | gpu->dbg_gpu_ioctl_nr_last = NVGPU_DBG_GPU_IOCTL_LAST; | 1977 | gpu->dbg_gpu_ioctl_nr_last = NVGPU_DBG_GPU_IOCTL_LAST; |