virgl: fix checking fences
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 7 Jun 2016 12:54:34 +0000 (14:54 +0200)
committerDave Airlie <airlied@redhat.com>
Thu, 9 Jun 2016 04:07:53 +0000 (14:07 +1000)
When calling virgl_fence_wait() with timeout=0,
virgl_{drm,vtest}_resource_is_busy() is called. However, it returns TRUE
for a busy resource, whereace virgl_fence_wait() should return TRUE for
a completed (non-busy) resource.

This fixes running supertuxkart in a VM (I could not reproduce locally
with vtest though there is a similar fix)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: "11.1 11.2 12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c

index c77b8994291b9cf58c25e8ea35c68c9aa8266b34..81afa8487323a7fe81066819a11ac75395f5251a 100644 (file)
@@ -734,7 +734,7 @@ static bool virgl_fence_wait(struct virgl_winsys *vws,
    struct virgl_hw_res *res = virgl_hw_res(fence);
 
    if (timeout == 0)
-      return virgl_drm_resource_is_busy(vdws, res);
+      return !virgl_drm_resource_is_busy(vdws, res);
 
    if (timeout != PIPE_TIMEOUT_INFINITE) {
       int64_t start_time = os_time_get();
index 9c9ec04459101c94cd6966f04858ee5c057895f8..ce8ac97756fca6ce1285a4e670197e0bd6987a92 100644 (file)
@@ -544,7 +544,7 @@ static bool virgl_fence_wait(struct virgl_winsys *vws,
    struct virgl_hw_res *res = virgl_hw_res(fence);
 
    if (timeout == 0)
-      return virgl_vtest_resource_is_busy(vdws, res);
+      return !virgl_vtest_resource_is_busy(vdws, res);
 
    if (timeout != PIPE_TIMEOUT_INFINITE) {
       int64_t start_time = os_time_get();