gpu: nvgpu: cyclestats snapshots are only for t210

The cyclestats mode-e feature supported by userspace only
for t210 devices, so kernel should advertize it only for t210.

Also small check added to prevent BUG in dma-buf.c:826
if device has lack of memory.

Bug 1662506

Change-Id: I8417a8cdd9092e64126382f379d171932e4592a1
Signed-off-by: Leonid Moiseichuk <lmoiseichuk@nvidia.com>
Reviewed-on: http://git-master/r/767073
(cherry picked from commit 06f86b6e78bae5e26e32466716c18e7918efb1b1)
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: http://git-master/r/767148
Reviewed-by: Automatic_Commit_Validation_User
This commit is contained in:
Leonid Moiseichuk
2015-07-07 13:54:06 +03:00
committed by Bharat Nihalani
parent 51c784d9a1
commit 1e7b5ea793
2 changed files with 9 additions and 2 deletions

View File

@@ -569,8 +569,10 @@ static int css_gr_free_client_data(struct gk20a_cs_snapshot *data,
client->perfmon_start, client->perfmon_count))
ret = -EINVAL;
}
if (client->dma_handler) {
dma_buf_vunmap(client->dma_handler, client->snapshot);
if (client->snapshot)
dma_buf_vunmap(client->dma_handler, client->snapshot);
dma_buf_put(client->dma_handler);
}

View File

@@ -2008,7 +2008,12 @@ int gk20a_init_gpu_characteristics(struct gk20a *g)
if (IS_ENABLED(CONFIG_GK20A_CYCLE_STATS)) {
gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS;
gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS_SNAPSHOT;
/* the snapshots must be supported only for t210 */
if (NVGPU_GPU_ARCH_GM200 == gpu->arch &&
NVGPU_GPU_IMPL_GM20B == gpu->impl) {
gpu->flags |=
NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS_SNAPSHOT;
}
}
gpu->gpc_mask = 1;