From d503bbbf3082b5b301019721466d6fd2b41da03a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 9 Jul 2015 16:30:26 +1000 Subject: [PATCH] r600g: add support for streams to the assembler. This just adds support to the assembler dumper and allows stream instructions to be generated. Also fix up the stream debugging to add stream info. Signed-off-by: Dave Airlie --- src/gallium/drivers/r600/eg_asm.c | 1 + src/gallium/drivers/r600/r600_asm.c | 2 ++ src/gallium/drivers/r600/r600_asm.h | 1 + src/gallium/drivers/r600/r600_shader.c | 6 ++++-- src/gallium/drivers/r600/sb/sb_bc_dump.cpp | 3 +++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r600/eg_asm.c b/src/gallium/drivers/r600/eg_asm.c index 42e8b0b..c32d317 100644 --- a/src/gallium/drivers/r600/eg_asm.c +++ b/src/gallium/drivers/r600/eg_asm.c @@ -115,6 +115,7 @@ int eg_bytecode_cf_build(struct r600_bytecode *bc, struct r600_bytecode_cf *cf) S_SQ_CF_WORD1_BARRIER(1) | S_SQ_CF_WORD1_COND(cf->cond) | S_SQ_CF_WORD1_POP_COUNT(cf->pop_count) | + S_SQ_CF_WORD1_COUNT(cf->count) | S_SQ_CF_WORD1_END_OF_PROGRAM(cf->end_of_program); } } diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c index b514c58..9b356ba 100644 --- a/src/gallium/drivers/r600/r600_asm.c +++ b/src/gallium/drivers/r600/r600_asm.c @@ -2029,6 +2029,8 @@ void r600_bytecode_disasm(struct r600_bytecode *bc) fprintf(stderr, "CND:%X ", cf->cond); if (cf->pop_count) fprintf(stderr, "POP:%X ", cf->pop_count); + if (cf->count && (cfop->flags & CF_EMIT)) + fprintf(stderr, "STREAM%d ", cf->count); if (cf->end_of_program) fprintf(stderr, "EOP "); fprintf(stderr, "\n"); diff --git a/src/gallium/drivers/r600/r600_asm.h b/src/gallium/drivers/r600/r600_asm.h index e37d926..b282907 100644 --- a/src/gallium/drivers/r600/r600_asm.h +++ b/src/gallium/drivers/r600/r600_asm.h @@ -149,6 +149,7 @@ struct r600_bytecode_cf { unsigned id; unsigned cond; unsigned pop_count; + unsigned count; unsigned cf_addr; /* control flow addr */ struct r600_bytecode_kcache kcache[4]; unsigned r6xx_uses_waterfall; diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 1ab389c..153f9a2 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -93,8 +93,10 @@ static void r600_dump_streamout(struct pipe_stream_output_info *so) for (i = 0; i < so->num_outputs; i++) { unsigned mask = ((1 << so->output[i].num_components) - 1) << so->output[i].start_component; - fprintf(stderr, " %i: MEM_STREAM0_BUF%i[%i..%i] <- OUT[%i].%s%s%s%s%s\n", - i, so->output[i].output_buffer, + fprintf(stderr, " %i: MEM_STREAM%d_BUF%i[%i..%i] <- OUT[%i].%s%s%s%s%s\n", + i, + so->output[i].stream, + so->output[i].output_buffer, so->output[i].dst_offset, so->output[i].dst_offset + so->output[i].num_components - 1, so->output[i].register_index, mask & 1 ? "x" : "", diff --git a/src/gallium/drivers/r600/sb/sb_bc_dump.cpp b/src/gallium/drivers/r600/sb/sb_bc_dump.cpp index e6a6c16..0fc73c4 100644 --- a/src/gallium/drivers/r600/sb/sb_bc_dump.cpp +++ b/src/gallium/drivers/r600/sb/sb_bc_dump.cpp @@ -182,6 +182,9 @@ void bc_dump::dump(cf_node& n) { if (n.bc.pop_count) s << " POP:" << n.bc.pop_count; + + if (n.bc.count && (n.bc.op_ptr->flags & CF_EMIT)) + s << " STREAM" << n.bc.count; } if (!n.bc.barrier) -- 2.7.4