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/ce2_gk20a.c | |
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/ce2_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/ce2_gk20a.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c index 109ec240..bfd183fb 100644 --- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c | |||
@@ -126,9 +126,9 @@ static void gk20a_ce_finished_ctx_cb(struct channel_gk20a *ch, void *data) | |||
126 | bool channel_idle; | 126 | bool channel_idle; |
127 | u32 event; | 127 | u32 event; |
128 | 128 | ||
129 | spin_lock(&ch->jobs_lock); | 129 | channel_gk20a_joblist_lock(ch); |
130 | channel_idle = list_empty(&ch->jobs); | 130 | channel_idle = channel_gk20a_joblist_is_empty(ch); |
131 | spin_unlock(&ch->jobs_lock); | 131 | channel_gk20a_joblist_unlock(ch); |
132 | 132 | ||
133 | if (!channel_idle) | 133 | if (!channel_idle) |
134 | return; | 134 | return; |
@@ -462,7 +462,7 @@ u32 gk20a_ce_create_context_with_cb(struct device *dev, | |||
462 | 462 | ||
463 | /* allocate gpfifo (1024 should be more than enough) */ | 463 | /* allocate gpfifo (1024 should be more than enough) */ |
464 | err = gk20a_alloc_channel_gpfifo(ce_ctx->ch, | 464 | err = gk20a_alloc_channel_gpfifo(ce_ctx->ch, |
465 | &(struct nvgpu_alloc_gpfifo_args){1024, 0}); | 465 | &(struct nvgpu_alloc_gpfifo_ex_args){1024, 0, 0, {}}); |
466 | if (err) { | 466 | if (err) { |
467 | gk20a_err(ce_ctx->dev, "ce: unable to allocate gpfifo"); | 467 | gk20a_err(ce_ctx->dev, "ce: unable to allocate gpfifo"); |
468 | goto end; | 468 | goto end; |