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

@@ -800,9 +800,6 @@ struct gk20a {
unsigned int aggressive_sync_destroy_thresh;
bool aggressive_sync_destroy;
/** Debugfs knob for forcing syncpt support off in runtime. */
bool disable_syncpoints;
/** Is LS PMU supported? */
bool support_ls_pmu;
@@ -1086,8 +1083,6 @@ int gk20a_do_unidle_impl(struct gk20a *g);
/** tu104 HW version */
#define NVGPU_GPUID_TU104 0x00000164U
bool nvgpu_has_syncpoints(struct gk20a *g);
/**
* @}
*/

View File

@@ -23,12 +23,13 @@
#ifndef NVGPU_NVHOST_H
#define NVGPU_NVHOST_H
#ifdef CONFIG_TEGRA_GK20A_NVHOST
#include <nvgpu/types.h>
struct nvgpu_nvhost_dev;
struct gk20a;
#ifdef CONFIG_TEGRA_GK20A_NVHOST
struct nvgpu_nvhost_dev;
struct sync_pt;
struct sync_fence;
struct timespec;
@@ -71,6 +72,15 @@ int nvgpu_get_nvhost_dev(struct gk20a *g);
*/
void nvgpu_free_nvhost_dev(struct gk20a *g);
/**
* @brief Check if the gpu has access to syncpoints.
*
* @param g [in] The GPU super structure.
*
* @return whether syncpt access is available
*/
bool nvgpu_has_syncpoints(struct gk20a *g);
#ifdef CONFIG_NVGPU_KERNEL_MODE_SUBMIT
/**
* Available waiter index is used for sync point wait path.
@@ -289,6 +299,19 @@ static inline int nvgpu_nvhost_syncpt_init(struct gk20a *g)
{
return 0;
}
#endif
#endif /* CONFIG_TEGRA_T19X_GRHOST */
#else /* CONFIG_TEGRA_GK20A_NVHOST */
/**
* @brief Check if the gpu has access to syncpoints.
*
* @param g [in] The GPU super structure.
*
* @return whether syncpt access is available
*/
static inline bool nvgpu_has_syncpoints(struct gk20a *g)
{
return false;
}
#endif /* CONFIG_TEGRA_GK20A_NVHOST */
#endif /* NVGPU_NVHOST_H */

View File

@@ -37,9 +37,11 @@ struct nvgpu_nvhost_dev {
u32 syncpt_value;
};
int nvgpu_get_nvhost_dev(struct gk20a *g);
void nvgpu_free_nvhost_dev(struct gk20a *g);
int nvgpu_get_nvhost_dev(struct gk20a *g);
bool nvgpu_has_syncpoints(struct gk20a *g);
int nvgpu_nvhost_get_syncpt_aperture(
struct nvgpu_nvhost_dev *nvgpu_syncpt_dev,