gallium: adapt to get_query_result interface change

Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Marek Olšák
2012-03-27 22:42:30 +02:00
parent 102ed41ae6
commit 4445e170be
16 changed files with 32 additions and 29 deletions

View File

@@ -119,7 +119,7 @@ static boolean
galahad_get_query_result(struct pipe_context *_pipe, galahad_get_query_result(struct pipe_context *_pipe,
struct pipe_query *query, struct pipe_query *query,
boolean wait, boolean wait,
void *result) union pipe_query_result *result)
{ {
struct galahad_context *glhd_pipe = galahad_context(_pipe); struct galahad_context *glhd_pipe = galahad_context(_pipe);
struct pipe_context *pipe = glhd_pipe->pipe; struct pipe_context *pipe = glhd_pipe->pipe;

View File

@@ -65,7 +65,7 @@ static void i915_end_query(struct pipe_context *ctx, struct pipe_query *query)
static boolean i915_get_query_result(struct pipe_context *ctx, static boolean i915_get_query_result(struct pipe_context *ctx,
struct pipe_query *query, struct pipe_query *query,
boolean wait, boolean wait,
void *vresult) union pipe_query_result *vresult)
{ {
uint64_t *result = (uint64_t*)vresult; uint64_t *result = (uint64_t*)vresult;

View File

@@ -103,7 +103,7 @@ static boolean
identity_get_query_result(struct pipe_context *_pipe, identity_get_query_result(struct pipe_context *_pipe,
struct pipe_query *query, struct pipe_query *query,
boolean wait, boolean wait,
void *result) union pipe_query_result *result)
{ {
struct identity_context *id_pipe = identity_context(_pipe); struct identity_context *id_pipe = identity_context(_pipe);
struct pipe_context *pipe = id_pipe->pipe; struct pipe_context *pipe = id_pipe->pipe;

View File

@@ -85,7 +85,7 @@ static boolean
llvmpipe_get_query_result(struct pipe_context *pipe, llvmpipe_get_query_result(struct pipe_context *pipe,
struct pipe_query *q, struct pipe_query *q,
boolean wait, boolean wait,
void *vresult) union pipe_query_result *vresult)
{ {
struct llvmpipe_query *pq = llvmpipe_query(q); struct llvmpipe_query *pq = llvmpipe_query(q);
uint64_t *result = (uint64_t *)vresult; uint64_t *result = (uint64_t *)vresult;
@@ -166,7 +166,7 @@ llvmpipe_check_render_cond(struct llvmpipe_context *lp)
wait = (lp->render_cond_mode == PIPE_RENDER_COND_WAIT || wait = (lp->render_cond_mode == PIPE_RENDER_COND_WAIT ||
lp->render_cond_mode == PIPE_RENDER_COND_BY_REGION_WAIT); lp->render_cond_mode == PIPE_RENDER_COND_BY_REGION_WAIT);
b = pipe->get_query_result(pipe, lp->render_cond_query, wait, &result); b = pipe->get_query_result(pipe, lp->render_cond_query, wait, (void*)&result);
if (b) if (b)
return result > 0; return result > 0;
else else

View File

@@ -68,7 +68,8 @@ static void noop_end_query(struct pipe_context *ctx, struct pipe_query *query)
static boolean noop_get_query_result(struct pipe_context *ctx, static boolean noop_get_query_result(struct pipe_context *ctx,
struct pipe_query *query, struct pipe_query *query,
boolean wait, void *vresult) boolean wait,
union pipe_query_result *vresult)
{ {
uint64_t *result = (uint64_t*)vresult; uint64_t *result = (uint64_t*)vresult;

View File

@@ -243,11 +243,11 @@ nv50_query_wait(struct nv50_query *q)
static boolean static boolean
nv50_query_result(struct pipe_context *pipe, struct pipe_query *pq, nv50_query_result(struct pipe_context *pipe, struct pipe_query *pq,
boolean wait, void *result) boolean wait, union pipe_query_result *result)
{ {
struct nv50_query *q = nv50_query(pq); struct nv50_query *q = nv50_query(pq);
uint64_t *res64 = result; uint64_t *res64 = (uint64_t*)result;
boolean *res8 = result; boolean *res8 = (boolean*)result;
uint64_t *data64 = (uint64_t *)q->data; uint64_t *data64 = (uint64_t *)q->data;
if (q->type == PIPE_QUERY_GPU_FINISHED) { if (q->type == PIPE_QUERY_GPU_FINISHED) {

View File

@@ -344,7 +344,7 @@ nvc0_push_vbo(struct nvc0_context *nvc0, const struct pipe_draw_info *info)
struct pipe_context *pipe = &nvc0->base.pipe; struct pipe_context *pipe = &nvc0->base.pipe;
struct nvc0_so_target *targ; struct nvc0_so_target *targ;
targ = nvc0_so_target(info->count_from_stream_output); targ = nvc0_so_target(info->count_from_stream_output);
pipe->get_query_result(pipe, targ->pq, TRUE, &vert_count); pipe->get_query_result(pipe, targ->pq, TRUE, (void*)&vert_count);
vert_count /= targ->stride; vert_count /= targ->stride;
} }
} }

View File

@@ -338,12 +338,12 @@ nvc0_query_wait(struct nvc0_query *q)
static boolean static boolean
nvc0_query_result(struct pipe_context *pipe, struct pipe_query *pq, nvc0_query_result(struct pipe_context *pipe, struct pipe_query *pq,
boolean wait, void *result) boolean wait, union pipe_query_result *result)
{ {
struct nvc0_query *q = nvc0_query(pq); struct nvc0_query *q = nvc0_query(pq);
uint64_t *res64 = result; uint64_t *res64 = (uint64_t*)result;
uint32_t *res32 = result; uint32_t *res32 = (uint32_t*)result;
boolean *res8 = result; boolean *res8 = (boolean*)result;
uint64_t *data64 = (uint64_t *)q->data; uint64_t *data64 = (uint64_t *)q->data;
unsigned i; unsigned i;

View File

@@ -59,14 +59,14 @@ nvfx_query_begin(struct pipe_context *pipe, struct pipe_query *pq)
* the existing query to notify completion, but it could be better. * the existing query to notify completion, but it could be better.
*/ */
if (q->object) if (q->object)
pipe->get_query_result(pipe, pq, 1, &tmp); pipe->get_query_result(pipe, pq, 1, (void*)&tmp);
while (nouveau_resource_alloc(nvfx->screen->query_heap, 1, NULL, &q->object)) while (nouveau_resource_alloc(nvfx->screen->query_heap, 1, NULL, &q->object))
{ {
struct nvfx_query* oldestq; struct nvfx_query* oldestq;
assert(!LIST_IS_EMPTY(&nvfx->screen->query_list)); assert(!LIST_IS_EMPTY(&nvfx->screen->query_list));
oldestq = LIST_ENTRY(struct nvfx_query, nvfx->screen->query_list.next, list); oldestq = LIST_ENTRY(struct nvfx_query, nvfx->screen->query_list.next, list);
pipe->get_query_result(pipe, (struct pipe_query*)oldestq, 1, &tmp); pipe->get_query_result(pipe, (struct pipe_query*)oldestq, 1, (void*)&tmp);
} }
LIST_ADDTAIL(&q->list, &nvfx->screen->query_list); LIST_ADDTAIL(&q->list, &nvfx->screen->query_list);
@@ -105,7 +105,7 @@ nvfx_query_end(struct pipe_context *pipe, struct pipe_query *pq)
static boolean static boolean
nvfx_query_result(struct pipe_context *pipe, struct pipe_query *pq, nvfx_query_result(struct pipe_context *pipe, struct pipe_query *pq,
boolean wait, void *vresult) boolean wait, union pipe_query_result *vresult)
{ {
uint64_t *result = (uint64_t *)vresult; uint64_t *result = (uint64_t *)vresult;
struct nvfx_context *nvfx = nvfx_context(pipe); struct nvfx_context *nvfx = nvfx_context(pipe);

View File

@@ -135,7 +135,7 @@ static void r300_end_query(struct pipe_context* pipe,
static boolean r300_get_query_result(struct pipe_context* pipe, static boolean r300_get_query_result(struct pipe_context* pipe,
struct pipe_query* query, struct pipe_query* query,
boolean wait, boolean wait,
void* vresult) union pipe_query_result *vresult)
{ {
struct r300_context* r300 = r300_context(pipe); struct r300_context* r300 = r300_context(pipe);
struct r300_query *q = r300_query(query); struct r300_query *q = r300_query(query);
@@ -191,7 +191,7 @@ static void r300_render_condition(struct pipe_context *pipe,
wait = mode == PIPE_RENDER_COND_WAIT || wait = mode == PIPE_RENDER_COND_WAIT ||
mode == PIPE_RENDER_COND_BY_REGION_WAIT; mode == PIPE_RENDER_COND_BY_REGION_WAIT;
if (r300_get_query_result(pipe, query, wait, &result)) { if (r300_get_query_result(pipe, query, wait, (void*)&result)) {
r300->skip_rendering = result == 0; r300->skip_rendering = result == 0;
} }
} }

View File

@@ -483,7 +483,7 @@ static boolean r600_get_query_buffer_result(struct r600_context *ctx,
static boolean r600_get_query_result(struct pipe_context *ctx, static boolean r600_get_query_result(struct pipe_context *ctx,
struct pipe_query *query, struct pipe_query *query,
boolean wait, void *vresult) boolean wait, union pipe_query_result *vresult)
{ {
struct r600_context *rctx = (struct r600_context *)ctx; struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_query *rquery = (struct r600_query *)query; struct r600_query *rquery = (struct r600_query *)query;

View File

@@ -182,7 +182,7 @@ static boolean
rbug_get_query_result(struct pipe_context *_pipe, rbug_get_query_result(struct pipe_context *_pipe,
struct pipe_query *query, struct pipe_query *query,
boolean wait, boolean wait,
void *result) union pipe_query_result *result)
{ {
struct rbug_context *rb_pipe = rbug_context(_pipe); struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe; struct pipe_context *pipe = rb_pipe->pipe;

View File

@@ -157,7 +157,7 @@ static boolean
softpipe_get_query_result(struct pipe_context *pipe, softpipe_get_query_result(struct pipe_context *pipe,
struct pipe_query *q, struct pipe_query *q,
boolean wait, boolean wait,
void *vresult) union pipe_query_result *vresult)
{ {
struct softpipe_query *sq = softpipe_query(q); struct softpipe_query *sq = softpipe_query(q);
uint64_t *result = (uint64_t*)vresult; uint64_t *result = (uint64_t*)vresult;
@@ -211,7 +211,8 @@ softpipe_check_render_cond(struct softpipe_context *sp)
wait = (sp->render_cond_mode == PIPE_RENDER_COND_WAIT || wait = (sp->render_cond_mode == PIPE_RENDER_COND_WAIT ||
sp->render_cond_mode == PIPE_RENDER_COND_BY_REGION_WAIT); sp->render_cond_mode == PIPE_RENDER_COND_BY_REGION_WAIT);
b = pipe->get_query_result(pipe, sp->render_cond_query, wait, &result); b = pipe->get_query_result(pipe, sp->render_cond_query, wait,
(void*)&result);
if (b) if (b)
return result > 0; return result > 0;
else else

View File

@@ -63,7 +63,7 @@ svga_query( struct pipe_query *q )
static boolean svga_get_query_result(struct pipe_context *pipe, static boolean svga_get_query_result(struct pipe_context *pipe,
struct pipe_query *q, struct pipe_query *q,
boolean wait, boolean wait,
void *result); union pipe_query_result *result);
static struct pipe_query *svga_create_query( struct pipe_context *pipe, static struct pipe_query *svga_create_query( struct pipe_context *pipe,
unsigned query_type ) unsigned query_type )
@@ -156,7 +156,7 @@ static void svga_begin_query(struct pipe_context *pipe,
*/ */
uint64_t result; uint64_t result;
svga_get_query_result(pipe, q, TRUE, &result); svga_get_query_result(pipe, q, TRUE, (void*)&result);
assert(sq->queryResult->state != SVGA3D_QUERYSTATE_PENDING); assert(sq->queryResult->state != SVGA3D_QUERYSTATE_PENDING);
} }
@@ -207,7 +207,7 @@ static void svga_end_query(struct pipe_context *pipe,
static boolean svga_get_query_result(struct pipe_context *pipe, static boolean svga_get_query_result(struct pipe_context *pipe,
struct pipe_query *q, struct pipe_query *q,
boolean wait, boolean wait,
void *vresult) union pipe_query_result *vresult)
{ {
struct svga_context *svga = svga_context( pipe ); struct svga_context *svga = svga_context( pipe );
struct svga_screen *svgascreen = svga_screen( pipe->screen ); struct svga_screen *svgascreen = svga_screen( pipe->screen );

View File

@@ -181,7 +181,7 @@ static INLINE boolean
trace_context_get_query_result(struct pipe_context *_pipe, trace_context_get_query_result(struct pipe_context *_pipe,
struct pipe_query *query, struct pipe_query *query,
boolean wait, boolean wait,
void *presult) union pipe_query_result *presult)
{ {
struct trace_context *tr_ctx = trace_context(_pipe); struct trace_context *tr_ctx = trace_context(_pipe);
struct pipe_context *pipe = tr_ctx->pipe; struct pipe_context *pipe = tr_ctx->pipe;
@@ -193,6 +193,7 @@ trace_context_get_query_result(struct pipe_context *_pipe,
trace_dump_arg(ptr, pipe); trace_dump_arg(ptr, pipe);
_result = pipe->get_query_result(pipe, query, wait, presult); _result = pipe->get_query_result(pipe, query, wait, presult);
/* XXX this depends on the query type */
result = *((uint64_t*)presult); result = *((uint64_t*)presult);
trace_dump_arg(uint, result); trace_dump_arg(uint, result);

View File

@@ -150,7 +150,7 @@ st_WaitQuery(struct gl_context *ctx, struct gl_query_object *q)
!pipe->get_query_result(pipe, !pipe->get_query_result(pipe,
stq->pq, stq->pq,
TRUE, TRUE,
&q->Result)) (void*)&q->Result))
{ {
/* nothing */ /* nothing */
} }
@@ -165,7 +165,7 @@ st_CheckQuery(struct gl_context *ctx, struct gl_query_object *q)
struct pipe_context *pipe = st_context(ctx)->pipe; struct pipe_context *pipe = st_context(ctx)->pipe;
struct st_query_object *stq = st_query_object(q); struct st_query_object *stq = st_query_object(q);
assert(!q->Ready); /* we should not get called if Ready is TRUE */ assert(!q->Ready); /* we should not get called if Ready is TRUE */
q->Ready = pipe->get_query_result(pipe, stq->pq, FALSE, &q->Result); q->Ready = pipe->get_query_result(pipe, stq->pq, FALSE, (void*)&q->Result);
} }