<div dir="ltr">On Sun, Oct 12, 2014 at 1:21 AM, Chia-I Wu <span dir="ltr"><<a href="mailto:olvaffe@gmail.com" target="_blank">olvaffe@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">When timeout_ns is negative, it really means to wait indefinitely instead of<br>
returning immediately. But since userspace can no longer rely on that, I am<br>
not sure if there is any point fixing it.<br></blockquote><div>Note that userspace may use GL_TIMEOUT_IGNORED for timeout_ns to wait indefinitely. The macro is defined to<br><br>#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull<br><br></div><div>Prior to 3.17, the kernel would behave as expected. But on 3.17, it would return immediately with -ETIME if the bo is busy.<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Signed-off-by: Chia-I Wu <<a href="mailto:olvaffe@gmail.com">olvaffe@gmail.com</a>><br>
---<br>
drivers/gpu/drm/i915/i915_gem.c | 7 ++++---<br>
1 file changed, 4 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c<br>
index ad55b06..3da2d62 100644<br>
--- a/drivers/gpu/drm/i915/i915_gem.c<br>
+++ b/drivers/gpu/drm/i915/i915_gem.c<br>
@@ -2787,9 +2787,9 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file)<br>
goto out;<br>
<br>
/* Do this after OLR check to make sure we make forward progress polling<br>
- * on this IOCTL with a timeout <=0 (like busy ioctl)<br>
+ * on this IOCTL with a timeout == 0 (like busy ioctl)<br>
*/<br>
- if (args->timeout_ns <= 0) {<br>
+ if (args->timeout_ns == 0) {<br>
ret = -ETIME;<br>
goto out;<br>
}<br>
@@ -2798,7 +2798,8 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file)<br>
reset_counter = atomic_read(&dev_priv->gpu_error.reset_counter);<br>
mutex_unlock(&dev->struct_mutex);<br>
<br>
- return __wait_seqno(ring, seqno, reset_counter, true, &args->timeout_ns,<br>
+ return __wait_seqno(ring, seqno, reset_counter, true,<br>
+ (args->timeout_ns > 0) ? &args->timeout_ns : NULL,<br>
file->driver_priv);<br>
<br>
out:<br>
<span class=""><font color="#888888">--<br>
2.1.1<br>
<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>olv@LunarG.com
</div></div>