From 6e3f9112eaf351276b10391f020d203d87314172 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 6 Dec 2017 14:22:52 -0800 Subject: gpu: nvgpu: Disallow use of bare channels All channels need to now be wrapped in TSGs. Disallow use of bare channels by preventing creation of GPFIFO for them. Bug 1842197 Change-Id: Id0ebee4c590804b96c09f8951e35ba2680b596e7 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1612697 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index e10be3c9..ee78d0b1 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -1134,6 +1134,12 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, gpfifo_size = num_entries; gpfifo_entry_size = nvgpu_get_gpfifo_entry_size(); + if (!(flags & NVGPU_GPFIFO_FLAGS_ALLOW_BARE_CHANNEL) && + !gk20a_is_channel_marked_as_tsg(c)) { + nvgpu_err(g, "channel not part of a TSG"); + return -EINVAL; + } + if (flags & NVGPU_GPFIFO_FLAGS_SUPPORT_VPR) c->vpr = true; -- cgit v1.2.2