struct list_head query_list;
unsigned num_query_running;
struct list_head fenced_bo;
+ unsigned num_db; /* for OQ */
};
struct r600_draw {
/* init dirty list */
LIST_INITHEAD(&ctx->dirty);
+
+ /* TODO update this value correctly */
+ ctx->num_db = 4;
+
return 0;
out_err:
r600_context_fini(ctx);
u64 start, end;
u32 *results;
int i;
+ int size;
if (wait)
results = r600_bo_map(ctx->radeon, query->buffer, PB_USAGE_CPU_READ, NULL);
if (!results)
return FALSE;
- for (i = 0; i < query->num_results; i += 4) {
+ size = query->num_results * (query->type == PIPE_QUERY_OCCLUSION_COUNTER ? ctx->num_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;
if (((start & 0x8000000000000000UL) && (end & 0x8000000000000000UL))
ctx->pm4[ctx->pm4_cdwords++] = 0;
r600_context_bo_reloc(ctx, &ctx->pm4[ctx->pm4_cdwords - 1], query->buffer);
- query->num_results += 4;
+ query->num_results += 4 * (query->type == PIPE_QUERY_OCCLUSION_COUNTER ? ctx->num_db : 1);
query->state ^= R600_QUERY_STATE_STARTED;
query->state |= R600_QUERY_STATE_ENDED;
ctx->num_query_running--;