summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/cde_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/cde_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/cde_gk20a.c11
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}