Commit f5e63b12 authored by Chris Wilson's avatar Chris Wilson

test: Add more gen3 render blitters

... and we have a winner: gen3_mixed_blits reproduces the issue Daniel
Vetter originally found. It seems clear that we have some incoherence
between the RENDER and BLT units on gen3 that no amount of MI_FLUSH can
hide. Hmmm....
Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent 20b69039
...@@ -59,6 +59,8 @@ tests/gem_stress ...@@ -59,6 +59,8 @@ tests/gem_stress
tests/gen3_render_linear_blits tests/gen3_render_linear_blits
tests/gen3_render_tiledx_blits tests/gen3_render_tiledx_blits
tests/gen3_render_tiledy_blits tests/gen3_render_tiledy_blits
tests/gen3_render_mixed_blits
tests/gen3_mixed_blits
tools/intel_disable_clock_gating tools/intel_disable_clock_gating
tools/intel_dump_decode tools/intel_dump_decode
tools/intel_error_decode tools/intel_error_decode
......
...@@ -37,6 +37,8 @@ TESTS = getversion \ ...@@ -37,6 +37,8 @@ TESTS = getversion \
gen3_render_linear_blits \ gen3_render_linear_blits \
gen3_render_tiledx_blits \ gen3_render_tiledx_blits \
gen3_render_tiledy_blits \ gen3_render_tiledy_blits \
gen3_render_mixed_blits \
gen3_mixed_blits \
$(NULL) $(NULL)
HANG = \ HANG = \
......
...@@ -211,7 +211,6 @@ static void cpu_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_y ...@@ -211,7 +211,6 @@ static void cpu_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_y
if (options.use_cpu_maps) { if (options.use_cpu_maps) {
set_to_cpu_domain(src, 0); set_to_cpu_domain(src, 0);
set_to_cpu_domain(dst, 1); set_to_cpu_domain(dst, 1);
} }
cpucpy2d(src->data, src->stride/sizeof(uint32_t), src_x, src_y, cpucpy2d(src->data, src->stride/sizeof(uint32_t), src_x, src_y,
......
...@@ -91,8 +91,7 @@ void gen3_render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_ ...@@ -91,8 +91,7 @@ void gen3_render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_
OUT_BATCH(MIPFILTER_NONE << SS2_MIP_FILTER_SHIFT | OUT_BATCH(MIPFILTER_NONE << SS2_MIP_FILTER_SHIFT |
FILTER_NEAREST << SS2_MAG_FILTER_SHIFT | FILTER_NEAREST << SS2_MAG_FILTER_SHIFT |
FILTER_NEAREST << SS2_MIN_FILTER_SHIFT); FILTER_NEAREST << SS2_MIN_FILTER_SHIFT);
OUT_BATCH(SS3_NORMALIZED_COORDS | OUT_BATCH(TEXCOORDMODE_WRAP << SS3_TCX_ADDR_MODE_SHIFT |
TEXCOORDMODE_WRAP << SS3_TCX_ADDR_MODE_SHIFT |
TEXCOORDMODE_WRAP << SS3_TCY_ADDR_MODE_SHIFT | TEXCOORDMODE_WRAP << SS3_TCY_ADDR_MODE_SHIFT |
0 << SS3_TEXTUREMAP_INDEX_SHIFT); 0 << SS3_TEXTUREMAP_INDEX_SHIFT);
OUT_BATCH(0x00000000); OUT_BATCH(0x00000000);
...@@ -128,20 +127,15 @@ void gen3_render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_ ...@@ -128,20 +127,15 @@ void gen3_render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_
/* texfmt */ /* texfmt */
{ {
uint32_t ss2 = ~0; OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 |
ss2 &= ~S2_TEXCOORD_FMT(0, TEXCOORDFMT_NOT_PRESENT); I1_LOAD_S(1) | I1_LOAD_S(2) | I1_LOAD_S(6) | 2);
ss2 |= S2_TEXCOORD_FMT(0, TEXCOORDFMT_2D); OUT_BATCH((4 << S1_VERTEX_WIDTH_SHIFT) |
OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(2) | I1_LOAD_S(6) | 1); (4 << S1_VERTEX_PITCH_SHIFT));
OUT_BATCH(ss2); OUT_BATCH(~S2_TEXCOORD_FMT(0, TEXCOORDFMT_NOT_PRESENT) | S2_TEXCOORD_FMT(0, TEXCOORDFMT_2D));
OUT_BATCH(S6_CBUF_BLEND_ENABLE | S6_COLOR_WRITE_ENABLE | OUT_BATCH(S6_CBUF_BLEND_ENABLE | S6_COLOR_WRITE_ENABLE |
BLENDFUNC_ADD << S6_CBUF_BLEND_FUNC_SHIFT | BLENDFUNC_ADD << S6_CBUF_BLEND_FUNC_SHIFT |
BLENDFACT_ONE << S6_CBUF_SRC_BLEND_FACT_SHIFT | BLENDFACT_ONE << S6_CBUF_SRC_BLEND_FACT_SHIFT |
BLENDFACT_ZERO << S6_CBUF_DST_BLEND_FACT_SHIFT); BLENDFACT_ZERO << S6_CBUF_DST_BLEND_FACT_SHIFT);
OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 |
I1_LOAD_S(0) | I1_LOAD_S(1) | 1);
OUT_BATCH(0); /* no vbo */
OUT_BATCH((4 << S1_VERTEX_WIDTH_SHIFT) |
(4 << S1_VERTEX_PITCH_SHIFT));
} }
/* frage shader */ /* frage shader */
...@@ -174,18 +168,18 @@ void gen3_render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_ ...@@ -174,18 +168,18 @@ void gen3_render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_
OUT_BATCH(PRIM3D_RECTLIST | (3*4 - 1)); OUT_BATCH(PRIM3D_RECTLIST | (3*4 - 1));
emit_vertex(dst_x + TILE_SIZE); emit_vertex(dst_x + TILE_SIZE);
emit_vertex(dst_y + TILE_SIZE); emit_vertex(dst_y + TILE_SIZE);
emit_vertex_normalized(src_x + TILE_SIZE, buf_width(src)); emit_vertex(src_x + TILE_SIZE);
emit_vertex_normalized(src_y + TILE_SIZE, buf_height(src)); emit_vertex(src_y + TILE_SIZE);
emit_vertex(dst_x); emit_vertex(dst_x);
emit_vertex(dst_y + TILE_SIZE); emit_vertex(dst_y + TILE_SIZE);
emit_vertex_normalized(src_x, buf_width(src)); emit_vertex(src_x);
emit_vertex_normalized(src_y + TILE_SIZE, buf_height(src)); emit_vertex(src_y + TILE_SIZE);
emit_vertex(dst_x); emit_vertex(dst_x);
emit_vertex(dst_y); emit_vertex(dst_y);
emit_vertex_normalized(src_x, buf_width(src)); emit_vertex(src_x);
emit_vertex_normalized(src_y, buf_height(src)); emit_vertex(src_y);
if (!(keep_gpu_busy_counter & 1)) if (!(keep_gpu_busy_counter & 1))
keep_gpu_busy(); keep_gpu_busy();
...@@ -194,4 +188,3 @@ void gen3_render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_ ...@@ -194,4 +188,3 @@ void gen3_render_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned src_
intel_batchbuffer_flush(batch); intel_batchbuffer_flush(batch);
} }
This diff is collapsed.
This diff is collapsed.
...@@ -438,45 +438,52 @@ int main(int argc, char **argv) ...@@ -438,45 +438,52 @@ int main(int argc, char **argv)
start += 1024 * 1024 / 4; start += 1024 * 1024 / 4;
} }
printf("Verifying initialisation...\n"); printf("Verifying initialisation..."); fflush(stdout);
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
check_bo(fd, handle[i], start_val[i]); check_bo(fd, handle[i], start_val[i]);
printf("done\n");
printf("Cyclic blits, forward...\n"); printf("Cyclic blits, forward..."); fflush(stdout);
for (i = 0; i < count * 4; i++) { for (i = 0; i < count * 32; i++) {
int src = i % count; int src = i % count;
int dst = (i + 1) % count; int dst = (i + 1) % count;
copy(fd, handle[dst], handle[src]); copy(fd, handle[dst], handle[src]);
start_val[dst] = start_val[src]; start_val[dst] = start_val[src];
} }
printf("verifying..."); fflush(stdout);
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
check_bo(fd, handle[i], start_val[i]); check_bo(fd, handle[i], start_val[i]);
printf("done\n");
printf("Cyclic blits, backward...\n"); printf("Cyclic blits, backward..."); fflush(stdout);
for (i = 0; i < count * 4; i++) { for (i = 0; i < count * 32; i++) {
int src = (i + 1) % count; int src = (i + 1) % count;
int dst = i % count; int dst = i % count;
copy(fd, handle[dst], handle[src]); copy(fd, handle[dst], handle[src]);
start_val[dst] = start_val[src]; start_val[dst] = start_val[src];
} }
printf("verifying..."); fflush(stdout);
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
check_bo(fd, handle[i], start_val[i]); check_bo(fd, handle[i], start_val[i]);
printf("done\n");
printf("Random blits...\n"); printf("Random blits..."); fflush(stdout);
for (i = 0; i < count * 4; i++) { for (i = 0; i < count * 32; i++) {
int src = random() % count; int src = random() % count;
int dst = random() % count; int dst = random() % count;
if (src == dst) while (src == dst)
continue; dst = random() % count;
copy(fd, handle[dst], handle[src]); copy(fd, handle[dst], handle[src]);
start_val[dst] = start_val[src]; start_val[dst] = start_val[src];
} }
printf("verifying..."); fflush(stdout);
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
check_bo(fd, handle[i], start_val[i]); check_bo(fd, handle[i], start_val[i]);
printf("done\n");
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment