summaryrefslogtreecommitdiff
path: root/amdgpu
diff options
context:
space:
mode:
authorTom St Denis <tom.stdenis@amd.com>2015-11-17 10:58:36 -0500
committerAlex Deucher <alexander.deucher@amd.com>2015-11-20 19:21:48 -0500
commitc05049b4205e446a2e319ab620a5ca949c7a7380 (patch)
tree4743f60c725ffd8687e0eaa77813e23c3b275c11 /amdgpu
parent9c15b4aacdd9265339aba6febd36a7e2c41b6968 (diff)
amdgpu: Make amdgpu_cs_calculate_timeout() return something sensible on error
Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'amdgpu')
-rw-r--r--amdgpu/amdgpu_cs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index aa594c44..6747158c 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -291,8 +291,10 @@ drm_private uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout)
struct timespec current;
uint64_t current_ns;
r = clock_gettime(CLOCK_MONOTONIC, &current);
- if (r)
- return r;
+ if (r) {
+ fprintf(stderr, "clock_gettime() returned error (%d)!", errno);
+ return AMDGPU_TIMEOUT_INFINITE;
+ }
current_ns = ((uint64_t)current.tv_sec) * 1000000000ull;
current_ns += current.tv_nsec;