diff options
author | Alex Waterman <alexw@nvidia.com> | 2018-08-21 13:35:06 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-27 18:04:38 -0400 |
commit | 8789cafcfb0d1e16ad0b2c61b047d275f2d684b4 (patch) | |
tree | 34092ee2fcedbfbe719c9984c5f5f06807632158 /drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c | |
parent | c6eae929fd74f11ab13d469a38bffd4e8ba50fb5 (diff) |
gpu: nvgpu: Standardize HAS_SYNCPOINTs check
Nvgpu uses many ways to check if sync points are enabled. The four
ways used to be:
platform->has_syncpoints
g->has_syncpoints
nvgpu_is_enabled(g, NVPGU_HAS_SYNCPOINTS)
gk20a_platform_has_syncpoints()
This patch standardizes all usage to now be nvgpu_has_syncpoints()
which is based on gk20a_platform_has_syncpoints() - just renamed to
be general to nvgpu.
All usage of the other forms have now been consolidated. However,
under the hood nvgpu_has_syncpoints() does check the is_enabled
flag. This flag is now set where g->has_syncpoints used to be set
based on the platform data.
The basic dependency chain is this:
nvgpu_has_syncpoints -> NVGPU_HAS_SYNCPOINTS ->
platform->has_syncpoints
However, note: there are several places where syncpoints can be
disabled if some other driver initialization fails (for ex. host1x).
Also note that nvgpu_has_syncpoints() also considers a disable
variable set by debugfs.
Bug 2327574
Change-Id: Ia2375a80f5f2e27285e6175568dd13e6bb25fd33
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1803975
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c b/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c index 9cb40fb4..e01178ed 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c | |||
@@ -80,7 +80,7 @@ static void vgpu_init_vars(struct gk20a *g, struct gk20a_platform *platform) | |||
80 | 80 | ||
81 | g->aggressive_sync_destroy = platform->aggressive_sync_destroy; | 81 | g->aggressive_sync_destroy = platform->aggressive_sync_destroy; |
82 | g->aggressive_sync_destroy_thresh = platform->aggressive_sync_destroy_thresh; | 82 | g->aggressive_sync_destroy_thresh = platform->aggressive_sync_destroy_thresh; |
83 | g->has_syncpoints = platform->has_syncpoints; | 83 | __nvgpu_set_enabled(g, NVGPU_HAS_SYNCPOINTS, platform->has_syncpoints); |
84 | g->ptimer_src_freq = platform->ptimer_src_freq; | 84 | g->ptimer_src_freq = platform->ptimer_src_freq; |
85 | __nvgpu_set_enabled(g, NVGPU_CAN_RAILGATE, platform->can_railgate_init); | 85 | __nvgpu_set_enabled(g, NVGPU_CAN_RAILGATE, platform->can_railgate_init); |
86 | g->railgate_delay = platform->railgate_delay_init; | 86 | g->railgate_delay = platform->railgate_delay_init; |