From b5518834e3ae117eafb32cfc5c7e7af51b4a1078 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Tue, 31 May 2011 10:43:31 -0400 Subject: r600g: cs init fixes - all asics need to emit CONTEXT_CONTROL - all r6xx asics need to emit 3D_START_CMDBUF The ddx and r600c already do this. r600g should as well. Signed-off-by: Alex Deucher --- src/gallium/winsys/r600/drm/evergreen_hw_context.c | 2 ++ src/gallium/winsys/r600/drm/r600_hw_context.c | 14 +++++++++----- src/gallium/winsys/r600/drm/r600_priv.h | 1 + 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/winsys/r600/drm/evergreen_hw_context.c b/src/gallium/winsys/r600/drm/evergreen_hw_context.c index 6fcb54fb9c7..fc42c411889 100644 --- a/src/gallium/winsys/r600/drm/evergreen_hw_context.c +++ b/src/gallium/winsys/r600/drm/evergreen_hw_context.c @@ -1003,6 +1003,8 @@ int evergreen_context_init(struct r600_context *ctx, struct radeon *radeon) r = -ENOMEM; goto out_err; } + + r600_init_cs(ctx); /* save 16dwords space for fence mecanism */ ctx->pm4_ndwords -= 16; diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c index 84b56e3f8b3..ffcc15b5217 100644 --- a/src/gallium/winsys/r600/drm/r600_hw_context.c +++ b/src/gallium/winsys/r600/drm/r600_hw_context.c @@ -40,8 +40,14 @@ #define GROUP_FORCE_NEW_BLOCK 0 -static void r600_init_cs(struct r600_context *ctx) +void r600_init_cs(struct r600_context *ctx) { + /* R6xx requires this packet at the start of each command buffer */ + if (ctx->radeon->family < CHIP_RV770) { + ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_START_3D_CMDBUF, 0, 0); + ctx->pm4[ctx->pm4_cdwords++] = 0x00000000; + } + /* All asics require this one */ ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_CONTEXT_CONTROL, 1, 0); ctx->pm4[ctx->pm4_cdwords++] = 0x80000000; ctx->pm4[ctx->pm4_cdwords++] = 0x80000000; @@ -788,8 +794,7 @@ int r600_context_init(struct r600_context *ctx, struct radeon *radeon) goto out_err; } - if (ctx->radeon->family == CHIP_R600) - r600_init_cs(ctx); + r600_init_cs(ctx); /* save 16dwords space for fence mecanism */ ctx->pm4_ndwords -= 16; @@ -1395,8 +1400,7 @@ void r600_context_flush(struct r600_context *ctx) ctx->pm4_cdwords = 0; ctx->flags = 0; - if (ctx->radeon->family == CHIP_R600) - r600_init_cs(ctx); + r600_init_cs(ctx); /* resume queries */ r600_context_queries_resume(ctx); diff --git a/src/gallium/winsys/r600/drm/r600_priv.h b/src/gallium/winsys/r600/drm/r600_priv.h index 2e6a4375199..d785ede09ea 100644 --- a/src/gallium/winsys/r600/drm/r600_priv.h +++ b/src/gallium/winsys/r600/drm/r600_priv.h @@ -166,6 +166,7 @@ int r600_setup_block_table(struct r600_context *ctx); void r600_context_reg(struct r600_context *ctx, unsigned offset, unsigned value, unsigned mask); +void r600_init_cs(struct r600_context *ctx); /* * r600_bo.c */ -- cgit v1.2.3