drmIoctl handles EAGAIN itself and actually it always return -1 on errors.
Remove the wrong handling of its return value. Also, print a warning when
it fails.
v2: - use _debug_printf instead of fprintf (Gurchetan Singh)
Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net> (v1)
memset(&waitcmd, 0, sizeof(waitcmd));
waitcmd.handle = res->bo_handle;
- again:
+
ret = drmIoctl(qdws->fd, DRM_IOCTL_VIRTGPU_WAIT, &waitcmd);
- if (ret == -EAGAIN)
- goto again;
+ if (ret)
+ _debug_printf("waiting got error - %d, slow gpu or hang?\n", errno);
p_atomic_set(&res->maybe_busy, false);
}