From 85ff2a31eba0c2716bab0f0ca7075d3e738fd40a Mon Sep 17 00:00:00 2001 From: Aparna Das Date: Wed, 17 May 2017 10:57:59 -0700 Subject: gpu: nvgpu: vgpu: use ivm to send auxiliary data RM server retrieves auxiliary data only from IVM. Modify IVC commands to send auxiliary data to RM server using IVM and not as a part command message. VFND-4166 Change-Id: I9bfe33cf9301f7c70709318b810c622ec57b1cdf Signed-off-by: Aparna Das Reviewed-on: http://git-master/r/1484130 Reviewed-by: svcboomerang Tested-by: svcboomerang --- drivers/gpu/nvgpu/vgpu/fifo_vgpu.c | 40 ++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'drivers/gpu/nvgpu/vgpu/fifo_vgpu.c') diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c index 5ea6a016..309a395a 100644 --- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c @@ -461,28 +461,38 @@ static int vgpu_fifo_preempt_tsg(struct gk20a *g, u32 tsgid) static int vgpu_submit_runlist(struct gk20a *g, u64 handle, u8 runlist_id, u16 *runlist, u32 num_entries) { - struct tegra_vgpu_cmd_msg *msg; + struct tegra_vgpu_cmd_msg msg; struct tegra_vgpu_runlist_params *p; - size_t size = sizeof(*msg) + sizeof(*runlist) * num_entries; - char *ptr; int err; + void *oob_handle; + void *oob; + size_t size, oob_size; + + oob_handle = tegra_gr_comm_oob_get_ptr(TEGRA_GR_COMM_CTX_CLIENT, + tegra_gr_comm_get_server_vmid(), TEGRA_VGPU_QUEUE_CMD, + &oob, &oob_size); + if (!oob_handle) + return -EINVAL; + + size = sizeof(*runlist) * num_entries; + if (oob_size < size) { + err = -ENOMEM; + goto done; + } - msg = nvgpu_kmalloc(g, size); - if (!msg) - return -1; - - msg->cmd = TEGRA_VGPU_CMD_SUBMIT_RUNLIST; - msg->handle = handle; - p = &msg->params.runlist; + msg.cmd = TEGRA_VGPU_CMD_SUBMIT_RUNLIST; + msg.handle = handle; + p = &msg.params.runlist; p->runlist_id = runlist_id; p->num_entries = num_entries; - ptr = (char *)msg + sizeof(*msg); - memcpy(ptr, runlist, sizeof(*runlist) * num_entries); - err = vgpu_comm_sendrecv(msg, size, sizeof(*msg)); + memcpy(oob, runlist, size); + err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)); + + err = (err || msg.ret) ? -1 : 0; - err = (err || msg->ret) ? -1 : 0; - nvgpu_kfree(g, msg); +done: + tegra_gr_comm_oob_put_ptr(oob_handle); return err; } -- cgit v1.2.2