Mesa (master): r600g: always clear query memory
Alex Deucher
agd5f at kemper.freedesktop.org
Tue Jun 7 21:07:35 UTC 2011
Module: Mesa
Branch: master
Commit: 7c1d4781920e34ad5419b4c5cf9d54ae14938844
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7c1d4781920e34ad5419b4c5cf9d54ae14938844
Author: Alex Deucher <alexdeucher at gmail.com>
Date: Tue Jun 7 16:44:40 2011 -0400
r600g: always clear query memory
According to the hw documentation, the driver needs to:
- allocate 128 bits for each possible DB
- clear the 128 bits for each possible DB
- write 1 to bits 127 and 63 for upper DBs that don't
exist on a particular asic
Previously we were only doing these steps if the
asic had less than the max possible DBs.
Signed-off-by: Alex Deucher <alexdeucher at gmail.com>
---
src/gallium/winsys/r600/drm/r600_hw_context.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c
index cb244f2..2159d41 100644
--- a/src/gallium/winsys/r600/drm/r600_hw_context.c
+++ b/src/gallium/winsys/r600/drm/r600_hw_context.c
@@ -1667,7 +1667,7 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
}
if (query->type == PIPE_QUERY_OCCLUSION_COUNTER &&
- num_backends > 0 && num_backends < ctx->max_db) {
+ num_backends > 0) {
/* as per info on ZPASS the driver must set the unusued DB top bits */
u32 *results;
int i;
@@ -1675,7 +1675,7 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
results = r600_bo_map(ctx->radeon, query->buffer, PB_USAGE_DONTBLOCK | PB_USAGE_CPU_WRITE, NULL);
if (results) {
memset(results + (query->num_results * 4), 0, ctx->max_db * 4 * 4);
-
+
for (i = num_backends; i < ctx->max_db; i++) {
results[(i * 4)+1] = 0x80000000;
results[(i * 4)+3] = 0x80000000;
@@ -1683,7 +1683,7 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
r600_bo_unmap(ctx->radeon, query->buffer);
}
}
-
+
/* emit begin query */
if (query->type == PIPE_QUERY_TIME_ELAPSED) {
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE_EOP, 4, 0);
More information about the mesa-commit
mailing list