From a295d90cac87949256b629e29f97fa5e28a1feb3 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Thu, 9 Jun 2016 10:30:16 +0530 Subject: 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 Reviewed-on: http://git-master/r/1161541 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/vgpu/fifo_vgpu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/vgpu') 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) /* FIXME: retrieve this from server */ gr_info->runlist_id = 0; + f->active_engines_list[0] = gr_sw_id; + return 0; } @@ -281,11 +283,14 @@ static int vgpu_init_fifo_setup_sw(struct gk20a *g) f->tsg = vzalloc(f->num_channels * sizeof(*f->tsg)); f->engine_info = kzalloc(f->max_engines * sizeof(*f->engine_info), GFP_KERNEL); + f->active_engines_list = kzalloc(f->max_engines * sizeof(u32), + GFP_KERNEL); - if (!(f->channel && f->tsg && f->engine_info)) { + if (!(f->channel && f->tsg && f->engine_info && f->active_engines_list)) { err = -ENOMEM; goto clean_up; } + memset(f->active_engines_list, 0xff, (f->max_engines * sizeof(u32))); init_engine_info(f); @@ -327,6 +332,8 @@ clean_up: f->tsg = NULL; kfree(f->engine_info); f->engine_info = NULL; + kfree(f->active_engines_list); + f->active_engines_list = NULL; return err; } -- cgit v1.2.2