From 8a0ffedd8de51eaf980855283c4525dba6dc5847 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sat, 18 Oct 2014 15:28:16 -0400 Subject: freedreno/ir3: fix potential gpu lockup with kill It seems like the hardware is unhappy if we execute a kill instruction prior to last input (ei). Probably the shader thread stops executing and the end-input flag is never set. Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/ir3/ir3.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gallium/drivers/freedreno/ir3/ir3.c') diff --git a/src/gallium/drivers/freedreno/ir3/ir3.c b/src/gallium/drivers/freedreno/ir3/ir3.c index 70d37ffdeb5..60d4e4a15d5 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3.c +++ b/src/gallium/drivers/freedreno/ir3/ir3.c @@ -81,6 +81,8 @@ void ir3_destroy(struct ir3 *shader) shader->chunk = chunk->next; free(chunk); } + free(shader->instrs); + free(shader->baryfs); free(shader); } @@ -596,6 +598,15 @@ static void insert_instr(struct ir3 *shader, shader->instrs_sz * sizeof(shader->instrs[0])); } shader->instrs[shader->instrs_count++] = instr; + + if (is_input(instr)) { + if (shader->baryfs_count == shader->baryfs_sz) { + shader->baryfs_sz = MAX2(2 * shader->baryfs_sz, 16); + shader->baryfs = realloc(shader->baryfs, + shader->baryfs_sz * sizeof(shader->baryfs[0])); + } + shader->baryfs[shader->baryfs_count++] = instr; + } } struct ir3_block * ir3_block_create(struct ir3 *shader, -- cgit v1.2.3