From 64127c4bd985fa45cc60487d28f51b80567410f1 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 (cherry picked from commit 7428af29f6d8aeac7f441a00f16a8fb4b8cac257) Part-of: --- .pick_status.json | 2 +- src/imagination/pco/pco_internal.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index eb7f250b9f5..50e697be3e3 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2064,7 +2064,7 @@ "description": "pco: Fix pco_last_igrp returning the first element instead of the last", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "719ece42c0dcc7c682ba605fca43e76fac72756f", "notes": null diff --git a/src/imagination/pco/pco_internal.h b/src/imagination/pco/pco_internal.h index 50d42566e49..a38c80b12e8 100644 --- a/src/imagination/pco/pco_internal.h +++ b/src/imagination/pco/pco_internal.h @@ -1551,7 +1551,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); } /**