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
parent
9c15b4aacd
commit
c05049b420
|
@ -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, ¤t);
|
r = clock_gettime(CLOCK_MONOTONIC, ¤t);
|
||||||
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;
|
||||||
|
|
Loading…
Reference in New Issue