From 4f40637c580c5f25f34f45c2c16b5332104897bc Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Tue, 24 Apr 2018 10:38:30 +0530 Subject: gpu: nvgpu: remove sync_fence dependencies from fence_gk20a Replaced all instances of sync_fence in gk20a_fence* code with nvgpu_os_fence. Added the API install_fence for the nvgpu_os_fence abstraction. sync_fence mechanism and its dependencies are completely removed from the fence_gk20a methods. Due to the recent os_fence changes and the changes to fence_gk20a, we can finally get rid of all the CONFIG_SYNCS present in the submit path. JIRA NVGPU-66 Change-Id: I3551dab04b93b1e94db83fc102a41872be89e9ed Signed-off-by: Debarshi Dutta Reviewed-on: https://git-master.nvidia.com/r/1701245 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/fence_gk20a.c | 36 +++++++++++------------------------ 1 file changed, 11 insertions(+), 25 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/fence_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c index f0ad773f..0f7f3ea1 100644 --- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c @@ -22,25 +22,17 @@ #include "fence_gk20a.h" -#ifdef CONFIG_SYNC -#include -#include -#endif - #include #include #include #include #include +#include #include "gk20a.h" #include "channel_gk20a.h" #include "sync_gk20a.h" -#ifdef CONFIG_SYNC -#include "../drivers/staging/android/sync.h" -#endif - struct gk20a_fence_ops { int (*wait)(struct gk20a_fence *, long timeout); bool (*is_expired)(struct gk20a_fence *); @@ -53,10 +45,8 @@ static void gk20a_fence_free(struct nvgpu_ref *ref) container_of(ref, struct gk20a_fence, ref); struct gk20a *g = f->g; -#ifdef CONFIG_SYNC - if (f->os_fence) - sync_fence_put(f->os_fence); -#endif + if (nvgpu_os_fence_is_initialized(&f->os_fence)) + f->os_fence.ops->drop_ref(&f->os_fence); if (f->semaphore) nvgpu_semaphore_put(f->semaphore); @@ -91,17 +81,13 @@ inline bool gk20a_fence_is_valid(struct gk20a_fence *f) int gk20a_fence_install_fd(struct gk20a_fence *f, int fd) { -#ifdef CONFIG_SYNC - if (!f || !gk20a_fence_is_valid(f) || !f->os_fence) - return -EINVAL; + if (!f || !gk20a_fence_is_valid(f) || + !nvgpu_os_fence_is_initialized(&f->os_fence)) + return -EINVAL; - sync_fence_get(f->os_fence); - sync_fence_install(f->os_fence, fd); + f->os_fence.ops->install_fence(&f->os_fence, fd); return 0; -#else - return -ENODEV; -#endif } int gk20a_fence_wait(struct gk20a *g, struct gk20a_fence *f, @@ -191,7 +177,7 @@ struct gk20a_fence *gk20a_alloc_fence(struct channel_gk20a *c) void gk20a_init_fence(struct gk20a_fence *f, const struct gk20a_fence_ops *ops, - struct sync_fence *os_fence) + struct nvgpu_os_fence os_fence) { if (!f) return; @@ -229,7 +215,7 @@ int gk20a_fence_from_semaphore( struct gk20a_fence *fence_out, struct nvgpu_semaphore *semaphore, struct nvgpu_cond *semaphore_wq, - struct sync_fence *os_fence) + struct nvgpu_os_fence os_fence) { struct gk20a_fence *f = fence_out; @@ -290,7 +276,7 @@ static const struct gk20a_fence_ops gk20a_syncpt_fence_ops = { int gk20a_fence_from_syncpt( struct gk20a_fence *fence_out, struct nvgpu_nvhost_dev *nvhost_dev, - u32 id, u32 value, struct sync_fence *os_fence) + u32 id, u32 value, struct nvgpu_os_fence os_fence) { struct gk20a_fence *f = fence_out; @@ -312,7 +298,7 @@ int gk20a_fence_from_syncpt( int gk20a_fence_from_syncpt( struct gk20a_fence *fence_out, struct nvgpu_nvhost_dev *nvhost_dev, - u32 id, u32 value, struct sync_fence *os_fence) + u32 id, u32 value, struct nvgpu_os_fence os_fence) { return -EINVAL; } -- cgit v1.2.2