v3d: Fix check for TFU job completion in the simulator.
authorEric Anholt <eric@anholt.net>
Wed, 19 Dec 2018 00:17:26 +0000 (16:17 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 19 Dec 2018 18:26:04 +0000 (10:26 -0800)
We're waiting for the jobs-completed count to increment (with wrapping),
not to reach its starting state.  This mostly ended up working out because
the next v3d_hw_tick() for a submit CL would end up doing the TFU
operation first, but it did fail when a blit was used for glReadPixels()
at the end of a test.

Fixes: ee0549ff9ab3 ("v3d: Add the V3D TFU submit interface to the simulator.")
src/gallium/drivers/v3d/v3dx_simulator.c

index d1bca66b52589b972606c8af1c9335b9bc60a2f3..940b8f2ce32562144c9aa4b995b650aec5b6aa68 100644 (file)
@@ -120,7 +120,7 @@ v3dX(simulator_submit_tfu_ioctl)(struct v3d_hw *v3d,
 
         V3D_WRITE(V3D_TFU_ICFG, args->icfg);
 
-        while ((V3D_READ(V3D_TFU_CS) & V3D_TFU_CS_CVTCT_SET) != last_vtct) {
+        while ((V3D_READ(V3D_TFU_CS) & V3D_TFU_CS_CVTCT_SET) == last_vtct) {
                 v3d_hw_tick(v3d);
         }