summaryrefslogtreecommitdiff
authorDave Airlie <airlied@redhat.com>2011-05-31 05:33:07 (GMT)
committer Dave Airlie <airlied@redhat.com>2011-05-31 05:42:45 (GMT)
commit0cdd82df53a55907b311ede0e80c3ce2fb37f287 (patch) (side-by-side diff)
treed509b3ec4dba87b40525c079111d0a577dc06874
parent65ee7cd1dfa043d28dd013f513732090470ef9d6 (diff)
downloadmesa-0cdd82df53a55907b311ede0e80c3ce2fb37f287.zip
mesa-0cdd82df53a55907b311ede0e80c3ce2fb37f287.tar.gz
r600g: add context control to start of CS
On my original R600 card this at least lets gnome shell run for a while longer and the piglit r300-readcache test case works a lot more reliably. Still a few more stability issues running a piglit test run though. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/gallium/winsys/r600/drm/r600_hw_context.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c
index a3f85d2..84b56e3 100644
--- a/src/gallium/winsys/r600/drm/r600_hw_context.c
+++ b/src/gallium/winsys/r600/drm/r600_hw_context.c
@@ -40,6 +40,13 @@
#define GROUP_FORCE_NEW_BLOCK 0
+static void r600_init_cs(struct r600_context *ctx)
+{
+ ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_CONTEXT_CONTROL, 1, 0);
+ ctx->pm4[ctx->pm4_cdwords++] = 0x80000000;
+ ctx->pm4[ctx->pm4_cdwords++] = 0x80000000;
+}
+
static void INLINE r600_context_update_fenced_list(struct r600_context *ctx)
{
for (int i = 0; i < ctx->creloc; i++) {
@@ -780,6 +787,9 @@ int r600_context_init(struct r600_context *ctx, struct radeon *radeon)
r = -ENOMEM;
goto out_err;
}
+
+ if (ctx->radeon->family == CHIP_R600)
+ r600_init_cs(ctx);
/* save 16dwords space for fence mecanism */
ctx->pm4_ndwords -= 16;
@@ -1385,6 +1395,9 @@ 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);
+
/* resume queries */
r600_context_queries_resume(ctx);