radv: Fix timeout handling in syncobj wait.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 30 Oct 2019 20:58:42 +0000 (21:58 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 30 Oct 2019 23:48:17 +0000 (00:48 +0100)
libdrm returns -errno instead of directly the ioctl ret of -1.

Fixes: 1c3cda7d277 "radv: Add syncobj signal/reset/wait to winsys."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c

index 0c521917027b078d65a1dc163258b14f590a5307..676dd062ff3b5cdb5a63bf82026833a1b4dd99f8 100644 (file)
@@ -1582,7 +1582,7 @@ static bool radv_amdgpu_wait_syncobj(struct radeon_winsys *_ws, const uint32_t *
                                         &tmp);
        if (ret == 0) {
                return true;
-       } else if (ret == -1 && errno == ETIME) {
+       } else if (ret == -ETIME) {
                return false;
        } else {
                fprintf(stderr, "amdgpu: radv_amdgpu_wait_syncobj failed!\nerrno: %d\n", errno);