gpu: nvgpu: fix sched get_params for 0 timeslice

When the TSG is initialized, the timeslice is initially set to 0,
which is a flag for using the default timeslice.

The sched get_params ioctl was returning 0 in this case; instead,
call gk20a_tsg_get_timeslice() to get the correct value.

Bug 2818547

Change-Id: I29fde48240098074de12e9a9a3e347e4042a64e8
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2283962
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-by: Satish Arora <satisha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Peter Daifuku
2020-01-22 19:57:16 -08:00
committed by mobile promotions
parent f0fca24ffb
commit 6e91ecaae7

View File

@@ -205,7 +205,7 @@ static int gk20a_sched_dev_ioctl_get_params(struct gk20a *g,
arg->pid = tsg->tgid; /* kernel tgid corresponds to user pid */
arg->runlist_interleave = tsg->interleave_level;
arg->timeslice = tsg->timeslice_us;
arg->timeslice = gk20a_tsg_get_timeslice(tsg);
arg->graphics_preempt_mode =
tsg->gr_ctx.graphics_preempt_mode;