From f15a86f26527505cbe0de96ecb56736eb1686b87 Mon Sep 17 00:00:00 2001 From: Peter Boonstoppel Date: Mon, 28 Nov 2016 17:33:30 -0800 Subject: 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 Reviewed-on: http://git-master/r/1280372 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/tsg_gk20a.c') 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 @@ /* - * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -26,9 +26,6 @@ #include -#define NVGPU_TSG_MIN_TIMESLICE_US 1000 -#define NVGPU_TSG_MAX_TIMESLICE_US 50000 - struct tsg_private { struct gk20a *g; struct tsg_gk20a *tsg; @@ -367,8 +364,8 @@ int gk20a_tsg_set_timeslice(struct tsg_gk20a *tsg, u32 timeslice) { struct gk20a *g = tsg->g; - if (timeslice < NVGPU_TSG_MIN_TIMESLICE_US || - timeslice > NVGPU_TSG_MAX_TIMESLICE_US) + if (timeslice < g->min_timeslice_us || + timeslice > g->max_timeslice_us) return -EINVAL; gk20a_channel_get_timescale_from_timeslice(g, timeslice, -- cgit v1.2.2