diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r-- | drivers/gpu/nvgpu/common/fifo/channel.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index fefd90d8..adb59ac4 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c | |||
@@ -1131,8 +1131,8 @@ static void channel_gk20a_free_prealloc_resources(struct channel_gk20a *c) | |||
1131 | c->joblist.pre_alloc.enabled = false; | 1131 | c->joblist.pre_alloc.enabled = false; |
1132 | } | 1132 | } |
1133 | 1133 | ||
1134 | int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, | 1134 | int nvgpu_channel_setup_bind(struct channel_gk20a *c, |
1135 | struct nvgpu_gpfifo_args *gpfifo_args) | 1135 | struct nvgpu_setup_bind_args *args) |
1136 | { | 1136 | { |
1137 | struct gk20a *g = c->g; | 1137 | struct gk20a *g = c->g; |
1138 | struct vm_gk20a *ch_vm; | 1138 | struct vm_gk20a *ch_vm; |
@@ -1141,14 +1141,14 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, | |||
1141 | int err = 0; | 1141 | int err = 0; |
1142 | unsigned long acquire_timeout; | 1142 | unsigned long acquire_timeout; |
1143 | 1143 | ||
1144 | gpfifo_size = gpfifo_args->num_entries; | 1144 | gpfifo_size = args->num_gpfifo_entries; |
1145 | gpfifo_entry_size = nvgpu_get_gpfifo_entry_size(); | 1145 | gpfifo_entry_size = nvgpu_get_gpfifo_entry_size(); |
1146 | 1146 | ||
1147 | if (gpfifo_args->flags & NVGPU_GPFIFO_FLAGS_SUPPORT_VPR) { | 1147 | if (args->flags & NVGPU_SETUP_BIND_FLAGS_SUPPORT_VPR) { |
1148 | c->vpr = true; | 1148 | c->vpr = true; |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | if (gpfifo_args->flags & NVGPU_GPFIFO_FLAGS_SUPPORT_DETERMINISTIC) { | 1151 | if (args->flags & NVGPU_SETUP_BIND_FLAGS_SUPPORT_DETERMINISTIC) { |
1152 | nvgpu_rwsem_down_read(&g->deterministic_busy); | 1152 | nvgpu_rwsem_down_read(&g->deterministic_busy); |
1153 | /* | 1153 | /* |
1154 | * Railgating isn't deterministic; instead of disallowing | 1154 | * Railgating isn't deterministic; instead of disallowing |
@@ -1172,8 +1172,7 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, | |||
1172 | /* an address space needs to have been bound at this point. */ | 1172 | /* an address space needs to have been bound at this point. */ |
1173 | if (!gk20a_channel_as_bound(c)) { | 1173 | if (!gk20a_channel_as_bound(c)) { |
1174 | nvgpu_err(g, | 1174 | nvgpu_err(g, |
1175 | "not bound to an address space at time of gpfifo" | 1175 | "not bound to an address space at time of setup_bind"); |
1176 | " allocation."); | ||
1177 | err = -EINVAL; | 1176 | err = -EINVAL; |
1178 | goto clean_up_idle; | 1177 | goto clean_up_idle; |
1179 | } | 1178 | } |
@@ -1187,10 +1186,9 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, | |||
1187 | goto clean_up_idle; | 1186 | goto clean_up_idle; |
1188 | } | 1187 | } |
1189 | 1188 | ||
1190 | if (gpfifo_args->flags & NVGPU_GPFIFO_FLAGS_USERMODE_SUPPORT) { | 1189 | if (args->flags & NVGPU_SETUP_BIND_FLAGS_USERMODE_SUPPORT) { |
1191 | if (g->os_channel.alloc_usermode_buffers) { | 1190 | if (g->os_channel.alloc_usermode_buffers) { |
1192 | err = g->os_channel.alloc_usermode_buffers(c, | 1191 | err = g->os_channel.alloc_usermode_buffers(c, args); |
1193 | gpfifo_args); | ||
1194 | if (err) { | 1192 | if (err) { |
1195 | nvgpu_err(g, "Usermode buffer alloc failed"); | 1193 | nvgpu_err(g, "Usermode buffer alloc failed"); |
1196 | goto clean_up; | 1194 | goto clean_up; |
@@ -1258,23 +1256,23 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, | |||
1258 | 1256 | ||
1259 | err = g->ops.fifo.setup_ramfc(c, gpfifo_gpu_va, | 1257 | err = g->ops.fifo.setup_ramfc(c, gpfifo_gpu_va, |
1260 | c->gpfifo.entry_num, | 1258 | c->gpfifo.entry_num, |
1261 | acquire_timeout, gpfifo_args->flags); | 1259 | acquire_timeout, args->flags); |
1262 | if (err) { | 1260 | if (err) { |
1263 | goto clean_up_sync; | 1261 | goto clean_up_sync; |
1264 | } | 1262 | } |
1265 | 1263 | ||
1266 | /* TBD: setup engine contexts */ | 1264 | /* TBD: setup engine contexts */ |
1267 | 1265 | ||
1268 | if (c->deterministic && gpfifo_args->num_inflight_jobs != 0U) { | 1266 | if (c->deterministic && args->num_inflight_jobs != 0U) { |
1269 | err = channel_gk20a_prealloc_resources(c, | 1267 | err = channel_gk20a_prealloc_resources(c, |
1270 | gpfifo_args->num_inflight_jobs); | 1268 | args->num_inflight_jobs); |
1271 | if (err) { | 1269 | if (err) { |
1272 | goto clean_up_sync; | 1270 | goto clean_up_sync; |
1273 | } | 1271 | } |
1274 | } | 1272 | } |
1275 | 1273 | ||
1276 | err = channel_gk20a_alloc_priv_cmdbuf(c, | 1274 | err = channel_gk20a_alloc_priv_cmdbuf(c, |
1277 | gpfifo_args->num_inflight_jobs); | 1275 | args->num_inflight_jobs); |
1278 | if (err) { | 1276 | if (err) { |
1279 | goto clean_up_prealloc; | 1277 | goto clean_up_prealloc; |
1280 | } | 1278 | } |
@@ -1292,7 +1290,7 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, | |||
1292 | clean_up_priv_cmd: | 1290 | clean_up_priv_cmd: |
1293 | channel_gk20a_free_priv_cmdbuf(c); | 1291 | channel_gk20a_free_priv_cmdbuf(c); |
1294 | clean_up_prealloc: | 1292 | clean_up_prealloc: |
1295 | if (c->deterministic && gpfifo_args->num_inflight_jobs != 0U) { | 1293 | if (c->deterministic && args->num_inflight_jobs != 0U) { |
1296 | channel_gk20a_free_prealloc_resources(c); | 1294 | channel_gk20a_free_prealloc_resources(c); |
1297 | } | 1295 | } |
1298 | clean_up_sync: | 1296 | clean_up_sync: |