Skip to content

Commit aea9ac4

Browse files
pzanoni-intelMarge Bot
authored andcommitted
anv/trtt: fix error handling when adding binds
We're missing a check for 'result' in the middle of a loop and we have an unnecessary check for 'result' after the loop. Fixes: 7da5b1c ("anv: move trtt submissions over to the anv_async_submit") Reviewed-by: Lionel Landwerlin <[email protected]> Signed-off-by: Paulo Zanoni <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30953>
1 parent fd43c4a commit aea9ac4

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/intel/vulkan/anv_sparse.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,8 @@ anv_sparse_bind_trtt(struct anv_device *device,
786786
result = anv_trtt_bind_add(device, trtt_addr, dest_addr,
787787
l3l2_binds, &n_l3l2_binds,
788788
l1_binds, &n_l1_binds);
789+
if (result != VK_SUCCESS)
790+
goto error_stack_arrays;
789791
}
790792
}
791793

@@ -795,14 +797,12 @@ anv_sparse_bind_trtt(struct anv_device *device,
795797
/* Convert the L3/L2/L1 TRTT page table updates in anv_trtt_bind elements
796798
* into MI commands.
797799
*/
798-
if (result == VK_SUCCESS) {
799-
sparse_debug("trtt_binds: num_vm_binds:%02d l3l2:%04d l1:%04d\n",
800-
sparse_submit->binds_len, n_l3l2_binds, n_l1_binds);
800+
sparse_debug("trtt_binds: num_vm_binds:%02d l3l2:%04d l1:%04d\n",
801+
sparse_submit->binds_len, n_l3l2_binds, n_l1_binds);
801802

802-
if (n_l3l2_binds || n_l1_binds) {
803-
anv_genX(device->info, write_trtt_entries)(
804-
&submit->base, l3l2_binds, n_l3l2_binds, l1_binds, n_l1_binds);
805-
}
803+
if (n_l3l2_binds || n_l1_binds) {
804+
anv_genX(device->info, write_trtt_entries)(
805+
&submit->base, l3l2_binds, n_l3l2_binds, l1_binds, n_l1_binds);
806806
}
807807

808808
STACK_ARRAY_FINISH(l1_binds);
@@ -847,6 +847,9 @@ anv_sparse_bind_trtt(struct anv_device *device,
847847

848848
return VK_SUCCESS;
849849

850+
error_stack_arrays:
851+
STACK_ARRAY_FINISH(l1_binds);
852+
STACK_ARRAY_FINISH(l3l2_binds);
850853
error_add_bind:
851854
simple_mtx_unlock(&trtt->mutex);
852855
anv_async_submit_fini(&submit->base);

0 commit comments

Comments
 (0)