summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorOmer Shpigelman <oshpigelman@habana.ai>2019-12-16 08:42:14 +0000
committerOded Gabbay <oded.gabbay@gmail.com>2020-03-24 10:54:16 +0200
commit240c92fd04b272282399b047c20209ba6de4eac8 (patch)
tree02fbfe8c7fc707af8b330a077958081e0ac6388b /drivers
parent7fc40bcaa63127d274e926dc1e9d62a72a01b1b5 (diff)
habanalabs: use the user CB size as a default job size
When no patched command buffer (CB) is created, use the user CB size as the job size. Signed-off-by: Omer Shpigelman <oshpigelman@habana.ai> Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/habanalabs/command_submission.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/misc/habanalabs/command_submission.c b/drivers/misc/habanalabs/command_submission.c
index 0bf08678431b..7cb6910378bf 100644
--- a/drivers/misc/habanalabs/command_submission.c
+++ b/drivers/misc/habanalabs/command_submission.c
@@ -129,6 +129,8 @@ static int cs_parser(struct hl_fpriv *hpriv, struct hl_cs_job *job)
spin_unlock(&job->user_cb->lock);
hl_cb_put(job->user_cb);
job->user_cb = NULL;
+ } else if (!rc) {
+ job->job_cb_size = job->user_cb_size;
}
return rc;
@@ -585,10 +587,6 @@ static int _hl_cs_ioctl(struct hl_fpriv *hpriv, void __user *chunks,
job->cs = cs;
job->user_cb = cb;
job->user_cb_size = chunk->cb_size;
- if (is_kernel_allocated_cb)
- job->job_cb_size = cb->size;
- else
- job->job_cb_size = chunk->cb_size;
job->hw_queue_id = chunk->queue_index;
cs->jobs_in_queue_cnt[job->hw_queue_id]++;