summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Deucher <[email protected]>2011-01-31 02:47:54 -0500
committerAlex Deucher <[email protected]>2011-01-31 02:49:27 -0500
commit26a4c1cb650eee1380f87f3d7e8cff43c3d6a3e6 (patch)
tree1b14dcf1ccacb127d3d7615245b4537203e7803d /src
parentdf8089df90de3e720fec46d6118b15094e94ccd7 (diff)
r600g: fix OQ on evergreen
6xx/7xx have a max of 4 DBs, evergreen have a max of 8. Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r600/r600.h2
-rw-r--r--src/gallium/winsys/r600/drm/r600_hw_context.c9
2 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h
index 15cfb7f0c46..64c52bca795 100644
--- a/src/gallium/drivers/r600/r600.h
+++ b/src/gallium/drivers/r600/r600.h
@@ -250,7 +250,7 @@ struct r600_context {
struct list_head query_list;
unsigned num_query_running;
struct list_head fenced_bo;
- unsigned num_db; /* for OQ */
+ unsigned max_db; /* for OQ */
};
struct r600_draw {
diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c
index 53879a57fa5..f4e2aaa772c 100644
--- a/src/gallium/winsys/r600/drm/r600_hw_context.c
+++ b/src/gallium/winsys/r600/drm/r600_hw_context.c
@@ -753,7 +753,10 @@ int r600_context_init(struct r600_context *ctx, struct radeon *radeon)
LIST_INITHEAD(&ctx->dirty);
/* TODO update this value correctly */
- ctx->num_db = 4;
+ if (radeon->family >= CHIP_CEDAR)
+ ctx->max_db = 8;
+ else
+ ctx->max_db = 4;
return 0;
out_err:
@@ -1265,7 +1268,7 @@ static boolean r600_query_result(struct r600_context *ctx, struct r600_query *qu
if (!results)
return FALSE;
- size = query->num_results * (query->type == PIPE_QUERY_OCCLUSION_COUNTER ? ctx->num_db : 1);
+ size = query->num_results * (query->type == PIPE_QUERY_OCCLUSION_COUNTER ? ctx->max_db : 1);
for (i = 0; i < size; i += 4) {
start = (u64)results[i] | (u64)results[i + 1] << 32;
end = (u64)results[i + 2] | (u64)results[i + 3] << 32;
@@ -1344,7 +1347,7 @@ void r600_query_end(struct r600_context *ctx, struct r600_query *query)
ctx->pm4[ctx->pm4_cdwords++] = 0;
r600_context_bo_reloc(ctx, &ctx->pm4[ctx->pm4_cdwords - 1], query->buffer);
- query->num_results += 4 * (query->type == PIPE_QUERY_OCCLUSION_COUNTER ? ctx->num_db : 1);
+ query->num_results += 4 * (query->type == PIPE_QUERY_OCCLUSION_COUNTER ? ctx->max_db : 1);
query->state ^= R600_QUERY_STATE_STARTED;
query->state |= R600_QUERY_STATE_ENDED;
ctx->num_query_running--;