tests/gem_stress: Fix rendercopy vs. keep_gpu_busy on gen6+
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 28 Apr 2014 14:58:45 +0000 (17:58 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 28 Apr 2014 16:28:39 +0000 (19:28 +0300)
If the hardware has a blt ring blits aren't allowed on the render ring.
Trying to execute blits on the render ring results in a GPU hang.

Flush outstanding blits from keep_gpu_busy() before calling rendercopy()
so that they don't end up on the render ring.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
tests/gem_stress.c

index 4cbe8f4..e6a6ce6 100644 (file)
@@ -346,11 +346,16 @@ static void render_copyfunc(struct igt_buf *src, unsigned src_x, unsigned src_y,
        if (keep_gpu_busy_counter & 1)
                keep_gpu_busy();
 
-       if (rendercopy)
+       if (rendercopy) {
+               /*
+                * Flush outstanding blts so that they don't end up on
+                * the render ring when that's not allowed (gen6+).
+                */
+               intel_batchbuffer_flush(batch);
                rendercopy(batch, NULL, src, src_x, src_y,
                     options.tile_size, options.tile_size,
                     dst, dst_x, dst_y);
-       else
+       else
                blitter_copyfunc(src, src_x, src_y,
                                 dst, dst_x, dst_y,
                                 logical_tile_no);