diff options
author | Sachit Kadle <skadle@nvidia.com> | 2016-08-15 17:32:39 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-10-20 11:14:11 -0400 |
commit | 733fb79b39869665addcd80ccdf1c15f4a5aaa29 (patch) | |
tree | b3c9c1ba32406ed9c2af4bebee820e83ea6172e4 /drivers/gpu/nvgpu/gk20a/fence_gk20a.h | |
parent | 63e8592e06939e20c7b9e56b430353ebbee31ad6 (diff) |
gpu: nvgpu: add support for pre-allocated resources
Add support for pre-allocation of job tracking resources
w/ new (extended) ioctl. Goal is to avoid dynamic memory
allocation in the submit path. This patch does the following:
1) Intoduces a new ioctl, NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX,
which enables pre-allocation of tracking resources per job:
a) 2x priv_cmd_entry
b) 2x gk20a_fence
2) Implements circular ring buffer for job
tracking to avoid lock contention between producer
(submitter) and consumer (clean-up)
Bug 1795076
Change-Id: I6b52e5c575871107ff380f9a5790f440a6969347
Signed-off-by: Sachit Kadle <skadle@nvidia.com>
Reviewed-on: http://git-master/r/1203300
(cherry picked from commit 9fd270c22b860935dffe244753dabd87454bef39)
Reviewed-on: http://git-master/r/1223934
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fence_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fence_gk20a.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.h b/drivers/gpu/nvgpu/gk20a/fence_gk20a.h index 3fe2d8b2..97a7d957 100644 --- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * GK20A Fences | 4 | * GK20A Fences |
5 | * | 5 | * |
6 | * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. | 6 | * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify it | 8 | * This program is free software; you can redistribute it and/or modify it |
9 | * under the terms and conditions of the GNU General Public License, | 9 | * under the terms and conditions of the GNU General Public License, |
@@ -45,6 +45,9 @@ struct gk20a_fence { | |||
45 | struct platform_device *host1x_pdev; | 45 | struct platform_device *host1x_pdev; |
46 | u32 syncpt_id; | 46 | u32 syncpt_id; |
47 | u32 syncpt_value; | 47 | u32 syncpt_value; |
48 | |||
49 | /* Valid for fences part of a pre-allocated fence pool */ | ||
50 | struct gk20a_allocator *allocator; | ||
48 | }; | 51 | }; |
49 | 52 | ||
50 | /* Fences can be created from semaphores or syncpoint (id, value) pairs */ | 53 | /* Fences can be created from semaphores or syncpoint (id, value) pairs */ |
@@ -62,7 +65,15 @@ int gk20a_fence_from_syncpt( | |||
62 | u32 id, u32 value, bool wfi, | 65 | u32 id, u32 value, bool wfi, |
63 | bool need_sync_fence); | 66 | bool need_sync_fence); |
64 | 67 | ||
65 | struct gk20a_fence *gk20a_alloc_fence(struct channel_gk20a *c); | 68 | int gk20a_alloc_fence_pool( |
69 | struct channel_gk20a *c, | ||
70 | int size); | ||
71 | |||
72 | void gk20a_free_fence_pool( | ||
73 | struct channel_gk20a *c); | ||
74 | |||
75 | struct gk20a_fence *gk20a_alloc_fence( | ||
76 | struct channel_gk20a *c); | ||
66 | 77 | ||
67 | void gk20a_init_fence(struct gk20a_fence *f, | 78 | void gk20a_init_fence(struct gk20a_fence *f, |
68 | const struct gk20a_fence_ops *ops, | 79 | const struct gk20a_fence_ops *ops, |