diff options
author | aalex <aalex@nvidia.com> | 2018-09-07 12:38:05 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-21 06:15:03 -0400 |
commit | c5810a670d367ae1dc405fcc3108e11265df34bb (patch) | |
tree | 7ec13fcda49df98f360fb5adc57e4af7a95ea4cc /drivers/gpu/nvgpu/vgpu | |
parent | ec067c5ed1f00517dbd771fbe9809d2340ec908b (diff) |
gpu: nvgpu: refactor SET_SM_EXCEPTION_MASK ioctl
added hal layer for SM exception mask handling for
taking care of vitualization case.
Jira VQRM-4806
Bug 200447406
Bug 2331747
Change-Id: Ia44778a2e41c1a508c48026b8dee285966f1a544
Signed-off-by: aalex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1816284
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/fifo_vgpu.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/tsg_vgpu.c | 23 |
4 files changed, 26 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.h b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.h index 20205d3c..ecaaaf23 100644 --- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.h +++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.h | |||
@@ -61,5 +61,5 @@ int vgpu_tsg_bind_channel(struct tsg_gk20a *tsg, | |||
61 | int vgpu_tsg_unbind_channel(struct channel_gk20a *ch); | 61 | int vgpu_tsg_unbind_channel(struct channel_gk20a *ch); |
62 | int vgpu_tsg_set_timeslice(struct tsg_gk20a *tsg, u32 timeslice); | 62 | int vgpu_tsg_set_timeslice(struct tsg_gk20a *tsg, u32 timeslice); |
63 | int vgpu_enable_tsg(struct tsg_gk20a *tsg); | 63 | int vgpu_enable_tsg(struct tsg_gk20a *tsg); |
64 | 64 | int vgpu_set_sm_exception_type_mask(struct channel_gk20a *ch, u32 mask); | |
65 | #endif | 65 | #endif |
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c index 2ec08ae6..03839858 100644 --- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c | |||
@@ -358,6 +358,7 @@ static const struct gpu_ops vgpu_gp10b_ops = { | |||
358 | .get_sema_wait_cmd_size = gk20a_fifo_get_sema_wait_cmd_size, | 358 | .get_sema_wait_cmd_size = gk20a_fifo_get_sema_wait_cmd_size, |
359 | .get_sema_incr_cmd_size = gk20a_fifo_get_sema_incr_cmd_size, | 359 | .get_sema_incr_cmd_size = gk20a_fifo_get_sema_incr_cmd_size, |
360 | .add_sema_cmd = gk20a_fifo_add_sema_cmd, | 360 | .add_sema_cmd = gk20a_fifo_add_sema_cmd, |
361 | .set_sm_exception_type_mask = gk20a_tsg_set_sm_exception_type_mask, | ||
361 | }, | 362 | }, |
362 | .gr_ctx = { | 363 | .gr_ctx = { |
363 | .get_netlist_name = gr_gp10b_get_netlist_name, | 364 | .get_netlist_name = gr_gp10b_get_netlist_name, |
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c index eac57433..e3d042cf 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c | |||
@@ -424,6 +424,7 @@ static const struct gpu_ops vgpu_gv11b_ops = { | |||
424 | .get_sema_wait_cmd_size = gv11b_fifo_get_sema_wait_cmd_size, | 424 | .get_sema_wait_cmd_size = gv11b_fifo_get_sema_wait_cmd_size, |
425 | .get_sema_incr_cmd_size = gv11b_fifo_get_sema_incr_cmd_size, | 425 | .get_sema_incr_cmd_size = gv11b_fifo_get_sema_incr_cmd_size, |
426 | .add_sema_cmd = gv11b_fifo_add_sema_cmd, | 426 | .add_sema_cmd = gv11b_fifo_add_sema_cmd, |
427 | .set_sm_exception_type_mask = vgpu_set_sm_exception_type_mask, | ||
427 | }, | 428 | }, |
428 | .gr_ctx = { | 429 | .gr_ctx = { |
429 | .get_netlist_name = gr_gv11b_get_netlist_name, | 430 | .get_netlist_name = gr_gv11b_get_netlist_name, |
diff --git a/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c b/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c index a81b5022..cd733f9d 100644 --- a/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c | |||
@@ -163,3 +163,26 @@ int vgpu_tsg_set_timeslice(struct tsg_gk20a *tsg, u32 timeslice) | |||
163 | 163 | ||
164 | return err; | 164 | return err; |
165 | } | 165 | } |
166 | |||
167 | int vgpu_set_sm_exception_type_mask(struct channel_gk20a *ch, | ||
168 | u32 exception_mask) | ||
169 | { | ||
170 | struct tegra_vgpu_cmd_msg msg; | ||
171 | struct tegra_vgpu_set_sm_exception_type_mask_params *p = | ||
172 | &msg.params.set_sm_exception_mask; | ||
173 | int err = 0; | ||
174 | struct gk20a *g = ch->g; | ||
175 | |||
176 | nvgpu_log_fn(g, " "); | ||
177 | |||
178 | msg.cmd = TEGRA_VGPU_CMD_SET_SM_EXCEPTION_TYPE_MASK; | ||
179 | msg.handle = vgpu_get_handle(g); | ||
180 | p->handle = ch->virt_ctx; | ||
181 | p->mask = exception_mask; | ||
182 | err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)); | ||
183 | err = err ? err : msg.ret; | ||
184 | WARN_ON(err); | ||
185 | |||
186 | return err; | ||
187 | } | ||
188 | |||