diff options
author | Gagan Grover <ggrover@nvidia.com> | 2015-03-30 11:43:12 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-04-04 22:02:56 -0400 |
commit | 29ceb36331b21940afd210c594fd07e6c7337793 (patch) | |
tree | aac7555c2446dead52ec1f874fa258d13b5a74e0 /drivers/gpu/nvgpu/gk20a | |
parent | 0a99cb3559f8769a1165d825d33c4a5fba2fcfe0 (diff) |
gpu: nvgpu: Fix the GPFIFO submit condition
GPFIFO HW with fifo size N can actually accept
N-1 entries. Also, kernel can insert two extra
entries, before and after the user GPFIFOs.
So, GPFIFO with N size can accept max N-3 user
gpfifos.
Bug 1613125
Change-Id: I173526afb70dddf1b2b9ec0a99890335c81f0e02
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/725380
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 7fa8a552..328f49b1 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -1460,8 +1460,11 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
1460 | if (c->has_timedout) | 1460 | if (c->has_timedout) |
1461 | return -ETIMEDOUT; | 1461 | return -ETIMEDOUT; |
1462 | 1462 | ||
1463 | /* fifo not large enough for request. Return error immediately */ | 1463 | /* fifo not large enough for request. Return error immediately. |
1464 | if (c->gpfifo.entry_num < num_entries) { | 1464 | * Kernel can insert gpfifo entries before and after user gpfifos. |
1465 | * So, add extra_entries in user request. Also, HW with fifo size N | ||
1466 | * can accept only N-1 entreis and so the below condition */ | ||
1467 | if (c->gpfifo.entry_num - 1 < num_entries + extra_entries) { | ||
1465 | gk20a_err(d, "not enough gpfifo space allocated"); | 1468 | gk20a_err(d, "not enough gpfifo space allocated"); |
1466 | return -ENOMEM; | 1469 | return -ENOMEM; |
1467 | } | 1470 | } |