From d1d1f56c499fcea75b17e2acb4f0d5d1611203f4 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Tue, 8 Jan 2019 16:53:54 +0200 Subject: [PATCH] gpu: nvgpu: skip nvgpu syncpoint in usermode submits The nvgpu managed syncpoint is not needed for anything if a channel uses usermode submits; in that case the channel would allocate an user-managed syncpoint and use that. Create the channel sync in nvgpu_channel_setup_bind() only if usermode submit is not enabled. Bug 200466905 Change-Id: I976f4b4fd0c3131cb310c72b286329fb16f1f29a Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1990270 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/fifo/channel.c | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index cea931c8b..b0fd35a8c 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c @@ -1245,22 +1245,22 @@ int nvgpu_channel_setup_bind(struct channel_gk20a *c, if (!c->usermode_submit_enabled) { g->ops.fifo.setup_userd(c); - } - if (g->aggressive_sync_destroy_thresh == 0U) { - nvgpu_mutex_acquire(&c->sync_lock); - c->sync = nvgpu_channel_sync_create(c, false); - if (c->sync == NULL) { - err = -ENOMEM; + if (g->aggressive_sync_destroy_thresh == 0U) { + nvgpu_mutex_acquire(&c->sync_lock); + c->sync = nvgpu_channel_sync_create(c, false); + if (c->sync == NULL) { + err = -ENOMEM; + nvgpu_mutex_release(&c->sync_lock); + goto clean_up_unmap; + } nvgpu_mutex_release(&c->sync_lock); - goto clean_up_unmap; - } - nvgpu_mutex_release(&c->sync_lock); - if (g->ops.fifo.resetup_ramfc != NULL) { - err = g->ops.fifo.resetup_ramfc(c); - if (err != 0) { - goto clean_up_sync; + if (g->ops.fifo.resetup_ramfc != NULL) { + err = g->ops.fifo.resetup_ramfc(c); + if (err != 0) { + goto clean_up_sync; + } } } }