fd_bo_del(fd6_ctx->vsc_data);
fd_bo_del(fd6_ctx->vsc_data2);
- fd_bo_del(fd6_ctx->blit_mem);
+ fd_bo_del(fd6_ctx->control_mem);
fd_context_cleanup_common_vbos(&fd6_ctx->base);
A6XX_VSC_DATA2_PITCH * 32,
DRM_FREEDRENO_GEM_TYPE_KMEM, "vsc_data2");
- fd6_ctx->blit_mem = fd_bo_new(screen->dev, 0x1000,
- DRM_FREEDRENO_GEM_TYPE_KMEM, "blit");
+ fd6_ctx->control_mem = fd_bo_new(screen->dev, 0x1000,
+ DRM_FREEDRENO_GEM_TYPE_KMEM, "control");
fd_context_setup_common_vbos(&fd6_ctx->base);
#define A6XX_VSC_DATA_PITCH 0x4400
#define A6XX_VSC_DATA2_PITCH 0x10400
- /* TODO not sure what this is for.. probably similar to
- * CACHE_FLUSH_TS on kernel side, where value gets written
- * to this address synchronized w/ 3d (ie. a way to
- * synchronize when the CP is running far ahead)
+ /* The 'control' mem BO is used for various housekeeping
+ * functions. See 'struct fd6_control'
*/
- struct fd_bo *blit_mem;
+ struct fd_bo *control_mem;
uint32_t seqno;
struct u_upload_mgr *border_color_uploader;
struct pipe_context *
fd6_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags);
+
+/* This struct defines the layout of the fd6_context::control buffer: */
+struct fd6_control {
+ uint32_t seqno; /* seqno for async CP_EVENT_WRITE, etc */
+ uint32_t _pad0;
+ uint32_t flush_base; /* dummy address for VPC_SO[i].FLUSH_BASE_LO/HI */
+ uint32_t _pad1;
+};
+
+#define control_ptr(fd6_ctx, member) \
+ (fd6_ctx)->control_mem, offsetof(struct fd6_control, member), 0, 0
+
+
static inline void
emit_marker6(struct fd_ringbuffer *ring, int scratch_idx)
{
// TODO just give hw a dummy addr for now.. we should
// be using this an then CP_MEM_TO_REG to set the
// VPC_SO[i].BUFFER_OFFSET for the next draw..
- OUT_RELOCW(ring, fd6_context(ctx)->blit_mem, 0x100, 0, 0);
+ OUT_RELOCW(ring, control_ptr(fd6_context(ctx), flush_base));
emit->streamout_mask |= (1 << i);
}
OUT_PKT7(ring, CP_WAIT_REG_MEM, 6);
OUT_RING(ring, 0x00000013);
- OUT_RELOC(ring, fd6_ctx->blit_mem, 0, 0, 0);
+ OUT_RELOC(ring, control_ptr(fd6_ctx, seqno));
OUT_RING(ring, seqno);
OUT_RING(ring, 0xffffffff);
OUT_RING(ring, 0x00000010);
OUT_PKT7(ring, CP_UNK_A6XX_14, 4);
OUT_RING(ring, 0x00000000);
- OUT_RELOC(ring, fd6_ctx->blit_mem, 0, 0, 0);
+ OUT_RELOC(ring, control_ptr(fd6_ctx, seqno));
OUT_RING(ring, seqno);
}
if (timestamp) {
struct fd6_context *fd6_ctx = fd6_context(batch->ctx);
seqno = ++fd6_ctx->seqno;
- OUT_RELOCW(ring, fd6_ctx->blit_mem, 0, 0, 0); /* ADDR_LO/HI */
+ OUT_RELOCW(ring, control_ptr(fd6_ctx, seqno)); /* ADDR_LO/HI */
OUT_RING(ring, seqno);
}
OUT_PKT7(ring, CP_WAIT_REG_MEM, 6);
OUT_RING(ring, 0x00000013);
- OUT_RELOC(ring, fd6_ctx->blit_mem, 0, 0, 0);
+ OUT_RELOC(ring, control_ptr(fd6_ctx, seqno));
OUT_RING(ring, seqno);
OUT_RING(ring, 0xffffffff);
OUT_RING(ring, 0x00000010);
OUT_PKT7(ring, CP_UNK_A6XX_14, 4);
OUT_RING(ring, 0x00000000);
- OUT_RELOC(ring, fd6_ctx->blit_mem, 0, 0, 0);
+ OUT_RELOC(ring, control_ptr(fd6_ctx, seqno));
OUT_RING(ring, seqno);
}