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/channel_gk20a.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') 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 @@ #define NVMAP_HANDLE_PARAM_SIZE 1 -#define NVGPU_CHANNEL_MIN_TIMESLICE_US 1000 -#define NVGPU_CHANNEL_MAX_TIMESLICE_US 50000 - /* * Although channels do have pointers back to the gk20a struct that they were * 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) int gk20a_channel_set_timeslice(struct channel_gk20a *ch, u32 timeslice) { + struct gk20a *g = ch->g; + if (gk20a_is_channel_marked_as_tsg(ch)) { gk20a_err(dev_from_gk20a(ch->g), "invalid operation for TSG!\n"); return -EINVAL; } - if (timeslice < NVGPU_CHANNEL_MIN_TIMESLICE_US || - timeslice > NVGPU_CHANNEL_MAX_TIMESLICE_US) + if (timeslice < g->min_timeslice_us || + timeslice > g->max_timeslice_us) return -EINVAL; ch->timeslice_us = timeslice; -- cgit v1.2.2