From 7428af29f6d8aeac7f441a00f16a8fb4b8cac257 Mon Sep 17 00:00:00 2001 From: Duncan Brawley Date: Tue, 21 Apr 2026 12:54:11 +0100 Subject: [PATCH] pco: Fix pco_last_igrp returning the first element instead of the last Because of a previous refactor, pco_last_igrp was incorrectly changed to return the first entry in a linked list instead of the last. Update pco_last_igrp to return the last entry in a linked list. The following CTS tests now pass: dEQP-GLES3.functional.shaders.switch.conditional_fall_through_2_dynamic_fragment dEQP-GLES3.functional.shaders.switch.conditional_fall_through_dynamic_fragment dEQP-GLES3.functional.shaders.switch.conditional_fall_through_uniform_fragment Fixes: 719ece42c0d ("pco: Switch back to util/list") Signed-off-by: Duncan Brawley Reviewed-by: Frank Binns Part-of: --- src/imagination/pco/pco_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imagination/pco/pco_internal.h b/src/imagination/pco/pco_internal.h index c6fb40e3bcd..503a858e265 100644 --- a/src/imagination/pco/pco_internal.h +++ b/src/imagination/pco/pco_internal.h @@ -1559,7 +1559,7 @@ static inline pco_igrp *pco_last_igrp(pco_block *block) if (list_is_empty(&block->instrs)) return NULL; - return list_first_entry(&block->instrs, pco_igrp, link); + return list_last_entry(&block->instrs, pco_igrp, link); } /**