summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorRichard Zhao <rizhao@nvidia.com>2017-12-05 18:48:22 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-12-10 13:36:39 -0500
commitfa1b18c171aba0f8bb674ccc8c60ae81213a16f6 (patch)
tree6c1204b817e052416da00400a713a66d0418cf1b /drivers/gpu/nvgpu
parent7f0aa103eaba5f1ad9c928066c8abe69ef734626 (diff)
gpu: nvgpu: vgpu: add tsg release command
gv11b needs tsg release callback to release CE method buffer. Bug 2022929 Change-Id: I32e27a5fa49eb61b9c2fc72ea32034191a9be48e Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1611631 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Thomas Fleury <tfleury@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Aparna Das <aparnad@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.h1
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_hal_gv11b.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/tsg_vgpu.c22
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/tsg_gk20a.c3
5 files changed, 27 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.h b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.h
index 62a3a256..5aefb356 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.h
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.h
@@ -50,6 +50,7 @@ int vgpu_fifo_force_reset_ch(struct channel_gk20a *ch,
50 u32 err_code, bool verbose); 50 u32 err_code, bool verbose);
51u32 vgpu_fifo_default_timeslice_us(struct gk20a *g); 51u32 vgpu_fifo_default_timeslice_us(struct gk20a *g);
52int vgpu_tsg_open(struct tsg_gk20a *tsg); 52int vgpu_tsg_open(struct tsg_gk20a *tsg);
53void vgpu_tsg_release(struct tsg_gk20a *tsg);
53int vgpu_tsg_bind_channel(struct tsg_gk20a *tsg, 54int vgpu_tsg_bind_channel(struct tsg_gk20a *tsg,
54 struct channel_gk20a *ch); 55 struct channel_gk20a *ch);
55int vgpu_tsg_unbind_channel(struct channel_gk20a *ch); 56int vgpu_tsg_unbind_channel(struct channel_gk20a *ch);
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_hal_gv11b.c
index 7d60bfb2..079b4cb9 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_hal_gv11b.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_hal_gv11b.c
@@ -355,6 +355,7 @@ static const struct gpu_ops vgpu_gv11b_ops = {
355 .set_runlist_interleave = vgpu_fifo_set_runlist_interleave, 355 .set_runlist_interleave = vgpu_fifo_set_runlist_interleave,
356 .tsg_set_timeslice = vgpu_tsg_set_timeslice, 356 .tsg_set_timeslice = vgpu_tsg_set_timeslice,
357 .tsg_open = vgpu_tsg_open, 357 .tsg_open = vgpu_tsg_open,
358 .tsg_release = vgpu_tsg_release,
358 .force_reset_ch = vgpu_fifo_force_reset_ch, 359 .force_reset_ch = vgpu_fifo_force_reset_ch,
359 .engine_enum_from_type = gp10b_fifo_engine_enum_from_type, 360 .engine_enum_from_type = gp10b_fifo_engine_enum_from_type,
360 .device_info_data_parse = gp10b_device_info_data_parse, 361 .device_info_data_parse = gp10b_device_info_data_parse,
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/tsg_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/tsg_vgpu.c
index c40e6f90..06f52177 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/tsg_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/tsg_vgpu.c
@@ -28,7 +28,7 @@
28int vgpu_tsg_open(struct tsg_gk20a *tsg) 28int vgpu_tsg_open(struct tsg_gk20a *tsg)
29{ 29{
30 struct tegra_vgpu_cmd_msg msg = {}; 30 struct tegra_vgpu_cmd_msg msg = {};
31 struct tegra_vgpu_tsg_open_params *p = 31 struct tegra_vgpu_tsg_open_rel_params *p =
32 &msg.params.tsg_open; 32 &msg.params.tsg_open;
33 int err; 33 int err;
34 34
@@ -47,6 +47,26 @@ int vgpu_tsg_open(struct tsg_gk20a *tsg)
47 return err; 47 return err;
48} 48}
49 49
50void vgpu_tsg_release(struct tsg_gk20a *tsg)
51{
52 struct tegra_vgpu_cmd_msg msg = {};
53 struct tegra_vgpu_tsg_open_rel_params *p =
54 &msg.params.tsg_release;
55 int err;
56
57 gk20a_dbg_fn("");
58
59 msg.cmd = TEGRA_VGPU_CMD_TSG_RELEASE;
60 msg.handle = vgpu_get_handle(tsg->g);
61 p->tsg_id = tsg->tsgid;
62 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg));
63 err = err ? err : msg.ret;
64 if (err) {
65 nvgpu_err(tsg->g,
66 "vgpu_tsg_release failed, tsgid %d", tsg->tsgid);
67 }
68}
69
50int vgpu_enable_tsg(struct tsg_gk20a *tsg) 70int vgpu_enable_tsg(struct tsg_gk20a *tsg)
51{ 71{
52 struct gk20a *g = tsg->g; 72 struct gk20a *g = tsg->g;
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index c6bc129f..f577f93c 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -552,6 +552,7 @@ struct gpu_ops {
552 struct channel_gk20a *ch); 552 struct channel_gk20a *ch);
553 int (*tsg_unbind_channel)(struct channel_gk20a *ch); 553 int (*tsg_unbind_channel)(struct channel_gk20a *ch);
554 int (*tsg_open)(struct tsg_gk20a *tsg); 554 int (*tsg_open)(struct tsg_gk20a *tsg);
555 void (*tsg_release)(struct tsg_gk20a *tsg);
555 u32 (*eng_runlist_base_size)(void); 556 u32 (*eng_runlist_base_size)(void);
556 int (*init_engine_info)(struct fifo_gk20a *f); 557 int (*init_engine_info)(struct fifo_gk20a *f);
557 u32 (*runlist_entry_size)(void); 558 u32 (*runlist_entry_size)(void);
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
index 8906257f..4efcfda8 100644
--- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
@@ -315,6 +315,9 @@ void gk20a_tsg_release(struct nvgpu_ref *ref)
315 struct gk20a *g = tsg->g; 315 struct gk20a *g = tsg->g;
316 struct gk20a_event_id_data *event_id_data, *event_id_data_temp; 316 struct gk20a_event_id_data *event_id_data, *event_id_data_temp;
317 317
318 if (g->ops.fifo.tsg_release)
319 g->ops.fifo.tsg_release(tsg);
320
318 if (tsg->tsg_gr_ctx) { 321 if (tsg->tsg_gr_ctx) {
319 gr_gk20a_free_tsg_gr_ctx(tsg); 322 gr_gk20a_free_tsg_gr_ctx(tsg);
320 tsg->tsg_gr_ctx = NULL; 323 tsg->tsg_gr_ctx = NULL;