From 8bdce5337ee5f4d1e1f6d4c7b2dc0abe4a532893 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Mon, 6 Nov 2017 14:25:47 +0200 Subject: gpu: nvgpu: support tuning per-ch deterministic opts Add a new ioctl NVGPU_GPU_IOCTL_SET_DETERMINISTIC_OPTS to adjust deterministic options on a per-channel basis. Currently, the only supported option is to relax the no-railgating requirement on open deterministic channels. This also disallows submits on such channels, until the railgate option is reset. Bug 200327089 Change-Id: If4f0f51fd1d40ad7407d13638150d7402479aff0 Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1554563 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 5 ++++- drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 2 ++ drivers/gpu/nvgpu/gk20a/gk20a.c | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 805902eb..6c607ae2 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -578,7 +578,10 @@ unbind: if (ch->deterministic) { nvgpu_rwsem_down_read(&g->deterministic_busy); ch->deterministic = false; - gk20a_idle(g); + if (!ch->deterministic_railgate_allowed) + gk20a_idle(g); + ch->deterministic_railgate_allowed = false; + nvgpu_rwsem_up_read(&g->deterministic_busy); } diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h index 762daea9..0cb60200 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h @@ -208,6 +208,8 @@ struct channel_gk20a { bool first_init; bool vpr; bool deterministic; + /* deterministic, but explicitly idle and submits disallowed */ + bool deterministic_railgate_allowed; bool cde; pid_t pid; pid_t tgid; diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index e8db9d2c..756db415 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -439,6 +439,8 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) NVGPU_SUPPORT_DETERMINISTIC_SUBMIT_FULL, true); + __nvgpu_set_enabled(g, NVGPU_SUPPORT_DETERMINISTIC_OPTS, true); + __nvgpu_set_enabled(g, NVGPU_SUPPORT_USERSPACE_MANAGED_AS, true); __nvgpu_set_enabled(g, NVGPU_SUPPORT_TSG, true); -- cgit v1.2.2