From 050e05db22f8cc0e4bdaaa07102b5c50eef9f88e Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Tue, 8 Feb 2022 23:14:21 +0100 Subject: [PATCH] r600: Set the last bit if an alu group is split by kcache allocation Signed-off-by: Gert Wollny Acked-by: Emma Anholt Part-of: --- src/gallium/drivers/r600/r600_asm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c index f6f8bfd4898..060511e6cef 100644 --- a/src/gallium/drivers/r600/r600_asm.c +++ b/src/gallium/drivers/r600/r600_asm.c @@ -1129,6 +1129,15 @@ static int r600_bytecode_alloc_kcache_lines(struct r600_bytecode *bc, if ((r = r600_bytecode_alloc_inst_kcache_lines(bc, kcache, alu))) { /* can't alloc, need to start new clause */ + + /* Make sure the CF ends with an "last" instruction when + * we split an ALU group because of a new CF */ + if (!list_is_empty(&bc->cf_last->alu)) { + struct r600_bytecode_alu *last_submitted = + list_last_entry(&bc->cf_last->alu, struct r600_bytecode_alu, list); + last_submitted->last = 1; + } + if ((r = r600_bytecode_add_cf(bc))) { return r; }