[PATCH 2/2] amdgpu: Make amdgpu_cs_calculate_timeout() return something sensible on error
Alex Deucher
alexdeucher at gmail.com
Fri Nov 20 16:24:14 PST 2015
From: Tom St Denis <tom.stdenis at amd.com>
Signed-off-by: Tom St Denis <tom.stdenis at amd.com>
Reviewed-by: Christian König <christian.koenig at amd.com>
---
amdgpu/amdgpu_cs.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index aa594c4..6747158 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, ¤t);
- 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;
--
1.8.3.1
More information about the dri-devel
mailing list