pvr: Fix pvr_csb_bake() list return.
authorKarmjit Mahil <Karmjit.Mahil@imgtec.com>
Thu, 20 Apr 2023 08:34:49 +0000 (09:34 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 28 Apr 2023 08:54:19 +0000 (08:54 +0000)
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 <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22730>

src/imagination/vulkan/pvr_csb.c

index 4c5a31f..915b819 100644 (file)
@@ -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);