gpu: nvgpu: move nvgpu_has_syncpoints

nvgpu_has_syncpoints is more general than a channel synchronization
related, so move it to nvhost.c from channel_sync.c. Move the
declaration from gk20a.h to nvhost.h.

As the debugfs knob is Linux related, move it from struct gk20a to
struct nvgpu_os_linux.

Jira NVGPU-4548

Change-Id: I4236086744993c3daac042f164de30939c01ee77
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2318814
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Konsta Hölttä
2020-03-26 12:07:41 +02:00
committed by Alex Waterman
parent db9c1b1f97
commit d0ffb335dc
13 changed files with 53 additions and 30 deletions

View File

@@ -363,7 +363,7 @@ void gk20a_debug_init(struct gk20a *g, const char *debugfs_symlink)
l->debugfs, &g->ch_wdt_init_limit_ms);
debugfs_create_bool("disable_syncpoints", S_IRUGO,
l->debugfs, &g->disable_syncpoints);
l->debugfs, &l->disable_syncpoints);
/* New debug logging API. */
debugfs_create_u64("log_mask", S_IRUGO|S_IWUSR,

View File

@@ -26,6 +26,7 @@
#include <nvgpu/gk20a.h>
#include <nvgpu/nvgpu_init.h>
#include <nvgpu/channel.h>
#include <nvgpu/nvhost.h>
#include <nvgpu/linux/vm.h>

View File

@@ -67,6 +67,14 @@ void nvgpu_free_nvhost_dev(struct gk20a *g)
nvgpu_kfree(g, g->nvhost);
}
bool nvgpu_has_syncpoints(struct gk20a *g)
{
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
return nvgpu_is_enabled(g, NVGPU_HAS_SYNCPOINTS) &&
!l->disable_syncpoints;
}
int nvgpu_nvhost_module_busy_ext(
struct nvgpu_nvhost_dev *nvhost_dev)
{

View File

@@ -175,6 +175,9 @@ struct nvgpu_os_linux {
struct rw_semaphore busy_lock;
bool init_done;
/** Debugfs knob for forcing syncpt support off in runtime. */
bool disable_syncpoints;
};
static inline struct nvgpu_os_linux *nvgpu_os_linux_from_gk20a(struct gk20a *g)