}
static void
-batch_reset_resources_locked(struct fd_batch *batch)
+batch_reset_resources(struct fd_batch *batch)
{
fd_screen_assert_locked(batch->ctx->screen);
}
static void
-batch_reset_resources(struct fd_batch *batch) assert_dt
-{
- fd_screen_lock(batch->ctx->screen);
- batch_reset_resources_locked(batch);
- fd_screen_unlock(batch->ctx->screen);
-}
-
-static void
batch_reset(struct fd_batch *batch) assert_dt
{
DBG("%p", batch);
batch_reset_dependencies(batch);
+
+ fd_screen_lock(batch->ctx->screen);
batch_reset_resources(batch);
+ fd_screen_unlock(batch->ctx->screen);
batch_fini(batch);
batch_init(batch);
fd_bc_invalidate_batch(batch, true);
- batch_reset_resources_locked(batch);
+ batch_reset_resources(batch);
debug_assert(batch->resources->entries == 0);
_mesa_set_destroy(batch->resources, NULL);
batch_flush_dependencies(batch);
+ fd_screen_lock(batch->ctx->screen);
+ batch_reset_resources(batch);
+ /* NOTE: remove=false removes the batch from the hashtable, so future
+ * lookups won't cache-hit a flushed batch, but leaves the weak reference
+ * to the batch to avoid having multiple batches with same batch->idx, as
+ * that causes all sorts of hilarity.
+ */
+ fd_bc_invalidate_batch(batch, false);
batch->flushed = true;
+
if (batch == batch->ctx->batch)
- fd_batch_reference(&batch->ctx->batch, NULL);
+ fd_batch_reference_locked(&batch->ctx->batch, NULL);
+
+ fd_screen_unlock(batch->ctx->screen);
if (batch->fence)
fd_fence_ref(&batch->ctx->last_fence, batch->fence);
fd_gmem_render_tiles(batch);
- batch_reset_resources(batch);
debug_assert(batch->reference.count > 0);
- fd_screen_lock(batch->ctx->screen);
- /* NOTE: remove=false removes the batch from the hashtable, so future
- * lookups won't cache-hit a flushed batch, but leaves the weak reference
- * to the batch to avoid having multiple batches with same batch->idx, as
- * that causes all sorts of hilarity.
- */
- fd_bc_invalidate_batch(batch, false);
- fd_screen_unlock(batch->ctx->screen);
cleanup_submit(batch);
fd_batch_unlock_submit(batch);
}