From e49d93a960f8995affeb4541941eb7f16d04eafd Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 11 Oct 2017 14:58:57 -0700 Subject: gpu: nvgpu: Linux specific GPU characteristics flags Make GPU characteristics flags specific to Linux code only. The rest of driver is moved to using nvgpu_is_enabled() API. JIRA NVGPU-259 Change-Id: I2faf46ef64c964361c267887b28c9d19806d6d51 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1583876 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c | 4 ++-- drivers/gpu/nvgpu/gk20a/gk20a.c | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c index 12d7dcb9..1517d25a 100644 --- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "ctxsw_trace_gk20a.h" #include "fecs_trace_gk20a.h" @@ -594,8 +595,7 @@ int gk20a_fecs_trace_init(struct gk20a *g) hash_init(trace->pid_hash_table); - g->gpu_characteristics.flags |= - NVGPU_GPU_FLAGS_SUPPORT_FECS_CTXSW_TRACE; + __nvgpu_set_enabled(g, NVGPU_SUPPORT_FECS_CTXSW_TRACE, true); gk20a_fecs_trace_debugfs_init(g); diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index e3c2397c..2b99b52c 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -417,24 +417,26 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) gpu->available_big_page_sizes |= g->ops.mm.get_big_page_sizes(); } - gpu->flags = NVGPU_GPU_FLAGS_SUPPORT_PARTIAL_MAPPINGS | - NVGPU_GPU_FLAGS_SUPPORT_MAP_DIRECT_KIND_CTRL; + __nvgpu_set_enabled(g, NVGPU_SUPPORT_PARTIAL_MAPPINGS, true); + __nvgpu_set_enabled(g, NVGPU_SUPPORT_MAP_DIRECT_KIND_CTRL, true); if (IS_ENABLED(CONFIG_SYNC)) - gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_SYNC_FENCE_FDS; + __nvgpu_set_enabled(g, NVGPU_SUPPORT_SYNC_FENCE_FDS, true); if (g->ops.mm.support_sparse && g->ops.mm.support_sparse(g)) - gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_SPARSE_ALLOCS; + __nvgpu_set_enabled(g, NVGPU_SUPPORT_SPARSE_ALLOCS, true); if (gk20a_platform_has_syncpoints(g)) - gpu->flags |= NVGPU_GPU_FLAGS_HAS_SYNCPOINTS; + __nvgpu_set_enabled(g, NVGPU_HAS_SYNCPOINTS, true); /* * Fast submits are supported as long as the user doesn't request * anything that depends on job tracking. (Here, fast means strictly no * metadata, just the gpfifo contents are copied and gp_put updated). */ - gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_DETERMINISTIC_SUBMIT_NO_JOBTRACKING; + __nvgpu_set_enabled(g, + NVGPU_SUPPORT_DETERMINISTIC_SUBMIT_NO_JOBTRACKING, + true); /* * Sync framework requires deferred job cleanup, wrapping syncs in FDs, @@ -443,13 +445,15 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) * that depends on deferred cleanup. */ if (!gk20a_channel_sync_needs_sync_framework(g)) - gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_DETERMINISTIC_SUBMIT_FULL; + __nvgpu_set_enabled(g, + NVGPU_SUPPORT_DETERMINISTIC_SUBMIT_FULL, + true); - gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_USERSPACE_MANAGED_AS; - gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_TSG; + __nvgpu_set_enabled(g, NVGPU_SUPPORT_USERSPACE_MANAGED_AS, true); + __nvgpu_set_enabled(g, NVGPU_SUPPORT_TSG, true); if (g->ops.clk_arb.get_arbiter_clk_domains) - gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_CLOCK_CONTROLS; + __nvgpu_set_enabled(g, NVGPU_SUPPORT_CLOCK_CONTROLS, true); gpu->gpc_mask = (1 << g->gr.gpc_count)-1; -- cgit v1.2.2