From 96f2d4320adb866e1f9813309e6c61d761eecc8d Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Thu, 27 Sep 2018 10:11:53 -0700 Subject: gpu: nvgpu: Use deterministic flag to decide pre-alloc Instead of using num_inflight_jobs to determine whether to pre-alloc resources for a channel use the c->deterministic flag and the number of inflight jobs field. Non-determinsitic channels do not require pre-alloced resources and deterministic channels with 0 in flight jobs (i.e no kernel job tracking, AKA fast path sumits) also do not require pre-alloced resources. Bug 2327792 Change-Id: I7e8eb0478c22e005ca2c46c555415afa0ded0be1 Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1850123 (cherry picked from commit 05ec7b80ebeabbc27d369ebd88dfe511c30d1bad) Reviewed-on: https://git-master.nvidia.com/r/1949219 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Tested-by: James Norton Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/fifo/channel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index 680382a4..2097a28e 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c @@ -1222,7 +1222,7 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, /* TBD: setup engine contexts */ - if (gpfifo_args->num_inflight_jobs) { + if (c->deterministic && gpfifo_args->num_inflight_jobs != 0U) { err = channel_gk20a_prealloc_resources(c, gpfifo_args->num_inflight_jobs); if (err) { @@ -1248,7 +1248,7 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, clean_up_priv_cmd: channel_gk20a_free_priv_cmdbuf(c); clean_up_prealloc: - if (gpfifo_args->num_inflight_jobs) { + if (c->deterministic && gpfifo_args->num_inflight_jobs != 0U) { channel_gk20a_free_prealloc_resources(c); } clean_up_sync: -- cgit v1.2.2