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>
main
Tom St Denis 2015-11-17 10:58:36 -05:00 committed by Alex Deucher
parent 9c15b4aacd
commit c05049b420
1 changed files with 4 additions and 2 deletions

View File

@ -291,8 +291,10 @@ drm_private uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout)
struct timespec current; struct timespec current;
uint64_t current_ns; uint64_t current_ns;
r = clock_gettime(CLOCK_MONOTONIC, &current); r = clock_gettime(CLOCK_MONOTONIC, &current);
if (r) if (r) {
return r; fprintf(stderr, "clock_gettime() returned error (%d)!", errno);
return AMDGPU_TIMEOUT_INFINITE;
}
current_ns = ((uint64_t)current.tv_sec) * 1000000000ull; current_ns = ((uint64_t)current.tv_sec) * 1000000000ull;
current_ns += current.tv_nsec; current_ns += current.tv_nsec;