diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2015-07-14 12:42:19 +0900 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-08-05 13:47:52 -0400 |
commit | 95ecf91c7bb33a49093cfa2a19bc841c04b2707a (patch) | |
tree | 23d8ae0d30bdbb749ca623ad2518356fed77b032 /amdgpu | |
parent | 5463d2e83a450a0428f6c46561c5e2a54a229589 (diff) | |
download | libdrm-95ecf91c7bb33a49093cfa2a19bc841c04b2707a.tar.gz libdrm-95ecf91c7bb33a49093cfa2a19bc841c04b2707a.tar.bz2 libdrm-95ecf91c7bb33a49093cfa2a19bc841c04b2707a.zip |
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>
Diffstat (limited to 'amdgpu')
-rw-r--r-- | amdgpu/amdgpu_cs.c | 8 |
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; |