summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/tsg_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/tsg_vgpu.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c b/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c
index 2033fd7a..9daf9e6d 100644
--- a/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c
@@ -23,6 +23,28 @@
23#include "gk20a/tsg_gk20a.h" 23#include "gk20a/tsg_gk20a.h"
24#include "vgpu.h" 24#include "vgpu.h"
25 25
26static int vgpu_tsg_open(struct tsg_gk20a *tsg)
27{
28 struct tegra_vgpu_cmd_msg msg = {};
29 struct tegra_vgpu_tsg_open_params *p =
30 &msg.params.tsg_open;
31 int err;
32
33 gk20a_dbg_fn("");
34
35 msg.cmd = TEGRA_VGPU_CMD_TSG_OPEN;
36 msg.handle = vgpu_get_handle(tsg->g);
37 p->tsg_id = tsg->tsgid;
38 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg));
39 err = err ? err : msg.ret;
40 if (err) {
41 gk20a_err(dev_from_gk20a(tsg->g),
42 "vgpu_tsg_open failed, tsgid %d", tsg->tsgid);
43 }
44
45 return err;
46}
47
26static int vgpu_tsg_bind_channel(struct tsg_gk20a *tsg, 48static int vgpu_tsg_bind_channel(struct tsg_gk20a *tsg,
27 struct channel_gk20a *ch) 49 struct channel_gk20a *ch)
28{ 50{
@@ -101,4 +123,5 @@ void vgpu_init_tsg_ops(struct gpu_ops *gops)
101 gops->fifo.tsg_bind_channel = vgpu_tsg_bind_channel; 123 gops->fifo.tsg_bind_channel = vgpu_tsg_bind_channel;
102 gops->fifo.tsg_unbind_channel = vgpu_tsg_unbind_channel; 124 gops->fifo.tsg_unbind_channel = vgpu_tsg_unbind_channel;
103 gops->fifo.tsg_set_timeslice = vgpu_tsg_set_timeslice; 125 gops->fifo.tsg_set_timeslice = vgpu_tsg_set_timeslice;
126 gops->fifo.tsg_open = vgpu_tsg_open;
104} 127}