virgl: Remove wrong EAGAIN handling for drmIoctl
authorLepton Wu <lepton@chromium.org>
Wed, 4 Sep 2019 18:53:37 +0000 (11:53 -0700)
committerGurchetan Singh <gurchetansingh@chromium.org>
Wed, 18 Sep 2019 03:36:10 +0000 (03:36 +0000)
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)
src/gallium/winsys/virgl/drm/virgl_drm_winsys.c

index 8f557bd06c14b48303d3bc2cd58622c4728c34b1..cc4371fb5fdd201f307bc9a3e11c3cc90fa7046a 100644 (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);
 }