From 417d602fdad22042ff1f90176f10c486a3bb0e9a Mon Sep 17 00:00:00 2001 From: Lepton Wu Date: Wed, 4 Sep 2019 11:53:37 -0700 Subject: [PATCH] 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 Reviewed-by: Eric Anholt (v1) --- src/gallium/winsys/virgl/drm/virgl_drm_winsys.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c index 8f557bd06c1..cc4371fb5fd 100644 --- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c +++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c @@ -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); } -- 2.30.2