diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 9 |
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 | ||
3346 | int gk20a_channel_set_timeslice(struct channel_gk20a *ch, u32 timeslice) | 3343 | int 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; |