summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
diff options
context:
space:
mode:
authorAparna Das <aparnad@nvidia.com>2017-05-17 13:57:59 -0400
committersvcboomerang <svcboomerang@nvidia.com>2017-05-24 06:47:30 -0400
commit85ff2a31eba0c2716bab0f0ca7075d3e738fd40a (patch)
tree5945d9c9aab3392e75162d2bd66c1496729fc84f /drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
parentabba815d838905d8575ef8f8ff8381dfb9d9cb25 (diff)
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 <aparnad@nvidia.com> Reviewed-on: http://git-master/r/1484130 Reviewed-by: svcboomerang <svcboomerang@nvidia.com> Tested-by: svcboomerang <svcboomerang@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/fifo_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/fifo_vgpu.c40
1 files changed, 25 insertions, 15 deletions
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)
461static int vgpu_submit_runlist(struct gk20a *g, u64 handle, u8 runlist_id, 461static int vgpu_submit_runlist(struct gk20a *g, u64 handle, u8 runlist_id,
462 u16 *runlist, u32 num_entries) 462 u16 *runlist, u32 num_entries)
463{ 463{
464 struct tegra_vgpu_cmd_msg *msg; 464 struct tegra_vgpu_cmd_msg msg;
465 struct tegra_vgpu_runlist_params *p; 465 struct tegra_vgpu_runlist_params *p;
466 size_t size = sizeof(*msg) + sizeof(*runlist) * num_entries;
467 char *ptr;
468 int err; 466 int err;
467 void *oob_handle;
468 void *oob;
469 size_t size, oob_size;
470
471 oob_handle = tegra_gr_comm_oob_get_ptr(TEGRA_GR_COMM_CTX_CLIENT,
472 tegra_gr_comm_get_server_vmid(), TEGRA_VGPU_QUEUE_CMD,
473 &oob, &oob_size);
474 if (!oob_handle)
475 return -EINVAL;
476
477 size = sizeof(*runlist) * num_entries;
478 if (oob_size < size) {
479 err = -ENOMEM;
480 goto done;
481 }
469 482
470 msg = nvgpu_kmalloc(g, size); 483 msg.cmd = TEGRA_VGPU_CMD_SUBMIT_RUNLIST;
471 if (!msg) 484 msg.handle = handle;
472 return -1; 485 p = &msg.params.runlist;
473
474 msg->cmd = TEGRA_VGPU_CMD_SUBMIT_RUNLIST;
475 msg->handle = handle;
476 p = &msg->params.runlist;
477 p->runlist_id = runlist_id; 486 p->runlist_id = runlist_id;
478 p->num_entries = num_entries; 487 p->num_entries = num_entries;
479 488
480 ptr = (char *)msg + sizeof(*msg); 489 memcpy(oob, runlist, size);
481 memcpy(ptr, runlist, sizeof(*runlist) * num_entries); 490 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg));
482 err = vgpu_comm_sendrecv(msg, size, sizeof(*msg)); 491
492 err = (err || msg.ret) ? -1 : 0;
483 493
484 err = (err || msg->ret) ? -1 : 0; 494done:
485 nvgpu_kfree(g, msg); 495 tegra_gr_comm_oob_put_ptr(oob_handle);
486 return err; 496 return err;
487} 497}
488 498