{
struct fd4_context *fd4_ctx = fd4_context(fd_context(pctx));
- util_dynarray_fini(&fd4_ctx->rbrc_patches);
-
fd_bo_del(fd4_ctx->vs_pvt_mem);
fd_bo_del(fd4_ctx->fs_pvt_mem);
fd_bo_del(fd4_ctx->vsc_size_mem);
if (!pctx)
return NULL;
- util_dynarray_init(&fd4_ctx->rbrc_patches);
-
fd4_ctx->vs_pvt_mem = fd_bo_new(screen->dev, 0x2000,
DRM_FREEDRENO_GEM_TYPE_KMEM);
struct fd4_context {
struct fd_context base;
- /* Keep track of writes to RB_RENDER_CONTROL which need to be patched
- * once we know whether or not to use GMEM, and GMEM tile pitch.
- */
- struct util_dynarray rbrc_patches;
-
struct fd_bo *vs_pvt_mem, *fs_pvt_mem;
/* This only needs to be 4 * num_of_pipes bytes (ie. 32 bytes). We
A4XX_RB_RENDER_COMPONENTS_RT7(mrt_comp[7]));
}
- if ((dirty & (FD_DIRTY_ZSA | FD_DIRTY_PROG)) && !emit->key.binning_pass) {
- uint32_t val = fd4_zsa_stateobj(ctx->zsa)->rb_render_control;
-
- /* I suppose if we needed to (which I don't *think* we need
- * to), we could emit this for binning pass too. But we
- * would need to keep a different patch-list for binning
- * vs render pass.
- */
-
- OUT_PKT0(ring, REG_A4XX_RB_RENDER_CONTROL, 1);
- OUT_RINGP(ring, val, &fd4_context(ctx)->rbrc_patches);
- }
-
if (dirty & (FD_DIRTY_ZSA | FD_DIRTY_FRAMEBUFFER)) {
struct fd4_zsa_stateobj *zsa = fd4_zsa_stateobj(ctx->zsa);
struct pipe_framebuffer_state *pfb = &ctx->framebuffer;
util_dynarray_resize(&ctx->draw_patches, 0);
}
-static void
-patch_rbrc(struct fd_context *ctx, uint32_t val)
-{
- struct fd4_context *fd4_ctx = fd4_context(ctx);
- unsigned i;
- for (i = 0; i < fd_patch_num_elements(&fd4_ctx->rbrc_patches); i++) {
- struct fd_cs_patch *patch = fd_patch_element(&fd4_ctx->rbrc_patches, i);
- *patch->cs = patch->val | val;
- }
- util_dynarray_resize(&fd4_ctx->rbrc_patches, 0);
-}
-
/* for rendering directly to system memory: */
static void
fd4_emit_sysmem_prep(struct fd_context *ctx)
A4XX_RB_MODE_CONTROL_HEIGHT(0) |
0x00c00000); /* XXX */
+ OUT_PKT0(ring, REG_A4XX_RB_RENDER_CONTROL, 1);
+ OUT_RING(ring, 0x8);
+
patch_draws(ctx, IGNORE_VISIBILITY);
- patch_rbrc(ctx, 0); // XXX
}
static void
{
struct fd_ringbuffer *ring = ctx->ring;
struct fd_gmem_stateobj *gmem = &ctx->gmem;
- uint32_t rb_render_control;
fd4_emit_restore(ctx);
update_vsc_pipe(ctx);
patch_draws(ctx, IGNORE_VISIBILITY);
- rb_render_control = 0; // XXX or BINNING_PASS.. but maybe we can emit only from gmem
- patch_rbrc(ctx, rb_render_control);
+ OUT_PKT0(ring, REG_A4XX_RB_RENDER_CONTROL, 1);
+ OUT_RING(ring, 0x8);
}
/* before mem2gmem */
A4XX_GRAS_SC_SCREEN_SCISSOR_TL_Y(y1));
OUT_RING(ring, A4XX_GRAS_SC_SCREEN_SCISSOR_BR_X(x2) |
A4XX_GRAS_SC_SCREEN_SCISSOR_BR_Y(y2));
+
+ OUT_PKT0(ring, REG_A4XX_RB_RENDER_CONTROL, 1);
+ OUT_RING(ring, 0x8);
}
void
struct pipe_depth_stencil_alpha_state base;
uint32_t gras_alpha_control;
uint32_t rb_alpha_control;
- uint32_t rb_render_control;
uint32_t rb_depth_control;
uint32_t rb_stencil_control;
uint32_t rb_stencil_control2;