Receiving a fence_server_sync (iris_fence_await) means that any future
work needs to wait for the fence. But previous work doesn't need to.
So flush it now, to avoid delaying it arbitrarily.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3802>
{
struct iris_context *ice = (struct iris_context *)ctx;
+ /* Flush any current work in our context as it doesn't need to wait
+ * for this fence. Any future work in our context must wait.
+ */
for (unsigned b = 0; b < IRIS_BATCH_COUNT; b++) {
struct iris_batch *batch = &ice->batches[b];
if (iris_seqno_signaled(seqno))
continue;
+ iris_batch_flush(batch);
iris_batch_add_syncobj(batch, seqno->syncobj, I915_EXEC_FENCE_WAIT);
}
}