Commit 31835ac3 authored by Rob Clark's avatar Rob Clark 💬 Committed by Marge Bot
Browse files

freedreno/a6xx: Fix streamout with tess_use_shared


Signed-off-by: Rob Clark's avatarRob Clark <robdclark@chromium.org>
Part-of: <mesa/mesa!12497>
parent 219e12b7
......@@ -914,15 +914,25 @@ fd6_emit_streamout(struct fd_ringbuffer *ring, struct fd6_emit *emit) assert_dt
* off streamout.
*/
if (ctx->last.streamout_mask != 0) {
unsigned sizedw = 4;
if (ctx->screen->info->a6xx.tess_use_shared)
sizedw += 2;
struct fd_ringbuffer *obj = fd_submit_new_ringbuffer(
emit->ctx->batch->submit, 5 * 4, FD_RINGBUFFER_STREAMING);
emit->ctx->batch->submit, (1 + sizedw) * 4, FD_RINGBUFFER_STREAMING);
OUT_PKT7(obj, CP_CONTEXT_REG_BUNCH, 4);
OUT_PKT7(obj, CP_CONTEXT_REG_BUNCH, sizedw);
OUT_RING(obj, REG_A6XX_VPC_SO_CNTL);
OUT_RING(obj, 0);
OUT_RING(obj, REG_A6XX_VPC_SO_STREAM_CNTL);
OUT_RING(obj, 0);
if (ctx->screen->info->a6xx.tess_use_shared) {
OUT_RING(ring, REG_A6XX_PC_SO_STREAM_CNTL);
OUT_RING(ring, 0);
}
fd6_emit_take_group(emit, obj, FD6_GROUP_SO, ENABLE_ALL);
}
}
......
......@@ -203,10 +203,14 @@ setup_stream_out(struct fd_context *ctx, struct fd6_program_state *state,
}
}
unsigned sizedw = 12 + (2 * prog_count);
if (ctx->screen->info->a6xx.tess_use_shared)
sizedw += 2;
struct fd_ringbuffer *ring =
fd_ringbuffer_new_object(ctx->pipe, (13 + (2 * prog_count)) * 4);
fd_ringbuffer_new_object(ctx->pipe, (1 + sizedw) * 4);
OUT_PKT7(ring, CP_CONTEXT_REG_BUNCH, 12 + (2 * prog_count));
OUT_PKT7(ring, CP_CONTEXT_REG_BUNCH, sizedw);
OUT_RING(ring, REG_A6XX_VPC_SO_STREAM_CNTL);
OUT_RING(ring,
A6XX_VPC_SO_STREAM_CNTL_STREAM_ENABLE(0x1) |
......@@ -228,6 +232,13 @@ setup_stream_out(struct fd_context *ctx, struct fd6_program_state *state,
OUT_RING(ring, REG_A6XX_VPC_SO_PROG);
OUT_RING(ring, prog[i]);
}
if (ctx->screen->info->a6xx.tess_use_shared) {
/* Possibly not tess_use_shared related, but the combination of
* tess + xfb fails some tests if we don't emit this.
*/
OUT_RING(ring, REG_A6XX_PC_SO_STREAM_CNTL);
OUT_RING(ring, A6XX_PC_SO_STREAM_CNTL_STREAM_ENABLE);
}
state->streamout_stateobj = ring;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment