diff options
author | Lakshmanan M <lm@nvidia.com> | 2016-06-09 01:00:16 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-06-13 10:45:19 -0400 |
commit | a295d90cac87949256b629e29f97fa5e28a1feb3 (patch) | |
tree | 7c1a104c0a0594869955074fe8abe86097cacae8 /drivers/gpu/nvgpu/vgpu/fifo_vgpu.c | |
parent | 987de665838f6b4aceadf52f076b91da4cc633ca (diff) |
gpu: nvgpu: Add uapi support for non-graphics engines
Extend the existing NVGPU_GPU_IOCTL_OPEN_CHANNEL interface to allow
opening channels for other than the primary (i.e., the graphics)
runlists. This is required to push work to dGPU engines that have
their own runlists, such as the asynchronous copy engines and the
multimedia engines.
Minor change - Added active_engines_list allocation
and assignment for fifo_vgpu back end.
JIRA DNVGPU-25
Change-Id: I3ed377e2c9a2b4dd72e8256463510a62c64e7a8f
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: http://git-master/r/1161541
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/fifo_vgpu.c')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/fifo_vgpu.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c index 9591c72a..11f389fb 100644 --- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c | |||
@@ -175,6 +175,8 @@ static int init_engine_info(struct fifo_gk20a *f) | |||
175 | 175 | ||
176 | /* FIXME: retrieve this from server */ | 176 | /* FIXME: retrieve this from server */ |
177 | gr_info->runlist_id = 0; | 177 | gr_info->runlist_id = 0; |
178 | f->active_engines_list[0] = gr_sw_id; | ||
179 | |||
178 | return 0; | 180 | return 0; |
179 | } | 181 | } |
180 | 182 | ||
@@ -281,11 +283,14 @@ static int vgpu_init_fifo_setup_sw(struct gk20a *g) | |||
281 | f->tsg = vzalloc(f->num_channels * sizeof(*f->tsg)); | 283 | f->tsg = vzalloc(f->num_channels * sizeof(*f->tsg)); |
282 | f->engine_info = kzalloc(f->max_engines * sizeof(*f->engine_info), | 284 | f->engine_info = kzalloc(f->max_engines * sizeof(*f->engine_info), |
283 | GFP_KERNEL); | 285 | GFP_KERNEL); |
286 | f->active_engines_list = kzalloc(f->max_engines * sizeof(u32), | ||
287 | GFP_KERNEL); | ||
284 | 288 | ||
285 | if (!(f->channel && f->tsg && f->engine_info)) { | 289 | if (!(f->channel && f->tsg && f->engine_info && f->active_engines_list)) { |
286 | err = -ENOMEM; | 290 | err = -ENOMEM; |
287 | goto clean_up; | 291 | goto clean_up; |
288 | } | 292 | } |
293 | memset(f->active_engines_list, 0xff, (f->max_engines * sizeof(u32))); | ||
289 | 294 | ||
290 | init_engine_info(f); | 295 | init_engine_info(f); |
291 | 296 | ||
@@ -327,6 +332,8 @@ clean_up: | |||
327 | f->tsg = NULL; | 332 | f->tsg = NULL; |
328 | kfree(f->engine_info); | 333 | kfree(f->engine_info); |
329 | f->engine_info = NULL; | 334 | f->engine_info = NULL; |
335 | kfree(f->active_engines_list); | ||
336 | f->active_engines_list = NULL; | ||
330 | 337 | ||
331 | return err; | 338 | return err; |
332 | } | 339 | } |