summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/tsg_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/tsg_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/tsg_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/tsg_gk20a.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
index 3b2cca0d..81a4b78e 100644
--- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -26,9 +26,6 @@
26 26
27#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h> 27#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h>
28 28
29#define NVGPU_TSG_MIN_TIMESLICE_US 1000
30#define NVGPU_TSG_MAX_TIMESLICE_US 50000
31
32struct tsg_private { 29struct tsg_private {
33 struct gk20a *g; 30 struct gk20a *g;
34 struct tsg_gk20a *tsg; 31 struct tsg_gk20a *tsg;
@@ -367,8 +364,8 @@ int gk20a_tsg_set_timeslice(struct tsg_gk20a *tsg, u32 timeslice)
367{ 364{
368 struct gk20a *g = tsg->g; 365 struct gk20a *g = tsg->g;
369 366
370 if (timeslice < NVGPU_TSG_MIN_TIMESLICE_US || 367 if (timeslice < g->min_timeslice_us ||
371 timeslice > NVGPU_TSG_MAX_TIMESLICE_US) 368 timeslice > g->max_timeslice_us)
372 return -EINVAL; 369 return -EINVAL;
373 370
374 gk20a_channel_get_timescale_from_timeslice(g, timeslice, 371 gk20a_channel_get_timescale_from_timeslice(g, timeslice,