diff options
author | Sourab Gupta <sourabg@nvidia.com> | 2018-03-27 10:09:21 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-04-05 08:22:54 -0400 |
commit | 03b87689025b86b145236a9c707e31a3d3214eb0 (patch) | |
tree | c9f1d756e50c24b69718a04778d88bb53f26ca3b /drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |
parent | 077de38dfbc37ca933e0f3456397a44a49b1202e (diff) |
gpu: nvgpu: pass alloc_gpfifo args to gk20a_channel_alloc_gpfifo
The patch defines 'struct nvgpu_gpfifo_args' to be filled
by alloc_gpfifo(_ex) ioctls and passed to the
gk20a_channel_alloc_gpfifo function. This is required as a
prep towards having the usermode submission support in the
core channel core.
Change-Id: I72acc00cc5558dd3623604da7d716bf849f0152c
Signed-off-by: Sourab Gupta <sourabg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1683391
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 8b9f02df..83c49d52 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -1034,9 +1034,7 @@ static void channel_gk20a_free_prealloc_resources(struct channel_gk20a *c) | |||
1034 | } | 1034 | } |
1035 | 1035 | ||
1036 | int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, | 1036 | int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, |
1037 | unsigned int num_entries, | 1037 | struct nvgpu_gpfifo_args *gpfifo_args) |
1038 | unsigned int num_inflight_jobs, | ||
1039 | u32 flags) | ||
1040 | { | 1038 | { |
1041 | struct gk20a *g = c->g; | 1039 | struct gk20a *g = c->g; |
1042 | struct vm_gk20a *ch_vm; | 1040 | struct vm_gk20a *ch_vm; |
@@ -1044,13 +1042,13 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, | |||
1044 | int err = 0; | 1042 | int err = 0; |
1045 | unsigned long acquire_timeout; | 1043 | unsigned long acquire_timeout; |
1046 | 1044 | ||
1047 | gpfifo_size = num_entries; | 1045 | gpfifo_size = gpfifo_args->num_entries; |
1048 | gpfifo_entry_size = nvgpu_get_gpfifo_entry_size(); | 1046 | gpfifo_entry_size = nvgpu_get_gpfifo_entry_size(); |
1049 | 1047 | ||
1050 | if (flags & NVGPU_GPFIFO_FLAGS_SUPPORT_VPR) | 1048 | if (gpfifo_args->flags & NVGPU_GPFIFO_FLAGS_SUPPORT_VPR) |
1051 | c->vpr = true; | 1049 | c->vpr = true; |
1052 | 1050 | ||
1053 | if (flags & NVGPU_GPFIFO_FLAGS_SUPPORT_DETERMINISTIC) { | 1051 | if (gpfifo_args->flags & NVGPU_GPFIFO_FLAGS_SUPPORT_DETERMINISTIC) { |
1054 | nvgpu_rwsem_down_read(&g->deterministic_busy); | 1052 | nvgpu_rwsem_down_read(&g->deterministic_busy); |
1055 | /* | 1053 | /* |
1056 | * Railgating isn't deterministic; instead of disallowing | 1054 | * Railgating isn't deterministic; instead of disallowing |
@@ -1137,15 +1135,15 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, | |||
1137 | 1135 | ||
1138 | err = g->ops.fifo.setup_ramfc(c, c->gpfifo.mem.gpu_va, | 1136 | err = g->ops.fifo.setup_ramfc(c, c->gpfifo.mem.gpu_va, |
1139 | c->gpfifo.entry_num, | 1137 | c->gpfifo.entry_num, |
1140 | acquire_timeout, flags); | 1138 | acquire_timeout, gpfifo_args->flags); |
1141 | if (err) | 1139 | if (err) |
1142 | goto clean_up_sync; | 1140 | goto clean_up_sync; |
1143 | 1141 | ||
1144 | /* TBD: setup engine contexts */ | 1142 | /* TBD: setup engine contexts */ |
1145 | 1143 | ||
1146 | if (num_inflight_jobs) { | 1144 | if (gpfifo_args->num_inflight_jobs) { |
1147 | err = channel_gk20a_prealloc_resources(c, | 1145 | err = channel_gk20a_prealloc_resources(c, |
1148 | num_inflight_jobs); | 1146 | gpfifo_args->num_inflight_jobs); |
1149 | if (err) | 1147 | if (err) |
1150 | goto clean_up_sync; | 1148 | goto clean_up_sync; |
1151 | } | 1149 | } |
@@ -1166,7 +1164,7 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, | |||
1166 | clean_up_priv_cmd: | 1164 | clean_up_priv_cmd: |
1167 | channel_gk20a_free_priv_cmdbuf(c); | 1165 | channel_gk20a_free_priv_cmdbuf(c); |
1168 | clean_up_prealloc: | 1166 | clean_up_prealloc: |
1169 | if (num_inflight_jobs) | 1167 | if (gpfifo_args->num_inflight_jobs) |
1170 | channel_gk20a_free_prealloc_resources(c); | 1168 | channel_gk20a_free_prealloc_resources(c); |
1171 | clean_up_sync: | 1169 | clean_up_sync: |
1172 | if (c->sync) { | 1170 | if (c->sync) { |