fd6_ctx->control_mem =
fd_bo_new(screen->dev, 0x1000, 0, "control");
+ fd_context_add_private_bo(&fd6_ctx->base, fd6_ctx->control_mem);
+
memset(fd_bo_map(fd6_ctx->control_mem), 0, sizeof(struct fd6_control));
fd_context_setup_common_vbos(&fd6_ctx->base);
struct fd6_context *fd6_ctx = fd6_context(batch->ctx);
struct fd_bo *bcolor_mem = fd6_ctx->bcolor_mem;
+
OUT_PKT4(ring, REG_A6XX_SP_TP_BORDER_COLOR_BASE_ADDR, 2);
OUT_RELOC(ring, bcolor_mem, 0, 0, 0);
OUT_PKT4(ring, REG_A6XX_SP_PS_TP_BORDER_COLOR_BASE_ADDR, 2);
OUT_RELOC(ring, bcolor_mem, 0, 0, 0);
- fd_ringbuffer_attach_bo(ring, bcolor_mem);
-
- fd_ringbuffer_attach_bo(ring, fd6_ctx->control_mem);
-
if (!batch->nondraw) {
trace_end_state_restore(&batch->trace, ring);
}
FD6_MAX_BORDER_COLORS * FD6_BORDER_COLOR_SIZE,
0, "bcolor");
+ fd_context_add_private_bo(ctx, fd6_ctx->bcolor_mem);
+
fd6_ctx->tex_cache = _mesa_hash_table_create(NULL, tex_key_hash, tex_key_equals);
util_idalloc_init(&fd6_ctx->tex_ids, 256);
}
}
}
+ /* Pre-attach private BOs: */
+ for (unsigned i = 0; i < ctx->num_private_bos; i++)
+ fd_ringbuffer_attach_bo(batch->gmem, ctx->private_bos[i]);
+
batch->subpass = subpass_create(batch);
batch->in_fence_fd = -1;
}
}
+void
+fd_context_add_private_bo(struct fd_context *ctx, struct fd_bo *bo)
+{
+ assert(ctx->num_private_bos < ARRAY_SIZE(ctx->private_bos));
+ ctx->private_bos[ctx->num_private_bos++] = bo;
+}
+
/**
* Return a reference to the current batch, caller must unref.
*/
/* Per vsc pipe bo's (a2xx-a5xx): */
struct fd_bo *vsc_pipe_bo[32] dt;
+ /* Table of bo's attached to all batches up-front (because they
+ * are commonly used, and that is easier than attaching on-use).
+ * In particular, these are driver internal buffers which do not
+ * participate in batch resource tracking.
+ */
+ struct fd_bo *private_bos[3];
+ unsigned num_private_bos;
+
/* Maps generic gallium oriented fd_dirty_3d_state bits to generation
* specific bitmask of state "groups".
*/
return (struct fd_stream_output_target *)target;
}
+void fd_context_add_private_bo(struct fd_context *ctx, struct fd_bo *bo);
+
/* Mark specified non-shader-stage related state as dirty: */
static inline void
fd_context_dirty(struct fd_context *ctx, BITMASK_ENUM(fd_dirty_3d_state) dirty)