virgl: Remove wrong EAGAIN handling for drmIoctl

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)
This commit is contained in:
Lepton Wu
2019-09-04 11:53:37 -07:00
committed by Gurchetan Singh
parent f8c44e4ed7
commit 417d602fda

View File

@@ -467,10 +467,10 @@ static void virgl_drm_resource_wait(struct virgl_winsys *qws,
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);
}