summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-10-11 17:58:57 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-26 17:35:38 -0400
commite49d93a960f8995affeb4541941eb7f16d04eafd (patch)
tree7b5eb1365bfee8a237ddf7d8e0b02959e50f5704 /drivers/gpu/nvgpu/gk20a
parent9eebb7831facaa16b2975f50a716d2986c67b699 (diff)
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 <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1583876 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c4
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c24
2 files changed, 16 insertions, 12 deletions
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 @@
33#include <nvgpu/thread.h> 33#include <nvgpu/thread.h>
34#include <nvgpu/barrier.h> 34#include <nvgpu/barrier.h>
35#include <nvgpu/mm.h> 35#include <nvgpu/mm.h>
36#include <nvgpu/enabled.h>
36 37
37#include "ctxsw_trace_gk20a.h" 38#include "ctxsw_trace_gk20a.h"
38#include "fecs_trace_gk20a.h" 39#include "fecs_trace_gk20a.h"
@@ -594,8 +595,7 @@ int gk20a_fecs_trace_init(struct gk20a *g)
594 595
595 hash_init(trace->pid_hash_table); 596 hash_init(trace->pid_hash_table);
596 597
597 g->gpu_characteristics.flags |= 598 __nvgpu_set_enabled(g, NVGPU_SUPPORT_FECS_CTXSW_TRACE, true);
598 NVGPU_GPU_FLAGS_SUPPORT_FECS_CTXSW_TRACE;
599 599
600 gk20a_fecs_trace_debugfs_init(g); 600 gk20a_fecs_trace_debugfs_init(g);
601 601
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)
417 gpu->available_big_page_sizes |= g->ops.mm.get_big_page_sizes(); 417 gpu->available_big_page_sizes |= g->ops.mm.get_big_page_sizes();
418 } 418 }
419 419
420 gpu->flags = NVGPU_GPU_FLAGS_SUPPORT_PARTIAL_MAPPINGS | 420 __nvgpu_set_enabled(g, NVGPU_SUPPORT_PARTIAL_MAPPINGS, true);
421 NVGPU_GPU_FLAGS_SUPPORT_MAP_DIRECT_KIND_CTRL; 421 __nvgpu_set_enabled(g, NVGPU_SUPPORT_MAP_DIRECT_KIND_CTRL, true);
422 422
423 if (IS_ENABLED(CONFIG_SYNC)) 423 if (IS_ENABLED(CONFIG_SYNC))
424 gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_SYNC_FENCE_FDS; 424 __nvgpu_set_enabled(g, NVGPU_SUPPORT_SYNC_FENCE_FDS, true);
425 425
426 if (g->ops.mm.support_sparse && g->ops.mm.support_sparse(g)) 426 if (g->ops.mm.support_sparse && g->ops.mm.support_sparse(g))
427 gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_SPARSE_ALLOCS; 427 __nvgpu_set_enabled(g, NVGPU_SUPPORT_SPARSE_ALLOCS, true);
428 428
429 if (gk20a_platform_has_syncpoints(g)) 429 if (gk20a_platform_has_syncpoints(g))
430 gpu->flags |= NVGPU_GPU_FLAGS_HAS_SYNCPOINTS; 430 __nvgpu_set_enabled(g, NVGPU_HAS_SYNCPOINTS, true);
431 431
432 /* 432 /*
433 * Fast submits are supported as long as the user doesn't request 433 * Fast submits are supported as long as the user doesn't request
434 * anything that depends on job tracking. (Here, fast means strictly no 434 * anything that depends on job tracking. (Here, fast means strictly no
435 * metadata, just the gpfifo contents are copied and gp_put updated). 435 * metadata, just the gpfifo contents are copied and gp_put updated).
436 */ 436 */
437 gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_DETERMINISTIC_SUBMIT_NO_JOBTRACKING; 437 __nvgpu_set_enabled(g,
438 NVGPU_SUPPORT_DETERMINISTIC_SUBMIT_NO_JOBTRACKING,
439 true);
438 440
439 /* 441 /*
440 * Sync framework requires deferred job cleanup, wrapping syncs in FDs, 442 * Sync framework requires deferred job cleanup, wrapping syncs in FDs,
@@ -443,13 +445,15 @@ int gk20a_init_gpu_characteristics(struct gk20a *g)
443 * that depends on deferred cleanup. 445 * that depends on deferred cleanup.
444 */ 446 */
445 if (!gk20a_channel_sync_needs_sync_framework(g)) 447 if (!gk20a_channel_sync_needs_sync_framework(g))
446 gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_DETERMINISTIC_SUBMIT_FULL; 448 __nvgpu_set_enabled(g,
449 NVGPU_SUPPORT_DETERMINISTIC_SUBMIT_FULL,
450 true);
447 451
448 gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_USERSPACE_MANAGED_AS; 452 __nvgpu_set_enabled(g, NVGPU_SUPPORT_USERSPACE_MANAGED_AS, true);
449 gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_TSG; 453 __nvgpu_set_enabled(g, NVGPU_SUPPORT_TSG, true);
450 454
451 if (g->ops.clk_arb.get_arbiter_clk_domains) 455 if (g->ops.clk_arb.get_arbiter_clk_domains)
452 gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_CLOCK_CONTROLS; 456 __nvgpu_set_enabled(g, NVGPU_SUPPORT_CLOCK_CONTROLS, true);
453 457
454 gpu->gpc_mask = (1 << g->gr.gpc_count)-1; 458 gpu->gpc_mask = (1 << g->gr.gpc_count)-1;
455 459