summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_query.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2010-09-16 20:22:09 +1000
committerDave Airlie <[email protected]>2010-09-17 10:57:49 +1000
commitf70f79f6f6027bdf2f7de09bb39e12a24420f338 (patch)
tree8ee84c9ddd557fddc10ee11837108eb23768235d /src/gallium/drivers/r600/r600_query.c
parentec9d838aa56d2c4bc5649d7c26ac61abb6c4b9bb (diff)
r600g: attempt to abstract kernel bos from pipe driver.
introduce an abstraction layer between kernel bos and the winsys BOs. this is to allow plugging in pb manager with minimal disruption to pipe driver.
Diffstat (limited to 'src/gallium/drivers/r600/r600_query.c')
-rw-r--r--src/gallium/drivers/r600/r600_query.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gallium/drivers/r600/r600_query.c b/src/gallium/drivers/r600/r600_query.c
index 68358f9dd71..922d7ace130 100644
--- a/src/gallium/drivers/r600/r600_query.c
+++ b/src/gallium/drivers/r600/r600_query.c
@@ -39,7 +39,7 @@ static void r600_query_begin(struct r600_context *rctx, struct r600_query *rquer
radeon_state_fini(rstate);
radeon_state_init(rstate, rscreen->rw, R600_STATE_QUERY_BEGIN, 0, 0);
rstate->states[R600_QUERY__OFFSET] = rquery->num_results;
- rstate->bo[0] = radeon_bo_incref(rscreen->rw, rquery->buffer);
+ radeon_ws_bo_reference(rscreen->rw, &rstate->bo[0], rquery->buffer);
rstate->nbo = 1;
rstate->placement[0] = RADEON_GEM_DOMAIN_GTT;
if (radeon_state_pm4(rstate)) {
@@ -55,7 +55,7 @@ static void r600_query_end(struct r600_context *rctx, struct r600_query *rquery)
radeon_state_fini(rstate);
radeon_state_init(rstate, rscreen->rw, R600_STATE_QUERY_END, 0, 0);
rstate->states[R600_QUERY__OFFSET] = rquery->num_results + 8;
- rstate->bo[0] = radeon_bo_incref(rscreen->rw, rquery->buffer);
+ radeon_ws_bo_reference(rscreen->rw, &rstate->bo[0], rquery->buffer);
rstate->nbo = 1;
rstate->placement[0] = RADEON_GEM_DOMAIN_GTT;
if (radeon_state_pm4(rstate)) {
@@ -79,7 +79,7 @@ static struct pipe_query *r600_create_query(struct pipe_context *ctx, unsigned q
q->type = query_type;
q->buffer_size = 4096;
- q->buffer = radeon_bo(rscreen->rw, 0, q->buffer_size, 1, NULL);
+ q->buffer = radeon_ws_bo(rscreen->rw, q->buffer_size, 1);
if (!q->buffer) {
FREE(q);
return NULL;
@@ -96,7 +96,7 @@ static void r600_destroy_query(struct pipe_context *ctx,
struct r600_screen *rscreen = r600_screen(ctx->screen);
struct r600_query *q = r600_query(query);
- radeon_bo_decref(rscreen->rw, q->buffer);
+ radeon_ws_bo_reference(rscreen->rw, &q->buffer, NULL);
LIST_DEL(&q->list);
FREE(query);
}
@@ -108,9 +108,8 @@ static void r600_query_result(struct pipe_context *ctx, struct r600_query *rquer
u32 *results;
int i;
- radeon_bo_wait(rscreen->rw, rquery->buffer);
- radeon_bo_map(rscreen->rw, rquery->buffer);
- results = rquery->buffer->data;
+ radeon_ws_bo_wait(rscreen->rw, rquery->buffer);
+ results = radeon_ws_bo_map(rscreen->rw, rquery->buffer);
for (i = 0; i < rquery->num_results; i += 4) {
start = (u64)results[i] | (u64)results[i + 1] << 32;
end = (u64)results[i + 2] | (u64)results[i + 3] << 32;
@@ -118,7 +117,7 @@ static void r600_query_result(struct pipe_context *ctx, struct r600_query *rquer
rquery->result += end - start;
}
}
- radeon_bo_unmap(rscreen->rw, rquery->buffer);
+ radeon_ws_bo_unmap(rscreen->rw, rquery->buffer);
rquery->num_results = 0;
}