summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_channel.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_channel.c55
1 files changed, 7 insertions, 48 deletions
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
798static 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
816fail:
817 return err;
818}
819
820static u32 nvgpu_obj_ctx_user_flags_to_common_flags(u32 user_flags) 802static 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,