diff options
author | Alex Waterman <alexw@nvidia.com> | 2016-12-16 15:29:34 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-01-18 19:46:33 -0500 |
commit | 6e2237ef622113b8fa1149aa48988a99fa30594f (patch) | |
tree | 1356c45dda5751f7094f37aa93019f1199b635fb /drivers/gpu/nvgpu/gk20a/cde_gk20a.c | |
parent | 8f5a42c4bf9c323b86452065d39ed7632b126561 (diff) |
gpu: nvgpu: Use timer API in gk20a code
Use the timers API in the gk20a code instead of Linux specific
API calls.
This also changes the behavior of several functions to wait for
the full timeout for each operation that can timeout. Previously
the timeout was shared across each operation.
Bug 1799159
Change-Id: I2bbed54630667b2b879b56a63a853266afc1e5d8
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1273826
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/cde_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/cde_gk20a.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c index e4bb2a57..7b81f5e8 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Color decompression engine support | 2 | * Color decompression engine support |
3 | * | 3 | * |
4 | * Copyright (c) 2014-2016, NVIDIA Corporation. All rights reserved. | 4 | * Copyright (c) 2014-2017, NVIDIA Corporation. All rights reserved. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms and conditions of the GNU General Public License, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | #include <trace/events/gk20a.h> | 25 | #include <trace/events/gk20a.h> |
26 | 26 | ||
27 | #include <nvgpu/timers.h> | ||
28 | |||
27 | #include "gk20a.h" | 29 | #include "gk20a.h" |
28 | #include "channel_gk20a.h" | 30 | #include "channel_gk20a.h" |
29 | #include "mm_gk20a.h" | 31 | #include "mm_gk20a.h" |
@@ -864,7 +866,10 @@ __acquires(&cde_app->mutex) | |||
864 | { | 866 | { |
865 | struct gk20a_cde_app *cde_app = &g->cde_app; | 867 | struct gk20a_cde_app *cde_app = &g->cde_app; |
866 | struct gk20a_cde_ctx *cde_ctx = NULL; | 868 | struct gk20a_cde_ctx *cde_ctx = NULL; |
867 | unsigned long end = jiffies + msecs_to_jiffies(MAX_CTX_RETRY_TIME); | 869 | struct nvgpu_timeout timeout; |
870 | |||
871 | nvgpu_timeout_init(g, &timeout, MAX_CTX_RETRY_TIME, | ||
872 | NVGPU_TIMER_CPU_TIMER); | ||
868 | 873 | ||
869 | do { | 874 | do { |
870 | cde_ctx = gk20a_cde_do_get_context(g); | 875 | cde_ctx = gk20a_cde_do_get_context(g); |
@@ -875,7 +880,7 @@ __acquires(&cde_app->mutex) | |||
875 | mutex_unlock(&cde_app->mutex); | 880 | mutex_unlock(&cde_app->mutex); |
876 | cond_resched(); | 881 | cond_resched(); |
877 | mutex_lock(&cde_app->mutex); | 882 | mutex_lock(&cde_app->mutex); |
878 | } while (time_before(jiffies, end)); | 883 | } while (!nvgpu_timeout_expired(&timeout)); |
879 | 884 | ||
880 | return cde_ctx; | 885 | return cde_ctx; |
881 | } | 886 | } |