Lines Matching defs:batch

50    struct fd_batch *batch = NULL;
52 /* We want to lookup current batch if it exists, but not create a new
55 fd_batch_reference(&batch, ctx->batch);
57 DBG("%p: flush: flags=%x, fencep=%p", batch, flags, fencep);
59 if (fencep && !batch) {
60 batch = fd_context_batch(ctx);
61 } else if (!batch) {
64 fd_bc_dump(ctx, "%p: NULL batch, remaining:\n", ctx);
69 * the front-end thread. But not yet associated with a batch,
70 * because we cannot safely access ctx->batch outside of the driver
71 * thread. So instead, replace the existing batch->fence with the
81 fd_fence_set_batch(*fencep, batch);
82 fd_fence_ref(&batch->fence, *fencep);
95 * nothing triggers the batch flush which fence_flush() would
99 } else if (!batch->fence) {
100 batch->fence = fd_fence_create(batch);
120 /* Take a ref to the batch's fence (batch can be unref'd when flushed: */
121 fd_fence_ref(&fence, batch->fence);
127 batch, batch->seqno, flags);
132 batch->needs_flush = true;
135 fd_batch_flush(batch);
150 fd_batch_reference(&batch, NULL);
242 if (!ctx->batch)
245 struct fd_batch *batch = fd_context_batch_locked(ctx);
247 fd_batch_needs_flush(batch);
250 fd_emit_string5(batch->draw, string, len);
252 fd_emit_string(batch->draw, string, len);
255 fd_batch_unlock_submit(batch);
256 fd_batch_reference(&batch, NULL);
261 * The alternative to try to track this with batch dependencies gets
264 * Call this before switching to a different batch, to handle this case.
269 if (ctx->batch && (ctx->batch->in_fence_fd != -1))
270 fd_batch_flush(ctx->batch);
275 * transfer the reference to the next batch we are going to render
279 fd_context_switch_to(struct fd_context *ctx, struct fd_batch *batch)
282 sync_accumulate("freedreno", &batch->in_fence_fd, ctx->in_fence_fd);
289 * Return a reference to the current batch, caller must unref.
294 struct fd_batch *batch = NULL;
298 fd_batch_reference(&batch, ctx->batch);
300 if (unlikely(!batch)) {
301 batch =
303 util_copy_framebuffer_state(&batch->framebuffer, &ctx->framebuffer);
304 fd_batch_reference(&ctx->batch, batch);
307 fd_context_switch_to(ctx, batch);
309 return batch;
313 * Return a locked reference to the current batch. A batch with emit
321 struct fd_batch *batch = NULL;
323 while (!batch) {
324 batch = fd_context_batch(ctx);
325 if (!fd_batch_lock_submit(batch)) {
326 fd_batch_reference(&batch, NULL);
330 return batch;
356 fd_batch_reference(&ctx->batch, NULL); /* unref current batch */
358 /* Make sure nothing in the batch cache references our context any more. */
455 struct fd_batch *batch = container_of(ut, struct fd_batch, trace);
459 if (ring->cur == batch->last_timestamp_cmd) {
466 batch->ctx->record_timestamp(ring, fd_resource(buffer)->bo, ts_offset);
467 batch->last_timestamp_cmd = ring->cur;