On Monday 02 May 2011, Alex Deucher wrote: > One thing to double check is that rv6xx_context_surface_base_update() > gets emitted properly every time a base address is emitted. Right now > I think we only call it once per command buffer, but it needs to be > emitted every time a base address changes.
It's always emitted in r600_context_draw(), which is actually more often than what is necessary since the surface base registers don't always change between draw calls. But maybe that's the source of the problem. Maybe you can't emit base update twice without flushing the caches in between? If that's the case, I think the attached patch should fix it. Regards, Fredrik
From e4af4c7f038faa20ebbe6838bc48e9f1b23cf366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= <fred...@kde.org> Date: Tue, 3 May 2011 20:45:39 +0200 Subject: [PATCH] r600g: don't emit surface base update unecessarily Only emit rv6xx_surface_base_update when the surface base registers have actually changed. --- src/gallium/winsys/r600/drm/r600_hw_context.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c index e28ef1f..a7d7b99 100644 --- a/src/gallium/winsys/r600/drm/r600_hw_context.c +++ b/src/gallium/winsys/r600/drm/r600_hw_context.c @@ -1261,8 +1261,10 @@ void r600_context_draw(struct r600_context *ctx, const struct r600_draw *draw) r600_context_block_emit_dirty(ctx, dirty_block); } - /* rv6xx surface base udpate */ - if (rv6xx_surface_base_update) + /* rv6xx surface base update */ + /* If the dst caches are dirty we know that the surface base registers + * haven't changed since the last surface base update was emitted */ + if (rv6xx_surface_base_update && !(ctx->flags & R600_CONTEXT_DST_CACHES_DIRTY)) rv6xx_context_surface_base_update(ctx, rv6xx_surface_base_update); /* draw packet */ -- 1.7.4.4
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev