Module: Mesa
Branch: main
Commit: c38da3dcd22bbdde7fb8a6ac824d0af4ac85c8e3
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c38da3dcd22bbdde7fb8a6ac824d0af4ac85c8e3

Author: Karmjit Mahil <[email protected]>
Date:   Thu Apr 20 09:34:49 2023 +0100

pvr: Fix pvr_csb_bake() list return.

The list logic checks for list->next->next (+ some other checks)
to point to the list itself to determine that there is just one
single element.

 ┌───────────────────────┐
 └< { HEAD } >─< { E0 } >┘

When the list_head is copied as was being done previously, the
list element's next pointer still points at the old head so
the `list_is_singular()` check fails.

Fixes pvr_cmd_buffer.c:605:`list_is_singular(&bo_list)` assertion
dEQP-VK.api.image_g.core.clear_color_attachment.cube_layers.b8g8r8a8_unorm

Signed-off-by: Karmjit Mahil <[email protected]>
Reviewed-by: Frank Binns <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22730>

---

 src/imagination/vulkan/pvr_csb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/imagination/vulkan/pvr_csb.c b/src/imagination/vulkan/pvr_csb.c
index 4c5a31f94c7..915b819ec91 100644
--- a/src/imagination/vulkan/pvr_csb.c
+++ b/src/imagination/vulkan/pvr_csb.c
@@ -136,7 +136,7 @@ VkResult pvr_csb_bake(struct pvr_csb *const csb,
    if (csb->status != VK_SUCCESS)
       return csb->status;
 
-   *bo_list_out = csb->pvr_bo_list;
+   list_replace(&csb->pvr_bo_list, bo_list_out);
 
    /* Same as pvr_csb_finish(). */
    pvr_csb_init(NULL, PVR_CMD_STREAM_TYPE_INVALID, csb);

Reply via email to