From 7680fd689ecf7d11bf2dfdba41dc2f33cde2bbe7 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Tue, 16 May 2017 13:47:58 +0300 Subject: gpu: nvgpu: hold power ref for deterministic channels To support deterministic channels even with platforms where railgating is supported, have each deterministic-marked channel hold a power reference during their lifetime, and skip taking power refs for jobs in submit path for those. Previously, railgating blocked deterministic submits in general because of gk20a_busy()/gk20a_idle() calls in submit path possibly taking time and more significantly because the gpu may need turning on which takes a nondeterministic and long amount of time. As an exception, gk20a_do_idle() can still block deterministic submits until gk20a_do_unidle() is called. Add a rwsem to guard this. VPR resize needs do_idle, which conflicts with deterministic channels' requirement to keep the GPU on. This is documented in the ioctl header now. Make NVGPU_GPU_FLAGS_SUPPORT_DETERMINISTIC_SUBMIT_NO_JOBTRACKING always set in the gpu characteristics now that it's supported. The only thing left now blocking NVGPU_GPU_FLAGS_SUPPORT_DETERMINISTIC_SUBMIT_FULL is the sync framework. Make the channel debug dump show which channels are deterministic. Bug 200291300 Jira NVGPU-70 Change-Id: I47b6f3a8517cd6e4255f6ca2855e3dd912e4f5f3 Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/1483038 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 8624d601..13635706 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -456,22 +456,19 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) gpu->flags |= NVGPU_GPU_FLAGS_HAS_SYNCPOINTS; /* - * Railgating needs job tracking which prevents fast submits. They're - * supported otherwise, provided that the user doesn't request anything - * that depends on job tracking. (Here, fast means strictly no + * Fast submits are supported as long as the user doesn't request + * anything that depends on job tracking. (Here, fast means strictly no * metadata, just the gpfifo contents are copied and gp_put updated). */ - if (!g->can_railgate) - gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_DETERMINISTIC_SUBMIT_NO_JOBTRACKING; + gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_DETERMINISTIC_SUBMIT_NO_JOBTRACKING; /* - * Railgating and sync framework require deferred job cleanup which - * prevents deterministic submits. They're supported otherwise, - * provided that the user doesn't request anything that depends on - * deferred cleanup. + * Sync framework requires deferred job cleanup, wrapping syncs in FDs, + * and other heavy stuff, which prevents deterministic submits. This is + * supported otherwise, provided that the user doesn't request anything + * that depends on deferred cleanup. */ - if (!g->can_railgate - && !gk20a_channel_sync_needs_sync_framework(g)) + if (!gk20a_channel_sync_needs_sync_framework(g)) gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_DETERMINISTIC_SUBMIT_FULL; gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_USERSPACE_MANAGED_AS; -- cgit v1.2.2