gem_stress: add width/height arg to rendercpy functions
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 18 Jan 2012 16:46:00 +0000 (17:46 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 18 Jan 2012 16:46:00 +0000 (17:46 +0100)
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests/gem_stress.c
tests/gem_stress.h
tests/gem_stress_gen6.c
tests/gem_stress_i830.c
tests/gem_stress_i915.c

index ec66976..5b9b9a6 100644 (file)
@@ -305,14 +305,17 @@ static void render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned sr
        if (IS_GEN2(devid))
                gen2_render_copyfunc(batch,
                                     src, src_x, src_y,
+                                    options.tile_size, options.tile_size,
                                     dst, dst_x, dst_y);
        else if (IS_GEN3(devid))
                gen3_render_copyfunc(batch,
                                     src, src_x, src_y,
+                                    options.tile_size, options.tile_size,
                                     dst, dst_x, dst_y);
        else if (IS_GEN6(devid))
                gen6_render_copyfunc(batch,
                                     src, src_x, src_y,
+                                    options.tile_size, options.tile_size,
                                     dst, dst_x, dst_y);
        else
                blitter_copyfunc(src, src_x, src_y,
index 057ae29..82e8a57 100644 (file)
@@ -84,10 +84,13 @@ static inline unsigned buf_height(struct scratch_buf *buf)
 
 void gen6_render_copyfunc(struct intel_batchbuffer *batch,
                          struct scratch_buf *src, unsigned src_x, unsigned src_y,
+                         unsigned width, unsigned height,
                          struct scratch_buf *dst, unsigned dst_x, unsigned dst_y);
 void gen3_render_copyfunc(struct intel_batchbuffer *batch,
                          struct scratch_buf *src, unsigned src_x, unsigned src_y,
+                         unsigned width, unsigned height,
                          struct scratch_buf *dst, unsigned dst_x, unsigned dst_y);
 void gen2_render_copyfunc(struct intel_batchbuffer *batch,
                          struct scratch_buf *src, unsigned src_x, unsigned src_y,
+                         unsigned width, unsigned height,
                          struct scratch_buf *dst, unsigned dst_x, unsigned dst_y);
index 9f2e678..e6cdd55 100644 (file)
@@ -530,6 +530,7 @@ static uint32_t gen6_emit_primitive(struct intel_batchbuffer *batch)
 
 void gen6_render_copyfunc(struct intel_batchbuffer *batch,
                          struct scratch_buf *src, unsigned src_x, unsigned src_y,
+                         unsigned width, unsigned height,
                          struct scratch_buf *dst, unsigned dst_x, unsigned dst_y)
 {
        uint32_t wm_state, wm_kernel, wm_table;
@@ -581,13 +582,13 @@ void gen6_render_copyfunc(struct intel_batchbuffer *batch,
        *(uint32_t*)(batch->buffer + offset) =
                batch_round_upto(batch, VERTEX_SIZE)/VERTEX_SIZE;
 
-       emit_vertex_2s(batch, dst_x + options.tile_size, dst_y + options.tile_size);
-       emit_vertex_normalized(batch, src_x + options.tile_size, buf_width(src));
-       emit_vertex_normalized(batch, src_y + options.tile_size, buf_height(src));
+       emit_vertex_2s(batch, dst_x + width, dst_y + height);
+       emit_vertex_normalized(batch, src_x + width, buf_width(src));
+       emit_vertex_normalized(batch, src_y + height, buf_height(src));
 
-       emit_vertex_2s(batch, dst_x, dst_y + options.tile_size);
+       emit_vertex_2s(batch, dst_x, dst_y + height);
        emit_vertex_normalized(batch, src_x, buf_width(src));
-       emit_vertex_normalized(batch, src_y + options.tile_size, buf_height(src));
+       emit_vertex_normalized(batch, src_y + height, buf_height(src));
 
        emit_vertex_2s(batch, dst_x, dst_y);
        emit_vertex_normalized(batch, src_x, buf_width(src));
index d336e69..dfd706c 100644 (file)
@@ -54,6 +54,7 @@
 
 void gen2_render_copyfunc(struct intel_batchbuffer *batch,
                          struct scratch_buf *src, unsigned src_x, unsigned src_y,
+                         unsigned width, unsigned height,
                          struct scratch_buf *dst, unsigned dst_x, unsigned dst_y)
 {
        static unsigned keep_gpu_busy_counter = 0;
@@ -330,15 +331,15 @@ void gen2_render_copyfunc(struct intel_batchbuffer *batch,
        }
 
        OUT_BATCH(PRIM3D_INLINE | PRIM3D_RECTLIST | (3*4 -1));
-       emit_vertex(batch, dst_x + options.tile_size);
-       emit_vertex(batch, dst_y + options.tile_size);
-       emit_vertex_normalized(batch, src_x + options.tile_size, buf_width(src));
-       emit_vertex_normalized(batch, src_y + options.tile_size, buf_height(src));
+       emit_vertex(batch, dst_x + width);
+       emit_vertex(batch, dst_y + height);
+       emit_vertex_normalized(batch, src_x + width, buf_width(src));
+       emit_vertex_normalized(batch, src_y + height, buf_height(src));
 
        emit_vertex(batch, dst_x);
-       emit_vertex(batch, dst_y + options.tile_size);
+       emit_vertex(batch, dst_y + height);
        emit_vertex_normalized(batch, src_x, buf_width(src));
-       emit_vertex_normalized(batch, src_y + options.tile_size, buf_height(src));
+       emit_vertex_normalized(batch, src_y + height, buf_height(src));
 
        emit_vertex(batch, dst_x);
        emit_vertex(batch, dst_y);
index e202ff3..75d797f 100644 (file)
@@ -4,6 +4,7 @@
 
 void gen3_render_copyfunc(struct intel_batchbuffer *batch,
                          struct scratch_buf *src, unsigned src_x, unsigned src_y,
+                         unsigned width, unsigned height,
                          struct scratch_buf *dst, unsigned dst_x, unsigned dst_y)
 {
        static unsigned keep_gpu_busy_counter = 0;
@@ -166,15 +167,15 @@ void gen3_render_copyfunc(struct intel_batchbuffer *batch,
        }
 
        OUT_BATCH(PRIM3D_RECTLIST | (3*4 - 1));
-       emit_vertex(batch, dst_x + options.tile_size);
-       emit_vertex(batch, dst_y + options.tile_size);
-       emit_vertex(batch, src_x + options.tile_size);
-       emit_vertex(batch, src_y + options.tile_size);
+       emit_vertex(batch, dst_x + width);
+       emit_vertex(batch, dst_y + height);
+       emit_vertex(batch, src_x + width);
+       emit_vertex(batch, src_y + height);
 
        emit_vertex(batch, dst_x);
-       emit_vertex(batch, dst_y + options.tile_size);
+       emit_vertex(batch, dst_y + height);
        emit_vertex(batch, src_x);
-       emit_vertex(batch, src_y + options.tile_size);
+       emit_vertex(batch, src_y + height);
 
        emit_vertex(batch, dst_x);
        emit_vertex(batch, dst_y);