summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorPeter Boonstoppel <pboonstoppel@nvidia.com>2016-11-28 20:33:30 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-12 11:23:56 -0500
commitf15a86f26527505cbe0de96ecb56736eb1686b87 (patch)
treed37b7334a3fa8170dacb13f6586697a9d896b119 /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parent09dba979a85855d4bdfafbb4bf18eefab3d71099 (diff)
gpu: nvgpu: Add sysfs nodes for timeslice min/max
The timeslice values that can be selected for a particular channel/tsg are bounded by a static min/max. This change introduces two sysfs nodes that allow these bounds to be configured from userspace. min_timeslice_us max_timeslice_us Bug 200251974 Bug 1854791 Change-Id: I5d5a14225eee4090e418c7e43629324114f60768 Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Reviewed-on: http://git-master/r/1280372 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 40d6d91c..6cbbdeb0 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -44,9 +44,6 @@
44 44
45#define NVMAP_HANDLE_PARAM_SIZE 1 45#define NVMAP_HANDLE_PARAM_SIZE 1
46 46
47#define NVGPU_CHANNEL_MIN_TIMESLICE_US 1000
48#define NVGPU_CHANNEL_MAX_TIMESLICE_US 50000
49
50/* 47/*
51 * Although channels do have pointers back to the gk20a struct that they were 48 * Although channels do have pointers back to the gk20a struct that they were
52 * created under in cases where the driver is killed that pointer can be bad. 49 * created under in cases where the driver is killed that pointer can be bad.
@@ -3345,14 +3342,16 @@ int gk20a_channel_set_priority(struct channel_gk20a *ch, u32 priority)
3345 3342
3346int gk20a_channel_set_timeslice(struct channel_gk20a *ch, u32 timeslice) 3343int gk20a_channel_set_timeslice(struct channel_gk20a *ch, u32 timeslice)
3347{ 3344{
3345 struct gk20a *g = ch->g;
3346
3348 if (gk20a_is_channel_marked_as_tsg(ch)) { 3347 if (gk20a_is_channel_marked_as_tsg(ch)) {
3349 gk20a_err(dev_from_gk20a(ch->g), 3348 gk20a_err(dev_from_gk20a(ch->g),
3350 "invalid operation for TSG!\n"); 3349 "invalid operation for TSG!\n");
3351 return -EINVAL; 3350 return -EINVAL;
3352 } 3351 }
3353 3352
3354 if (timeslice < NVGPU_CHANNEL_MIN_TIMESLICE_US || 3353 if (timeslice < g->min_timeslice_us ||
3355 timeslice > NVGPU_CHANNEL_MAX_TIMESLICE_US) 3354 timeslice > g->max_timeslice_us)
3356 return -EINVAL; 3355 return -EINVAL;
3357 3356
3358 ch->timeslice_us = timeslice; 3357 ch->timeslice_us = timeslice;