summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/channel.c
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2018-03-22 07:19:34 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-03-23 20:18:15 -0400
commitbac51e8081a2ae778bfdccc1c57ee3ef382de077 (patch)
tree47fcde5793bd51ed858aa1dcfb3e9f8d082fbe8f /drivers/gpu/nvgpu/common/linux/channel.c
parent90925a739ab80a93c6a325c12a61752c24339089 (diff)
gpu: nvgpu: allow syncfds as prefences on deterministic
Accept submits on deterministic channels even when the prefence is a syncfd, but only if it has just one fence inside. Because NVGPU_SUBMIT_GPFIFO_FLAGS_SYNC_FENCE is shared between pre- and postfences, a postfence (SUBMIT_GPFIFO_FLAGS_FENCE_GET) is not allowed at the same time though. The sync framework is problematic for deterministic channels due to certain allocations that are not controlled by nvgpu. However, that only applies for postfences, yet we've disallowed FLAGS_SYNC_FENCE for deterministic channels even when a postfence is not needed. Bug 200390539 Change-Id: I099bbadc11cc2f093fb2c585f3bd909143238d57 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1680271 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/channel.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/channel.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/channel.c b/drivers/gpu/nvgpu/common/linux/channel.c
index 1d4afcc8..07bb393e 100644
--- a/drivers/gpu/nvgpu/common/linux/channel.c
+++ b/drivers/gpu/nvgpu/common/linux/channel.c
@@ -469,6 +469,8 @@ static int gk20a_submit_prepare_syncs(struct channel_gk20a *c,
469 * this condition. 469 * this condition.
470 */ 470 */
471 if (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_WAIT) { 471 if (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_WAIT) {
472 int max_wait_cmds = c->deterministic ? 1 : 0;
473
472 if (!pre_alloc_enabled) 474 if (!pre_alloc_enabled)
473 job->wait_cmd = nvgpu_kzalloc(g, 475 job->wait_cmd = nvgpu_kzalloc(g,
474 sizeof(struct priv_cmd_entry)); 476 sizeof(struct priv_cmd_entry));
@@ -481,7 +483,7 @@ static int gk20a_submit_prepare_syncs(struct channel_gk20a *c,
481 if (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_SYNC_FENCE) { 483 if (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_SYNC_FENCE) {
482 wait_fence_fd = fence->id; 484 wait_fence_fd = fence->id;
483 err = c->sync->wait_fd(c->sync, wait_fence_fd, 485 err = c->sync->wait_fd(c->sync, wait_fence_fd,
484 job->wait_cmd); 486 job->wait_cmd, max_wait_cmds);
485 } else { 487 } else {
486 err = c->sync->wait_syncpt(c->sync, fence->id, 488 err = c->sync->wait_syncpt(c->sync, fence->id,
487 fence->value, 489 fence->value,
@@ -758,8 +760,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
758 need_sync_framework = force_need_sync_fence || 760 need_sync_framework = force_need_sync_fence ||
759 gk20a_channel_sync_needs_sync_framework(g) || 761 gk20a_channel_sync_needs_sync_framework(g) ||
760 (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_SYNC_FENCE && 762 (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_SYNC_FENCE &&
761 (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_WAIT || 763 flags & NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_GET);
762 flags & NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_GET));
763 764
764 /* 765 /*
765 * Deferred clean-up is necessary for any of the following 766 * Deferred clean-up is necessary for any of the following