* supported by hw.. if necessary decompose into (potentially) two 2D blits
*/
static void
-emit_blit_buffer(struct fd_ringbuffer *ring, const struct pipe_blit_info *info)
+emit_blit_buffer(struct fd_context *ctx, struct fd_ringbuffer *ring,
+ const struct pipe_blit_info *info)
{
const struct pipe_box *sbox = &info->src.box;
const struct pipe_box *dbox = &info->dst.box;
OUT_RING(ring, 0xf180);
OUT_PKT4(ring, REG_A6XX_RB_UNKNOWN_8E04, 1);
- OUT_RING(ring, 0x01000000);
+ OUT_RING(ring, fd6_context(ctx)->magic.RB_UNKNOWN_8E04_blit);
OUT_PKT7(ring, CP_BLIT, 1);
OUT_RING(ring, CP_BLIT_0_OP(BLIT_OP_SCALE));
OUT_WFI5(ring);
OUT_PKT4(ring, REG_A6XX_RB_UNKNOWN_8E04, 1);
- OUT_RING(ring, 0);
+ OUT_RING(ring, 0); /* RB_UNKNOWN_8E04 */
}
}
static void
-emit_blit_texture(struct fd_ringbuffer *ring, const struct pipe_blit_info *info)
+emit_blit_texture(struct fd_context *ctx, struct fd_ringbuffer *ring,
+ const struct pipe_blit_info *info)
{
const struct pipe_box *sbox = &info->src.box;
const struct pipe_box *dbox = &info->dst.box;
0xf000);
OUT_PKT4(ring, REG_A6XX_RB_UNKNOWN_8E04, 1);
- OUT_RING(ring, 0x01000000);
+ OUT_RING(ring, fd6_context(ctx)->magic.RB_UNKNOWN_8E04_blit);
OUT_PKT7(ring, CP_BLIT, 1);
OUT_RING(ring, CP_BLIT_0_OP(BLIT_OP_SCALE));
OUT_WFI5(ring);
OUT_PKT4(ring, REG_A6XX_RB_UNKNOWN_8E04, 1);
- OUT_RING(ring, 0);
+ OUT_RING(ring, 0); /* RB_UNKNOWN_8E04 */
}
}
(info->dst.resource->target == PIPE_BUFFER)) {
assert(fd_resource(info->src.resource)->tile_mode == TILE6_LINEAR);
assert(fd_resource(info->dst.resource)->tile_mode == TILE6_LINEAR);
- emit_blit_buffer(batch->draw, info);
+ emit_blit_buffer(ctx, batch->draw, info);
} else {
/* I don't *think* we need to handle blits between buffer <-> !buffer */
debug_assert(info->src.resource->target != PIPE_BUFFER);
debug_assert(info->dst.resource->target != PIPE_BUFFER);
- emit_blit_texture(batch->draw, info);
+ emit_blit_texture(ctx, batch->draw, info);
}
fd6_event_write(batch, batch->draw, 0x1d, true);
if (!fd6_ctx)
return NULL;
+
+ switch (screen->gpu_id) {
+ case 630:
+ fd6_ctx->magic.RB_UNKNOWN_8E04_blit = 0x01000000;
+ // NOTE: newer blob using 0x3c400004, need to revisit:
+ fd6_ctx->magic.RB_CCU_CNTL_gmem = 0x7c400004;
+ fd6_ctx->magic.RB_CCU_CNTL_bypass = 0x10000000;
+ fd6_ctx->magic.PC_UNKNOWN_9805 = 0x1;
+ fd6_ctx->magic.SP_UNKNOWN_A0F8 = 0x1;
+ break;
+ }
+
pctx = &fd6_ctx->base.base;
pctx->screen = pscreen;
uint16_t tex_seqno;
struct hash_table *tex_cache;
+
+ /* collection of magic register values which differ between
+ * various different a6xx
+ */
+ struct {
+ uint32_t RB_UNKNOWN_8E04_blit; /* value for CP_BLIT's */
+ uint32_t RB_CCU_CNTL_bypass; /* for sysmem rendering */
+ uint32_t RB_CCU_CNTL_gmem; /* for GMEM rendering */
+ uint32_t PC_UNKNOWN_9805;
+ uint32_t SP_UNKNOWN_A0F8;
+
+ } magic;
};
static inline struct fd6_context *
fd6_clear_lrz(struct fd_batch *batch, struct fd_resource *zsbuf, double depth)
{
struct fd_ringbuffer *ring;
+ struct fd6_context *fd6_ctx = fd6_context(batch->ctx);
// TODO mid-frame clears (ie. app doing crazy stuff)?? Maybe worth
// splitting both clear and lrz clear out into their own rb's. And
OUT_WFI5(ring);
OUT_PKT4(ring, REG_A6XX_RB_CCU_CNTL, 1);
- OUT_RING(ring, 0x10000000);
+ OUT_RING(ring, fd6_ctx->magic.RB_CCU_CNTL_bypass);
OUT_PKT4(ring, REG_A6XX_HLSQ_UPDATE_CNTL, 1);
OUT_RING(ring, 0x7ffff);
OUT_WFI5(ring);
OUT_PKT4(ring, REG_A6XX_RB_UNKNOWN_8E04, 1);
- OUT_RING(ring, 0x1000000);
+ OUT_RING(ring, fd6_ctx->magic.RB_UNKNOWN_8E04_blit);
OUT_PKT7(ring, CP_BLIT, 1);
OUT_RING(ring, CP_BLIT_0_OP(BLIT_OP_SCALE));
OUT_WFI5(ring);
OUT_PKT4(ring, REG_A6XX_RB_UNKNOWN_8E04, 1);
- OUT_RING(ring, 0x0);
+ OUT_RING(ring, 0x0); /* RB_UNKNOWN_8E04 */
fd6_event_write(batch, ring, UNK_1D, true);
fd6_event_write(batch, ring, FACENESS_FLUSH, true);
OUT_WFI5(ring);
- WRITE(REG_A6XX_RB_CCU_CNTL, 0x7c400004);
- WRITE(REG_A6XX_RB_UNKNOWN_8E04, 0x00100000);
+ WRITE(REG_A6XX_RB_UNKNOWN_8E04, 0x0);
WRITE(REG_A6XX_SP_UNKNOWN_AE04, 0x8);
WRITE(REG_A6XX_SP_UNKNOWN_AE00, 0);
WRITE(REG_A6XX_SP_UNKNOWN_AE0F, 0x3f);
{
struct fd_ringbuffer *ring = batch->gmem;
struct fd_gmem_stateobj *gmem = &batch->ctx->gmem;
+ struct fd6_context *fd6_ctx = fd6_context(batch->ctx);
uint32_t x1 = gmem->minx;
uint32_t y1 = gmem->miny;
update_vsc_pipe(batch);
OUT_PKT4(ring, REG_A6XX_PC_UNKNOWN_9805, 1);
- OUT_RING(ring, 0x1);
+ OUT_RING(ring, fd6_ctx->magic.PC_UNKNOWN_9805);
OUT_PKT4(ring, REG_A6XX_SP_UNKNOWN_A0F8, 1);
- OUT_RING(ring, 0x1);
+ OUT_RING(ring, fd6_ctx->magic.SP_UNKNOWN_A0F8);
OUT_PKT7(ring, CP_EVENT_WRITE, 1);
OUT_RING(ring, UNK_2C);
OUT_WFI5(ring);
OUT_PKT4(ring, REG_A6XX_RB_CCU_CNTL, 1);
- OUT_RING(ring, 0x7c400004); /* RB_CCU_CNTL */
+ OUT_RING(ring, fd6_ctx->magic.RB_CCU_CNTL_gmem);
}
static void
OUT_PKT7(ring, CP_SKIP_IB2_ENABLE_GLOBAL, 1);
OUT_RING(ring, 0x0);
- /* 0x10000000 for BYPASS.. 0x7c13c080 for GMEM: */
fd_wfi(batch, ring);
OUT_PKT4(ring, REG_A6XX_RB_CCU_CNTL, 1);
- OUT_RING(ring, 0x7c400004); /* RB_CCU_CNTL */
+ OUT_RING(ring, fd6_context(ctx)->magic.RB_CCU_CNTL_gmem);
emit_zs(ring, pfb->zsbuf, &ctx->gmem);
emit_mrt(ring, pfb, &ctx->gmem);
OUT_RING(ring, 0x0);
OUT_PKT4(ring, REG_A6XX_PC_UNKNOWN_9805, 1);
- OUT_RING(ring, 0x1);
+ OUT_RING(ring, fd6_context(ctx)->magic.PC_UNKNOWN_9805);
OUT_PKT4(ring, REG_A6XX_SP_UNKNOWN_A0F8, 1);
- OUT_RING(ring, 0x1);
+ OUT_RING(ring, fd6_context(ctx)->magic.SP_UNKNOWN_A0F8);
OUT_PKT7(ring, CP_SKIP_IB2_ENABLE_GLOBAL, 1);
OUT_RING(ring, 0x1);
fd6_event_write(batch, ring, PC_CCU_INVALIDATE_COLOR, false);
fd6_cache_inv(batch, ring);
- /* 0x10000000 for BYPASS.. 0x7c13c080 for GMEM: */
fd_wfi(batch, ring);
OUT_PKT4(ring, REG_A6XX_RB_CCU_CNTL, 1);
- OUT_RING(ring, 0x10000000); /* RB_CCU_CNTL */
+ OUT_RING(ring, fd6_context(batch->ctx)->magic.RB_CCU_CNTL_bypass);
/* enable stream-out, with sysmem there is only one pass: */
OUT_PKT4(ring, REG_A6XX_VPC_SO_OVERRIDE, 1);