From 8789cafcfb0d1e16ad0b2c61b047d275f2d684b4 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Tue, 21 Aug 2018 10:35:06 -0700 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1803975 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/gk20a.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index 8d7ccfa8..8627fddd 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -1485,7 +1485,6 @@ struct gk20a { unsigned int aggressive_sync_destroy_thresh; bool aggressive_sync_destroy; - bool has_syncpoints; /* Debugfs knob for forcing syncpt support off in runtime. */ u32 disable_syncpoints; @@ -1758,13 +1757,6 @@ void nvgpu_wait_for_deferred_interrupts(struct gk20a *g); struct gk20a * __must_check gk20a_get(struct gk20a *g); void gk20a_put(struct gk20a *g); -static inline bool gk20a_platform_has_syncpoints(struct gk20a *g) -{ -#ifdef CONFIG_TEGRA_GK20A_NVHOST - return g->has_syncpoints && !g->disable_syncpoints; -#else - return false; -#endif -} +bool nvgpu_has_syncpoints(struct gk20a *g); #endif /* GK20A_H */ -- cgit v1.2.2