Skip to content

asahi: Flush batches when they read too many shared BOs

Asahi Lina requested to merge asahilina/mesa:agx/in_sync_limit into main

The kernel has an (arbitrary) limit on how many in_syncs we can wait on for a single submission. Apps can import and draw lots of textures, which can cause us to exceed this limit in a single batch.

Keep track of how many shared BOs a batch depends on, and flush if the number exceeds the max syncs minus 32 (arbitrary headroom for how many shared BOs a single draw might depend on, plus misc dependencies).

Note: the kernel limit is 64 right now, so this splits at ~half the limit. This can be increased if necessary.

Fixes more magenta randomness in some apps under Xwayland/Glamor, caused by failed submissions. This is unlikely to hit anything else, realistically.

Rebase note: Needs dummy max_syncs_per_submission added to the params before the UAPI commit.

Merge request reports