summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
diff options
context:
space:
mode:
authorThomas Fleury <tfleury@nvidia.com>2017-01-09 13:54:36 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-16 15:15:23 -0500
commitf6a634ff24194ee83579f90ab399a08d91df233a (patch)
tree56e87309729a5e926ef2fd30bb8ede2abbd23da7 /drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
parentbb5a9e1c6cfbe69b8a984439a092db7a1a75a405 (diff)
gpu: nvgpu: use HAL to set TSG timeslice
Setting timeslice for virtualized case was not effective, because both ioctls NVGPU_TSG_IOCTL_SET_TIMESLICE and NVGPU_SCHED_IOCTL_TSG_SET_TIMESLICE were calling the native function to set TSG timeslice. - Fixed wrapper function to call HAL - Defined HAL function for "native" set TSG timeslice - Also, properly update timeout_us in TSG context, in virtualized case. This change also moves the min/max bounds checking for tsg timeslice into the native function implementation. There is no sysfs node for these parameters for vgpu, as RM server is ultimately responsible for this check. Bug 200263575 Change-Id: Ibceab9427561ad58ec28abfff0c96ca8f592bdb9 Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: http://git-master/r/1283180 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fifo_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fifo_gk20a.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
index ccc3afca..2daeb1d0 100644
--- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A Graphics FIFO (gr host) 2 * GK20A Graphics FIFO (gr host)
3 * 3 *
4 * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -2870,6 +2870,22 @@ int gk20a_fifo_set_runlist_interleave(struct gk20a *g,
2870 return 0; 2870 return 0;
2871} 2871}
2872 2872
2873int gk20a_fifo_tsg_set_timeslice(struct tsg_gk20a *tsg, u32 timeslice)
2874{
2875 struct gk20a *g = tsg->g;
2876
2877 if (timeslice < g->min_timeslice_us ||
2878 timeslice > g->max_timeslice_us)
2879 return -EINVAL;
2880
2881 gk20a_channel_get_timescale_from_timeslice(g, timeslice,
2882 &tsg->timeslice_timeout, &tsg->timeslice_scale);
2883
2884 tsg->timeslice_us = timeslice;
2885
2886 return g->ops.fifo.update_runlist(g, tsg->runlist_id, ~0, true, true);
2887}
2888
2873static int gk20a_fifo_update_runlist_locked(struct gk20a *g, u32 runlist_id, 2889static int gk20a_fifo_update_runlist_locked(struct gk20a *g, u32 runlist_id,
2874 u32 hw_chid, bool add, 2890 u32 hw_chid, bool add,
2875 bool wait_for_finish) 2891 bool wait_for_finish)
@@ -3296,6 +3312,7 @@ void gk20a_init_fifo(struct gpu_ops *gops)
3296 gops->fifo.get_num_fifos = gk20a_fifo_get_num_fifos; 3312 gops->fifo.get_num_fifos = gk20a_fifo_get_num_fifos;
3297 gops->fifo.get_pbdma_signature = gk20a_fifo_get_pbdma_signature; 3313 gops->fifo.get_pbdma_signature = gk20a_fifo_get_pbdma_signature;
3298 gops->fifo.set_runlist_interleave = gk20a_fifo_set_runlist_interleave; 3314 gops->fifo.set_runlist_interleave = gk20a_fifo_set_runlist_interleave;
3315 gops->fifo.tsg_set_timeslice = gk20a_fifo_tsg_set_timeslice;
3299 gops->fifo.force_reset_ch = gk20a_fifo_force_reset_ch; 3316 gops->fifo.force_reset_ch = gk20a_fifo_force_reset_ch;
3300 gops->fifo.engine_enum_from_type = gk20a_fifo_engine_enum_from_type; 3317 gops->fifo.engine_enum_from_type = gk20a_fifo_engine_enum_from_type;
3301 /* gk20a doesn't support device_info_data packet parsing */ 3318 /* gk20a doesn't support device_info_data packet parsing */