<div dir="ltr"><div>I guess the patches should be for drivers/gpu/drm/amd/<span class="">amdgpu</span>/amdgpu_cs.c instead?<br><br></div><div>Regards<br></div>//Ernst<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-21 1:24 GMT+01:00 Alex Deucher <span dir="ltr"><<a href="mailto:alexdeucher@gmail.com" target="_blank">alexdeucher@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Jammy Zhou <<a href="mailto:Jammy.Zhou@amd.com">Jammy.Zhou@amd.com</a>><br>
<br>
Set the timeout to AMDGPU_TIMEOUT_INFINITE when overflow happens<br>
<br>
Signed-off-by: Jammy Zhou <<a href="mailto:Jammy.Zhou@amd.com">Jammy.Zhou@amd.com</a>><br>
Reviewed-by: Christian König <<a href="mailto:christian.koenig@amd.com">christian.koenig@amd.com</a>><br>
---<br>
amdgpu/amdgpu_cs.c | 8 ++++++--<br>
1 file changed, 6 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c<br>
index 4da9821..aa594c4 100644<br>
--- a/amdgpu/amdgpu_cs.c<br>
+++ b/amdgpu/amdgpu_cs.c<br>
@@ -289,12 +289,16 @@ drm_private uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout)<br>
<br>
if (timeout != AMDGPU_TIMEOUT_INFINITE) {<br>
struct timespec current;<br>
+ uint64_t current_ns;<br>
r = clock_gettime(CLOCK_MONOTONIC, ¤t);<br>
if (r)<br>
return r;<br>
<br>
- timeout += ((uint64_t)current.tv_sec) * 1000000000ull;<br>
- timeout += current.tv_nsec;<br>
+ current_ns = ((uint64_t)current.tv_sec) * 1000000000ull;<br>
+ current_ns += current.tv_nsec;<br>
+ timeout += current_ns;<br>
+ if (timeout < current_ns)<br>
+ timeout = AMDGPU_TIMEOUT_INFINITE;<br>
}<br>
return timeout;<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.1<br>
<br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</font></span></blockquote></div><br></div>