diff options
author | Debarshi Dutta <ddutta@nvidia.com> | 2018-04-23 07:56:51 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-05-10 11:40:11 -0400 |
commit | 70e69e2686527990865b221a60e0ec1e9a53d316 (patch) | |
tree | 623d0c2612162227370f7b6eb5388fc5b0e11326 /drivers/gpu/nvgpu/include | |
parent | 4dfd6e43cfe303c8b23421ef32738db2ee52e291 (diff) |
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 <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1676631
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/linux/os_fence_android.h | 6 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/os_fence.h | 19 |
2 files changed, 24 insertions, 1 deletions
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, | |||
39 | struct gk20a *g, const struct nvgpu_os_fence_ops *fops, | 39 | struct gk20a *g, const struct nvgpu_os_fence_ops *fops, |
40 | struct sync_fence *fence); | 40 | struct sync_fence *fence); |
41 | 41 | ||
42 | #endif \ No newline at end of file | 42 | int nvgpu_os_fence_syncpt_fdget( |
43 | struct nvgpu_os_fence *fence_out, | ||
44 | struct channel_gk20a *c, int fd); | ||
45 | |||
46 | #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 @@ | |||
28 | struct nvgpu_semaphore; | 28 | struct nvgpu_semaphore; |
29 | struct channel_gk20a; | 29 | struct channel_gk20a; |
30 | struct priv_cmd_entry; | 30 | struct priv_cmd_entry; |
31 | struct nvgpu_nvhost_dev; | ||
31 | 32 | ||
32 | /* | 33 | /* |
33 | * struct nvgpu_os_fence adds an abstraction to the earlier Android Sync | 34 | * struct nvgpu_os_fence adds an abstraction to the earlier Android Sync |
@@ -108,4 +109,22 @@ static inline int nvgpu_os_fence_fdget( | |||
108 | 109 | ||
109 | #endif /* CONFIG_SYNC */ | 110 | #endif /* CONFIG_SYNC */ |
110 | 111 | ||
112 | #if defined(CONFIG_TEGRA_GK20A_NVHOST) && defined(CONFIG_SYNC) | ||
113 | |||
114 | int nvgpu_os_fence_syncpt_create(struct nvgpu_os_fence *fence_out, | ||
115 | struct channel_gk20a *c, struct nvgpu_nvhost_dev *nvhost_dev, | ||
116 | u32 id, u32 thresh); | ||
117 | |||
118 | #else | ||
119 | |||
120 | static inline int nvgpu_os_fence_syncpt_create( | ||
121 | struct nvgpu_os_fence *fence_out, struct channel_gk20a *c, | ||
122 | struct nvgpu_nvhost_dev *nvhost_dev, | ||
123 | u32 id, u32 thresh) | ||
124 | { | ||
125 | return -ENOSYS; | ||
126 | } | ||
127 | |||
128 | #endif /* CONFIG_TEGRA_GK20A_NVHOST && CONFIG_SYNC */ | ||
129 | |||
111 | #endif /* __NVGPU_OS_FENCE__ */ | 130 | #endif /* __NVGPU_OS_FENCE__ */ |