diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-12-27 16:04:17 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-01-02 16:53:09 -0500 |
commit | 86691b59c6fae2b091855c0f4d44079cad8529b1 (patch) | |
tree | c9fd2914ed052771980298f5e77bd43d7c430ec9 /drivers/gpu/nvgpu/common/linux | |
parent | 14fa8207e2f7feb36f8fa284b94859e05136eb0f (diff) |
gpu: nvgpu: Remove bare channel scheduling
Remove scheduling IOCTL implementations for bare channels. Also
removes code that constructs bare channels in runlist.
Bug 1842197
Change-Id: I6e833b38e24a2f2c45c7993edf939d365eaf41f0
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1627326
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
7 files changed, 15 insertions, 109 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/debug_fifo.c b/drivers/gpu/nvgpu/common/linux/debug_fifo.c index 94a16b70..ad157ee7 100644 --- a/drivers/gpu/nvgpu/common/linux/debug_fifo.c +++ b/drivers/gpu/nvgpu/common/linux/debug_fifo.c | |||
@@ -81,16 +81,16 @@ static int gk20a_fifo_sched_debugfs_seq_show( | |||
81 | return ret; | 81 | return ret; |
82 | 82 | ||
83 | if (gk20a_channel_get(ch)) { | 83 | if (gk20a_channel_get(ch)) { |
84 | if (gk20a_is_channel_marked_as_tsg(ch)) | 84 | tsg = tsg_gk20a_from_ch(ch); |
85 | tsg = &f->tsg[ch->tsgid]; | ||
86 | 85 | ||
87 | seq_printf(s, "%-8d %-8d %-8d %-9d %-8d %-10d %-8d %-8d\n", | 86 | if (tsg) |
87 | seq_printf(s, "%-8d %-8d %-8d %-9d %-8d %-10d %-8d %-8d\n", | ||
88 | ch->chid, | 88 | ch->chid, |
89 | ch->tsgid, | 89 | ch->tsgid, |
90 | ch->tgid, | 90 | ch->tgid, |
91 | tsg ? tsg->timeslice_us : ch->timeslice_us, | 91 | tsg->timeslice_us, |
92 | ch->timeout_ms_max, | 92 | ch->timeout_ms_max, |
93 | tsg ? tsg->interleave_level : ch->interleave_level, | 93 | tsg->interleave_level, |
94 | ch->ch_ctx.gr_ctx ? ch->ch_ctx.gr_ctx->graphics_preempt_mode : U32_MAX, | 94 | ch->ch_ctx.gr_ctx ? ch->ch_ctx.gr_ctx->graphics_preempt_mode : U32_MAX, |
95 | ch->ch_ctx.gr_ctx ? ch->ch_ctx.gr_ctx->compute_preempt_mode : U32_MAX); | 95 | ch->ch_ctx.gr_ctx ? ch->ch_ctx.gr_ctx->compute_preempt_mode : U32_MAX); |
96 | gk20a_channel_put(ch); | 96 | gk20a_channel_put(ch); |
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c index 65d560c7..94501a89 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c | |||
@@ -76,11 +76,15 @@ static void gk20a_channel_trace_sched_param( | |||
76 | const char *compute_preempt_mode), | 76 | const char *compute_preempt_mode), |
77 | struct channel_gk20a *ch) | 77 | struct channel_gk20a *ch) |
78 | { | 78 | { |
79 | struct tsg_gk20a *tsg = tsg_gk20a_from_ch(ch); | ||
80 | |||
81 | if (!tsg) | ||
82 | return; | ||
83 | |||
79 | (trace)(ch->chid, ch->tsgid, ch->pid, | 84 | (trace)(ch->chid, ch->tsgid, ch->pid, |
80 | gk20a_is_channel_marked_as_tsg(ch) ? | 85 | tsg_gk20a_from_ch(ch)->timeslice_us, |
81 | tsg_gk20a_from_ch(ch)->timeslice_us : ch->timeslice_us, | ||
82 | ch->timeout_ms_max, | 86 | ch->timeout_ms_max, |
83 | gk20a_fifo_interleave_level_name(ch->interleave_level), | 87 | gk20a_fifo_interleave_level_name(tsg->interleave_level), |
84 | gr_gk20a_graphics_preempt_mode_name(ch->ch_ctx.gr_ctx ? | 88 | gr_gk20a_graphics_preempt_mode_name(ch->ch_ctx.gr_ctx ? |
85 | ch->ch_ctx.gr_ctx->graphics_preempt_mode : 0), | 89 | ch->ch_ctx.gr_ctx->graphics_preempt_mode : 0), |
86 | gr_gk20a_compute_preempt_mode_name(ch->ch_ctx.gr_ctx ? | 90 | gr_gk20a_compute_preempt_mode_name(ch->ch_ctx.gr_ctx ? |
@@ -795,28 +799,6 @@ u32 nvgpu_get_common_runlist_level(u32 level) | |||
795 | return level; | 799 | return level; |
796 | } | 800 | } |
797 | 801 | ||
798 | static int gk20a_ioctl_channel_set_runlist_interleave(struct channel_gk20a *ch, | ||
799 | u32 level) | ||
800 | { | ||
801 | int err = 0; | ||
802 | |||
803 | err = gk20a_busy(ch->g); | ||
804 | if (err) { | ||
805 | nvgpu_err(ch->g, "failed to power on, %d", err); | ||
806 | goto fail; | ||
807 | } | ||
808 | |||
809 | level = nvgpu_get_common_runlist_level(level); | ||
810 | err = gk20a_channel_set_runlist_interleave(ch, level); | ||
811 | |||
812 | gk20a_idle(ch->g); | ||
813 | gk20a_channel_trace_sched_param( | ||
814 | trace_gk20a_channel_set_runlist_interleave, ch); | ||
815 | |||
816 | fail: | ||
817 | return err; | ||
818 | } | ||
819 | |||
820 | static u32 nvgpu_obj_ctx_user_flags_to_common_flags(u32 user_flags) | 802 | static u32 nvgpu_obj_ctx_user_flags_to_common_flags(u32 user_flags) |
821 | { | 803 | { |
822 | u32 flags = 0; | 804 | u32 flags = 0; |
@@ -1229,29 +1211,6 @@ long gk20a_channel_ioctl(struct file *filp, | |||
1229 | err = gk20a_channel_set_wdt_status(ch, | 1211 | err = gk20a_channel_set_wdt_status(ch, |
1230 | (struct nvgpu_channel_wdt_args *)buf); | 1212 | (struct nvgpu_channel_wdt_args *)buf); |
1231 | break; | 1213 | break; |
1232 | case NVGPU_IOCTL_CHANNEL_SET_RUNLIST_INTERLEAVE: | ||
1233 | err = gk20a_ioctl_channel_set_runlist_interleave(ch, | ||
1234 | ((struct nvgpu_runlist_interleave_args *)buf)->level); | ||
1235 | break; | ||
1236 | case NVGPU_IOCTL_CHANNEL_SET_TIMESLICE: | ||
1237 | err = gk20a_busy(ch->g); | ||
1238 | if (err) { | ||
1239 | dev_err(dev, | ||
1240 | "%s: failed to host gk20a for ioctl cmd: 0x%x", | ||
1241 | __func__, cmd); | ||
1242 | break; | ||
1243 | } | ||
1244 | err = ch->g->ops.fifo.channel_set_timeslice(ch, | ||
1245 | ((struct nvgpu_timeslice_args *)buf)->timeslice_us); | ||
1246 | |||
1247 | gk20a_idle(ch->g); | ||
1248 | gk20a_channel_trace_sched_param( | ||
1249 | trace_gk20a_channel_set_timeslice, ch); | ||
1250 | break; | ||
1251 | case NVGPU_IOCTL_CHANNEL_GET_TIMESLICE: | ||
1252 | ((struct nvgpu_timeslice_args *)buf)->timeslice_us = | ||
1253 | gk20a_channel_get_timeslice(ch); | ||
1254 | break; | ||
1255 | case NVGPU_IOCTL_CHANNEL_SET_PREEMPTION_MODE: | 1214 | case NVGPU_IOCTL_CHANNEL_SET_PREEMPTION_MODE: |
1256 | err = nvgpu_ioctl_channel_set_preemption_mode(ch, | 1215 | err = nvgpu_ioctl_channel_set_preemption_mode(ch, |
1257 | ((struct nvgpu_preemption_mode_args *)buf)->graphics_preempt_mode, | 1216 | ((struct nvgpu_preemption_mode_args *)buf)->graphics_preempt_mode, |
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c index e06b41da..6b8c630b 100644 --- a/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c +++ b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c | |||
@@ -604,8 +604,8 @@ int vgpu_fifo_wait_engine_idle(struct gk20a *g) | |||
604 | return 0; | 604 | return 0; |
605 | } | 605 | } |
606 | 606 | ||
607 | static int vgpu_fifo_tsg_set_runlist_interleave(struct gk20a *g, | 607 | int vgpu_fifo_set_runlist_interleave(struct gk20a *g, |
608 | u32 tsgid, | 608 | u32 id, |
609 | u32 runlist_id, | 609 | u32 runlist_id, |
610 | u32 new_level) | 610 | u32 new_level) |
611 | { | 611 | { |
@@ -618,62 +618,13 @@ static int vgpu_fifo_tsg_set_runlist_interleave(struct gk20a *g, | |||
618 | 618 | ||
619 | msg.cmd = TEGRA_VGPU_CMD_TSG_SET_RUNLIST_INTERLEAVE; | 619 | msg.cmd = TEGRA_VGPU_CMD_TSG_SET_RUNLIST_INTERLEAVE; |
620 | msg.handle = vgpu_get_handle(g); | 620 | msg.handle = vgpu_get_handle(g); |
621 | p->tsg_id = tsgid; | 621 | p->tsg_id = id; |
622 | p->level = new_level; | ||
623 | err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)); | ||
624 | WARN_ON(err || msg.ret); | ||
625 | return err ? err : msg.ret; | ||
626 | } | ||
627 | |||
628 | int vgpu_fifo_set_runlist_interleave(struct gk20a *g, | ||
629 | u32 id, | ||
630 | bool is_tsg, | ||
631 | u32 runlist_id, | ||
632 | u32 new_level) | ||
633 | { | ||
634 | struct tegra_vgpu_cmd_msg msg; | ||
635 | struct tegra_vgpu_channel_runlist_interleave_params *p = | ||
636 | &msg.params.channel_interleave; | ||
637 | struct channel_gk20a *ch; | ||
638 | int err; | ||
639 | |||
640 | gk20a_dbg_fn(""); | ||
641 | |||
642 | if (is_tsg) | ||
643 | return vgpu_fifo_tsg_set_runlist_interleave(g, id, | ||
644 | runlist_id, new_level); | ||
645 | |||
646 | ch = &g->fifo.channel[id]; | ||
647 | msg.cmd = TEGRA_VGPU_CMD_CHANNEL_SET_RUNLIST_INTERLEAVE; | ||
648 | msg.handle = vgpu_get_handle(ch->g); | ||
649 | p->handle = ch->virt_ctx; | ||
650 | p->level = new_level; | 622 | p->level = new_level; |
651 | err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)); | 623 | err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)); |
652 | WARN_ON(err || msg.ret); | 624 | WARN_ON(err || msg.ret); |
653 | return err ? err : msg.ret; | 625 | return err ? err : msg.ret; |
654 | } | 626 | } |
655 | 627 | ||
656 | int vgpu_channel_set_timeslice(struct channel_gk20a *ch, u32 timeslice) | ||
657 | { | ||
658 | struct tegra_vgpu_cmd_msg msg; | ||
659 | struct tegra_vgpu_channel_timeslice_params *p = | ||
660 | &msg.params.channel_timeslice; | ||
661 | int err; | ||
662 | |||
663 | gk20a_dbg_fn(""); | ||
664 | |||
665 | msg.cmd = TEGRA_VGPU_CMD_CHANNEL_SET_TIMESLICE; | ||
666 | msg.handle = vgpu_get_handle(ch->g); | ||
667 | p->handle = ch->virt_ctx; | ||
668 | p->timeslice_us = timeslice; | ||
669 | err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)); | ||
670 | err = err ? err : msg.ret; | ||
671 | WARN_ON(err); | ||
672 | if (!err) | ||
673 | ch->timeslice_us = p->timeslice_us; | ||
674 | return err; | ||
675 | } | ||
676 | |||
677 | int vgpu_fifo_force_reset_ch(struct channel_gk20a *ch, | 628 | int vgpu_fifo_force_reset_ch(struct channel_gk20a *ch, |
678 | u32 err_code, bool verbose) | 629 | u32 err_code, bool verbose) |
679 | { | 630 | { |
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.h b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.h index 5aefb356..92789ddd 100644 --- a/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.h +++ b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.h | |||
@@ -42,7 +42,6 @@ int vgpu_fifo_update_runlist(struct gk20a *g, u32 runlist_id, | |||
42 | int vgpu_fifo_wait_engine_idle(struct gk20a *g); | 42 | int vgpu_fifo_wait_engine_idle(struct gk20a *g); |
43 | int vgpu_fifo_set_runlist_interleave(struct gk20a *g, | 43 | int vgpu_fifo_set_runlist_interleave(struct gk20a *g, |
44 | u32 id, | 44 | u32 id, |
45 | bool is_tsg, | ||
46 | u32 runlist_id, | 45 | u32 runlist_id, |
47 | u32 new_level); | 46 | u32 new_level); |
48 | int vgpu_channel_set_timeslice(struct channel_gk20a *ch, u32 timeslice); | 47 | int vgpu_channel_set_timeslice(struct channel_gk20a *ch, u32 timeslice); |
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gm20b/vgpu_hal_gm20b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gm20b/vgpu_hal_gm20b.c index 6f50dbb8..74fa65f3 100644 --- a/drivers/gpu/nvgpu/common/linux/vgpu/gm20b/vgpu_hal_gm20b.c +++ b/drivers/gpu/nvgpu/common/linux/vgpu/gm20b/vgpu_hal_gm20b.c | |||
@@ -260,7 +260,6 @@ static const struct gpu_ops vgpu_gm20b_ops = { | |||
260 | .alloc_inst = vgpu_channel_alloc_inst, | 260 | .alloc_inst = vgpu_channel_alloc_inst, |
261 | .free_inst = vgpu_channel_free_inst, | 261 | .free_inst = vgpu_channel_free_inst, |
262 | .setup_ramfc = vgpu_channel_setup_ramfc, | 262 | .setup_ramfc = vgpu_channel_setup_ramfc, |
263 | .channel_set_timeslice = vgpu_channel_set_timeslice, | ||
264 | .default_timeslice_us = vgpu_fifo_default_timeslice_us, | 263 | .default_timeslice_us = vgpu_fifo_default_timeslice_us, |
265 | .setup_userd = gk20a_fifo_setup_userd, | 264 | .setup_userd = gk20a_fifo_setup_userd, |
266 | .userd_gp_get = gk20a_fifo_userd_gp_get, | 265 | .userd_gp_get = gk20a_fifo_userd_gp_get, |
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c index 31608200..66ef6e00 100644 --- a/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c | |||
@@ -290,7 +290,6 @@ static const struct gpu_ops vgpu_gp10b_ops = { | |||
290 | .alloc_inst = vgpu_channel_alloc_inst, | 290 | .alloc_inst = vgpu_channel_alloc_inst, |
291 | .free_inst = vgpu_channel_free_inst, | 291 | .free_inst = vgpu_channel_free_inst, |
292 | .setup_ramfc = vgpu_channel_setup_ramfc, | 292 | .setup_ramfc = vgpu_channel_setup_ramfc, |
293 | .channel_set_timeslice = vgpu_channel_set_timeslice, | ||
294 | .default_timeslice_us = vgpu_fifo_default_timeslice_us, | 293 | .default_timeslice_us = vgpu_fifo_default_timeslice_us, |
295 | .setup_userd = gk20a_fifo_setup_userd, | 294 | .setup_userd = gk20a_fifo_setup_userd, |
296 | .userd_gp_get = gk20a_fifo_userd_gp_get, | 295 | .userd_gp_get = gk20a_fifo_userd_gp_get, |
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 b41d9dc3..1523c2de 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 | |||
@@ -331,7 +331,6 @@ static const struct gpu_ops vgpu_gv11b_ops = { | |||
331 | .alloc_inst = vgpu_channel_alloc_inst, | 331 | .alloc_inst = vgpu_channel_alloc_inst, |
332 | .free_inst = vgpu_channel_free_inst, | 332 | .free_inst = vgpu_channel_free_inst, |
333 | .setup_ramfc = vgpu_channel_setup_ramfc, | 333 | .setup_ramfc = vgpu_channel_setup_ramfc, |
334 | .channel_set_timeslice = vgpu_channel_set_timeslice, | ||
335 | .default_timeslice_us = vgpu_fifo_default_timeslice_us, | 334 | .default_timeslice_us = vgpu_fifo_default_timeslice_us, |
336 | .setup_userd = gk20a_fifo_setup_userd, | 335 | .setup_userd = gk20a_fifo_setup_userd, |
337 | .userd_gp_get = gv11b_userd_gp_get, | 336 | .userd_gp_get = gv11b_userd_gp_get, |