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>
main
Michel Dänzer 2015-07-14 12:42:19 +09:00 committed by Alex Deucher
parent 5463d2e83a
commit 95ecf91c7b
1 changed files with 2 additions and 6 deletions

View File

@ -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;