From 5b7588a50ba8d2ed1c07627bbb015ded573ac1c1 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Tue, 9 Feb 2016 15:22:16 -0800 Subject: gpu: nvgpu: add characteristics flag NVGPU_GPU_FLAGS_SUPPORT_TSG NVGPU_GPU_FLAGS_SUPPORT_TSG indicates both the kernel driver and device support time slice group (TSG). Bug 1617046 Bug 200155618 Change-Id: Ib3490a32b773222560c58f1fd6d32bffcb97d6cd Signed-off-by: Richard Zhao Reviewed-on: http://git-master/r/1010173 Reviewed-by: Sami Kiminki Reviewed-by: Aingara Paramakuru Reviewed-by: Terje Bergstrom GVS: Gerrit_Virtual_Submit Reviewed-by: Vladislav Buzov --- drivers/gpu/nvgpu/gk20a/gk20a.c | 1 + drivers/gpu/nvgpu/vgpu/vgpu.c | 2 ++ include/uapi/linux/nvgpu.h | 16 +++++++++------- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 4ddb244b..bbcf60e3 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1999,6 +1999,7 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) gpu->flags |= NVGPU_GPU_FLAGS_HAS_SYNCPOINTS; gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_USERSPACE_MANAGED_AS; + gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_TSG; gpu->gpc_mask = 1; diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c index d97b9e52..c9d2ee92 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c @@ -329,6 +329,8 @@ int vgpu_pm_finalize_poweron(struct device *dev) goto done; } + g->gpu_characteristics.flags &= ~NVGPU_GPU_FLAGS_SUPPORT_TSG; + gk20a_channel_resume(g); done: diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index 80ac159e..442a84ac 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -95,19 +95,21 @@ struct nvgpu_gpu_zbc_query_table_args { #define NVGPU_GPU_BUS_TYPE_NONE 0 #define NVGPU_GPU_BUS_TYPE_AXI 32 -#define NVGPU_GPU_FLAGS_HAS_SYNCPOINTS (1 << 0) +#define NVGPU_GPU_FLAGS_HAS_SYNCPOINTS (1ULL << 0) /* MAP_BUFFER_EX with partial mappings */ -#define NVGPU_GPU_FLAGS_SUPPORT_PARTIAL_MAPPINGS (1 << 1) +#define NVGPU_GPU_FLAGS_SUPPORT_PARTIAL_MAPPINGS (1ULL << 1) /* MAP_BUFFER_EX with sparse allocations */ -#define NVGPU_GPU_FLAGS_SUPPORT_SPARSE_ALLOCS (1 << 2) +#define NVGPU_GPU_FLAGS_SUPPORT_SPARSE_ALLOCS (1ULL << 2) /* sync fence FDs are available in, e.g., submit_gpfifo */ -#define NVGPU_GPU_FLAGS_SUPPORT_SYNC_FENCE_FDS (1 << 3) +#define NVGPU_GPU_FLAGS_SUPPORT_SYNC_FENCE_FDS (1ULL << 3) /* NVGPU_IOCTL_CHANNEL_CYCLE_STATS is available */ -#define NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS (1 << 4) +#define NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS (1ULL << 4) /* NVGPU_IOCTL_CHANNEL_CYCLE_STATS_SNAPSHOT is available */ -#define NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS_SNAPSHOT (1 << 6) +#define NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS_SNAPSHOT (1ULL << 6) /* User-space managed address spaces support */ -#define NVGPU_GPU_FLAGS_SUPPORT_USERSPACE_MANAGED_AS (1 << 7) +#define NVGPU_GPU_FLAGS_SUPPORT_USERSPACE_MANAGED_AS (1ULL << 7) +/* Both gpu driver and device support TSG */ +#define NVGPU_GPU_FLAGS_SUPPORT_TSG (1ULL << 8) struct nvgpu_gpu_characteristics { __u32 arch; -- cgit v1.2.2