goto err;
/* initialize buffer with zeroes */
- results = ctx->screen->ws->buffer_map(buffer->buf, ctx->cs, PIPE_TRANSFER_WRITE);
+ results = ctx->ws->buffer_map(buffer->buf, ctx->cs, PIPE_TRANSFER_WRITE);
if (results) {
memset(results, 0, ctx->max_db * 4 * 4);
- ctx->screen->ws->buffer_unmap(buffer->buf);
+ ctx->ws->buffer_unmap(buffer->buf);
/* emit EVENT_WRITE for ZPASS_DONE */
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE, 2, 0);
ctx->pm4[ctx->pm4_cdwords++] = r600_context_bo_reloc(ctx, buffer, RADEON_USAGE_WRITE);
/* analyze results */
- results = ctx->screen->ws->buffer_map(buffer->buf, ctx->cs, PIPE_TRANSFER_READ);
+ results = ctx->ws->buffer_map(buffer->buf, ctx->cs, PIPE_TRANSFER_READ);
if (results) {
for(i = 0; i < ctx->max_db; i++) {
/* at least highest bit will be set if backend is used */
if (results[i*4 + 1])
mask |= (1<<i);
}
- ctx->screen->ws->buffer_unmap(buffer->buf);
+ ctx->ws->buffer_unmap(buffer->buf);
}
}
free(ctx->range);
free(ctx->blocks);
free(ctx->bo);
- ctx->screen->ws->cs_destroy(ctx->cs);
+ ctx->ws->cs_destroy(ctx->cs);
memset(ctx, 0, sizeof(struct r600_context));
}
memset(ctx, 0, sizeof(struct r600_context));
ctx->screen = screen;
+ ctx->ws = screen->ws;
LIST_INITHEAD(&ctx->active_query_list);
/* Flush the CS. */
ctx->cs->cdw = ctx->pm4_cdwords;
- ctx->screen->ws->cs_flush(ctx->cs, flags);
+ ctx->ws->cs_flush(ctx->cs, flags);
/* We need to get the pointer to the other CS,
* the command streams are double-buffered. */
unsigned results_base = query->results_start;
u32 *map;
- map = ctx->screen->ws->buffer_map(query->buffer->buf, ctx->cs,
+ map = ctx->ws->buffer_map(query->buffer->buf, ctx->cs,
PIPE_TRANSFER_READ | (wait ? 0 : PIPE_TRANSFER_DONTBLOCK));
if (!map)
return FALSE;
}
query->results_start = query->results_end;
- ctx->screen->ws->buffer_unmap(query->buffer->buf);
+ ctx->ws->buffer_unmap(query->buffer->buf);
return TRUE;
}
u32 *results;
int i;
- results = ctx->screen->ws->buffer_map(query->buffer->buf, ctx->cs, PIPE_TRANSFER_WRITE);
+ results = ctx->ws->buffer_map(query->buffer->buf, ctx->cs, PIPE_TRANSFER_WRITE);
if (results) {
results = (u32*)((char*)results + query->results_end);
memset(results, 0, query->result_size);
results[(i * 4)+3] = 0x80000000;
}
}
- ctx->screen->ws->buffer_unmap(query->buffer->buf);
+ ctx->ws->buffer_unmap(query->buffer->buf);
}
}