summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2018-04-23 07:18:33 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-05-16 06:10:37 -0400
commit0301cc01f6cbfb752290bc63a2ed4eb19129c7c1 (patch)
treefafe6562b8251c88f130f6368b9a41eb622669b9 /drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c
parent4ff87c7d35f34e01e138cbedb143a37ff32a8926 (diff)
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 <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1704490 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c4
1 files changed, 3 insertions, 1 deletions
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,
34 int max_wait_cmds) 34 int max_wait_cmds)
35{ 35{
36 int err; 36 int err;
37 const int wait_cmd_size = 8; 37 int wait_cmd_size;
38 int num_wait_cmds; 38 int num_wait_cmds;
39 int i; 39 int i;
40 struct nvgpu_semaphore *sema; 40 struct nvgpu_semaphore *sema;
41 struct sync_fence *sync_fence = nvgpu_get_sync_fence(s); 41 struct sync_fence *sync_fence = nvgpu_get_sync_fence(s);
42 42
43 wait_cmd_size = c->g->ops.fifo.get_sema_wait_cmd_size();
44
43 num_wait_cmds = sync_fence->num_fences; 45 num_wait_cmds = sync_fence->num_fences;
44 if (num_wait_cmds == 0) 46 if (num_wait_cmds == 0)
45 return 0; 47 return 0;