summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2015-07-14 12:42:19 +0900
committerAlex Deucher <alexander.deucher@amd.com>2015-07-30 00:11:13 -0400
commitf690d969738c2e2e4340bf6d711fb9e6ef1c0f56 (patch)
tree22f57f8f345e07666e22694f1cd6471cfe39313d
parentac5ce45b5d8bf8a022efedba79a52f2bb6c37135 (diff)
amdgpu: Use drmIoctl in amdgpu_ioctl_wait_cs
This is safe now because the ioctl uses an absolute timeout. This prevents amdgpu_cs_query_fence_status from returning early e.g. when a signal is delivered, which in turn caused Mesa winsys code to assume a BO was idle when it actually wasn't yet. Reviewed-by: Christian König <christian.koenig@amd.com>
-rw-r--r--amdgpu/amdgpu_cs.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index 91a7b059..d9aa22d6 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -367,12 +367,8 @@ static int amdgpu_ioctl_wait_cs(amdgpu_context_handle context,
else
args.in.timeout = amdgpu_cs_calculate_timeout(timeout_ns);
- /* Handle errors manually here because of timeout */
- r = ioctl(dev->fd, DRM_IOCTL_AMDGPU_WAIT_CS, &args);
- if (r == -1 && (errno == EINTR || errno == EAGAIN)) {
- *busy = true;
- return 0;
- } else if (r)
+ r = drmIoctl(dev->fd, DRM_IOCTL_AMDGPU_WAIT_CS, &args);
+ if (r)
return -errno;
*busy = args.out.status;