summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2015-07-14 12:42:19 +0900
committerMichel Dänzer <michel@daenzer.net>2015-07-15 11:17:51 +0900
commit70d4170339894adf446e1a6629514e3349b643f6 (patch)
treedfaaa04d135aad4c22959943bd1e32b8ba99cd28
parent2b14aea8a62546bfa373f75e455700ea0296105d (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> (cherry picked from commit d81d53ef349867a3e50cf6a4d0d58390948dcb4b)
-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 15645274..67212289 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;