From 0301cc01f6cbfb752290bc63a2ed4eb19129c7c1 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Mon, 23 Apr 2018 04:18:33 -0700 Subject: gpu: nvgpu: add HAL to insert semaphore commands Add below new HALs gops.fifo.add_sema_cmd() to insert HOST semaphore acquire/release methods gops.fifo.get_sema_wait_cmd_size() to get size of acquire command buffer gops.fifo.get_sema_incr_cmd_size() to get size of release command buffer Separate out new API gk20a_fifo_add_sema_cmd() to implement semaphore acquire/ release sequence and set it to gops.fifo.add_sema_cmd() Add gk20a_fifo_get_sema_wait_cmd_size() and gk20a_fifo_get_sema_incr_cmd_size() to return respective command buffer sizes Jira NVGPUT-16 Change-Id: Ia81a50921a6a56ebc237f2f90b137268aaa2d749 Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/1704490 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c') diff --git a/drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c b/drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c index 2bb71c99..25832417 100644 --- a/drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c +++ b/drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c @@ -34,12 +34,14 @@ int nvgpu_os_fence_sema_wait_gen_cmd(struct nvgpu_os_fence *s, int max_wait_cmds) { int err; - const int wait_cmd_size = 8; + int wait_cmd_size; int num_wait_cmds; int i; struct nvgpu_semaphore *sema; struct sync_fence *sync_fence = nvgpu_get_sync_fence(s); + wait_cmd_size = c->g->ops.fifo.get_sema_wait_cmd_size(); + num_wait_cmds = sync_fence->num_fences; if (num_wait_cmds == 0) return 0; -- cgit v1.2.2