From 70e69e2686527990865b221a60e0ec1e9a53d316 Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Mon, 23 Apr 2018 17:26:51 +0530 Subject: gpu: nvgpu: adapt gk20a_channel_syncpt to use os_fence This patch adapts gk20a_channel_syncpt to use os_fence for post fence as well as pre-fence(wait) use cases. Jira NVGPU-66 Change-Id: I49627d1f88d52a53511a02f5de60fed6df8350de Signed-off-by: Debarshi Dutta Reviewed-on: https://git-master.nvidia.com/r/1676631 Reviewed-by: mobile promotions Tested-by: mobile promotions --- .../gpu/nvgpu/include/nvgpu/linux/os_fence_android.h | 6 +++++- drivers/gpu/nvgpu/include/nvgpu/os_fence.h | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/os_fence_android.h b/drivers/gpu/nvgpu/include/nvgpu/linux/os_fence_android.h index 79cc51ea..39d08339 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/linux/os_fence_android.h +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/os_fence_android.h @@ -39,4 +39,8 @@ void nvgpu_os_fence_init(struct nvgpu_os_fence *fence_out, struct gk20a *g, const struct nvgpu_os_fence_ops *fops, struct sync_fence *fence); -#endif \ No newline at end of file +int nvgpu_os_fence_syncpt_fdget( + struct nvgpu_os_fence *fence_out, + struct channel_gk20a *c, int fd); + +#endif /* __NVGPU_OS_FENCE_ANDROID_H__ */ \ No newline at end of file diff --git a/drivers/gpu/nvgpu/include/nvgpu/os_fence.h b/drivers/gpu/nvgpu/include/nvgpu/os_fence.h index c8d24fc2..a22140da 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/os_fence.h +++ b/drivers/gpu/nvgpu/include/nvgpu/os_fence.h @@ -28,6 +28,7 @@ struct nvgpu_semaphore; struct channel_gk20a; struct priv_cmd_entry; +struct nvgpu_nvhost_dev; /* * struct nvgpu_os_fence adds an abstraction to the earlier Android Sync @@ -108,4 +109,22 @@ static inline int nvgpu_os_fence_fdget( #endif /* CONFIG_SYNC */ +#if defined(CONFIG_TEGRA_GK20A_NVHOST) && defined(CONFIG_SYNC) + +int nvgpu_os_fence_syncpt_create(struct nvgpu_os_fence *fence_out, + struct channel_gk20a *c, struct nvgpu_nvhost_dev *nvhost_dev, + u32 id, u32 thresh); + +#else + +static inline int nvgpu_os_fence_syncpt_create( + struct nvgpu_os_fence *fence_out, struct channel_gk20a *c, + struct nvgpu_nvhost_dev *nvhost_dev, + u32 id, u32 thresh) +{ + return -ENOSYS; +} + +#endif /* CONFIG_TEGRA_GK20A_NVHOST && CONFIG_SYNC */ + #endif /* __NVGPU_OS_FENCE__ */ -- cgit v1.2.2