diff options
author | Sachit Kadle <skadle@nvidia.com> | 2016-11-04 20:48:59 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-12-19 18:39:47 -0500 |
commit | c1750f45f5239508e7a67db0627552f87943ec9f (patch) | |
tree | 638889829e65bc1f51254791da99610beaa538f1 /drivers/gpu/nvgpu/vgpu | |
parent | 6ea4a81f4da565eb07e4eedbe7f80305b5715cf2 (diff) |
gpu: nvgpu: add tsg_open HAL interface
Add HAL interface for TSG open, which is intended to
be called from the exisiting gk20a_tsg_open function.
The tsg_open entryoint is only implemented for vgpu,
as the server needs to clear metadata when a tsg is opened.
Bug 200215060
Change-Id: Icc8fd602f31e52d9fa9b2e7786b665b9e7b9294e
Signed-off-by: Sachit Kadle <skadle@nvidia.com>
Reviewed-on: http://git-master/r/1249218
(cherry picked from commit 35c86f7c796c6574d3dc336e20012ea5c16d7cb4)
Reviewed-on: http://git-master/r/1256468
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/tsg_vgpu.c | 23 |
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 | ||
26 | static 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 | |||
26 | static int vgpu_tsg_bind_channel(struct tsg_gk20a *tsg, | 48 | static 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 | } |