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>
This commit is contained in:
Debarshi Dutta
2018-04-23 17:26:51 +05:30
committed by mobile promotions
parent 4dfd6e43cf
commit 70e69e2686
7 changed files with 213 additions and 103 deletions

View File

@@ -55,15 +55,15 @@ void nvgpu_os_fence_android_drop_ref(struct nvgpu_os_fence *s)
int nvgpu_os_fence_fdget(struct nvgpu_os_fence *fence_out,
struct channel_gk20a *c, int fd)
{
int err;
int err = -ENOSYS;
err = nvgpu_os_fence_sema_fdget(fence_out, c, fd);
#ifdef CONFIG_TEGRA_GK20A_NVHOST
err = nvgpu_os_fence_syncpt_fdget(fence_out, c, fd);
#endif
if (err)
err = nvgpu_os_fence_sema_fdget(fence_out, c, fd);
/* TO-DO
* check if fence is empty and if CONFIG_TEGRA_GK20A_NVHOST
* is enabled, try to get a sync_fence using
* corresponding nvhost method.
*/
if (err)
nvgpu_err(c->g, "error obtaining fence from fd %d", fd);