From 4445e170bee23a3607ece0e010adef7058ac6a11 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 27 Mar 2012 22:42:30 +0200 Subject: [PATCH] gallium: adapt to get_query_result interface change Reviewed-by: Brian Paul --- src/gallium/drivers/galahad/glhd_context.c | 2 +- src/gallium/drivers/i915/i915_query.c | 2 +- src/gallium/drivers/identity/id_context.c | 2 +- src/gallium/drivers/llvmpipe/lp_query.c | 4 ++-- src/gallium/drivers/noop/noop_pipe.c | 3 ++- src/gallium/drivers/nv50/nv50_query.c | 6 +++--- src/gallium/drivers/nvc0/nvc0_push.c | 2 +- src/gallium/drivers/nvc0/nvc0_query.c | 8 ++++---- src/gallium/drivers/nvfx/nvfx_query.c | 6 +++--- src/gallium/drivers/r300/r300_query.c | 4 ++-- src/gallium/drivers/r600/r600_query.c | 2 +- src/gallium/drivers/rbug/rbug_context.c | 2 +- src/gallium/drivers/softpipe/sp_query.c | 5 +++-- src/gallium/drivers/svga/svga_pipe_query.c | 6 +++--- src/gallium/drivers/trace/tr_context.c | 3 ++- src/mesa/state_tracker/st_cb_queryobj.c | 4 ++-- 16 files changed, 32 insertions(+), 29 deletions(-) diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c index f71048022ef..0bb18884c8d 100644 --- a/src/gallium/drivers/galahad/glhd_context.c +++ b/src/gallium/drivers/galahad/glhd_context.c @@ -119,7 +119,7 @@ static boolean galahad_get_query_result(struct pipe_context *_pipe, struct pipe_query *query, boolean wait, - void *result) + union pipe_query_result *result) { struct galahad_context *glhd_pipe = galahad_context(_pipe); struct pipe_context *pipe = glhd_pipe->pipe; diff --git a/src/gallium/drivers/i915/i915_query.c b/src/gallium/drivers/i915/i915_query.c index c886df74bad..0efceb192b6 100644 --- a/src/gallium/drivers/i915/i915_query.c +++ b/src/gallium/drivers/i915/i915_query.c @@ -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, struct pipe_query *query, boolean wait, - void *vresult) + union pipe_query_result *vresult) { uint64_t *result = (uint64_t*)vresult; diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c index 681ef7bf097..af3f8239ccd 100644 --- a/src/gallium/drivers/identity/id_context.c +++ b/src/gallium/drivers/identity/id_context.c @@ -103,7 +103,7 @@ static boolean identity_get_query_result(struct pipe_context *_pipe, struct pipe_query *query, boolean wait, - void *result) + union pipe_query_result *result) { struct identity_context *id_pipe = identity_context(_pipe); struct pipe_context *pipe = id_pipe->pipe; diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c index 42eb8566ef4..20c0a1e0bcb 100644 --- a/src/gallium/drivers/llvmpipe/lp_query.c +++ b/src/gallium/drivers/llvmpipe/lp_query.c @@ -85,7 +85,7 @@ static boolean llvmpipe_get_query_result(struct pipe_context *pipe, struct pipe_query *q, boolean wait, - void *vresult) + union pipe_query_result *vresult) { struct llvmpipe_query *pq = llvmpipe_query(q); 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 || 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) return result > 0; else diff --git a/src/gallium/drivers/noop/noop_pipe.c b/src/gallium/drivers/noop/noop_pipe.c index 5453def8df5..e47f944b59b 100644 --- a/src/gallium/drivers/noop/noop_pipe.c +++ b/src/gallium/drivers/noop/noop_pipe.c @@ -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, struct pipe_query *query, - boolean wait, void *vresult) + boolean wait, + union pipe_query_result *vresult) { uint64_t *result = (uint64_t*)vresult; diff --git a/src/gallium/drivers/nv50/nv50_query.c b/src/gallium/drivers/nv50/nv50_query.c index 2dce94a4775..59d315aa475 100644 --- a/src/gallium/drivers/nv50/nv50_query.c +++ b/src/gallium/drivers/nv50/nv50_query.c @@ -243,11 +243,11 @@ nv50_query_wait(struct nv50_query *q) static boolean 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); - uint64_t *res64 = result; - boolean *res8 = result; + uint64_t *res64 = (uint64_t*)result; + boolean *res8 = (boolean*)result; uint64_t *data64 = (uint64_t *)q->data; if (q->type == PIPE_QUERY_GPU_FINISHED) { diff --git a/src/gallium/drivers/nvc0/nvc0_push.c b/src/gallium/drivers/nvc0/nvc0_push.c index 412186c2345..cea58b447a2 100644 --- a/src/gallium/drivers/nvc0/nvc0_push.c +++ b/src/gallium/drivers/nvc0/nvc0_push.c @@ -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 nvc0_so_target *targ; 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; } } diff --git a/src/gallium/drivers/nvc0/nvc0_query.c b/src/gallium/drivers/nvc0/nvc0_query.c index 7244d838f7d..699d582fe3d 100644 --- a/src/gallium/drivers/nvc0/nvc0_query.c +++ b/src/gallium/drivers/nvc0/nvc0_query.c @@ -338,12 +338,12 @@ nvc0_query_wait(struct nvc0_query *q) static boolean 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); - uint64_t *res64 = result; - uint32_t *res32 = result; - boolean *res8 = result; + uint64_t *res64 = (uint64_t*)result; + uint32_t *res32 = (uint32_t*)result; + boolean *res8 = (boolean*)result; uint64_t *data64 = (uint64_t *)q->data; unsigned i; diff --git a/src/gallium/drivers/nvfx/nvfx_query.c b/src/gallium/drivers/nvfx/nvfx_query.c index 3cd6bf1e477..76fb715b830 100644 --- a/src/gallium/drivers/nvfx/nvfx_query.c +++ b/src/gallium/drivers/nvfx/nvfx_query.c @@ -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. */ 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)) { struct nvfx_query* oldestq; assert(!LIST_IS_EMPTY(&nvfx->screen->query_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); @@ -105,7 +105,7 @@ nvfx_query_end(struct pipe_context *pipe, struct pipe_query *pq) static boolean 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; struct nvfx_context *nvfx = nvfx_context(pipe); diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c index bcf6d0eb475..829370b8dac 100644 --- a/src/gallium/drivers/r300/r300_query.c +++ b/src/gallium/drivers/r300/r300_query.c @@ -135,7 +135,7 @@ static void r300_end_query(struct pipe_context* pipe, static boolean r300_get_query_result(struct pipe_context* pipe, struct pipe_query* query, boolean wait, - void* vresult) + union pipe_query_result *vresult) { struct r300_context* r300 = r300_context(pipe); 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 || 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; } } diff --git a/src/gallium/drivers/r600/r600_query.c b/src/gallium/drivers/r600/r600_query.c index a0e1ac3e4a0..8a7c7e30738 100644 --- a/src/gallium/drivers/r600/r600_query.c +++ b/src/gallium/drivers/r600/r600_query.c @@ -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, 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_query *rquery = (struct r600_query *)query; diff --git a/src/gallium/drivers/rbug/rbug_context.c b/src/gallium/drivers/rbug/rbug_context.c index 3aa4f85babb..46518cd6977 100644 --- a/src/gallium/drivers/rbug/rbug_context.c +++ b/src/gallium/drivers/rbug/rbug_context.c @@ -182,7 +182,7 @@ static boolean rbug_get_query_result(struct pipe_context *_pipe, struct pipe_query *query, boolean wait, - void *result) + union pipe_query_result *result) { struct rbug_context *rb_pipe = rbug_context(_pipe); struct pipe_context *pipe = rb_pipe->pipe; diff --git a/src/gallium/drivers/softpipe/sp_query.c b/src/gallium/drivers/softpipe/sp_query.c index 2e54e023091..c173736d714 100644 --- a/src/gallium/drivers/softpipe/sp_query.c +++ b/src/gallium/drivers/softpipe/sp_query.c @@ -157,7 +157,7 @@ static boolean softpipe_get_query_result(struct pipe_context *pipe, struct pipe_query *q, boolean wait, - void *vresult) + union pipe_query_result *vresult) { struct softpipe_query *sq = softpipe_query(q); 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 || 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) return result > 0; else diff --git a/src/gallium/drivers/svga/svga_pipe_query.c b/src/gallium/drivers/svga/svga_pipe_query.c index c44e0b8ec49..902f84c032e 100644 --- a/src/gallium/drivers/svga/svga_pipe_query.c +++ b/src/gallium/drivers/svga/svga_pipe_query.c @@ -63,7 +63,7 @@ svga_query( struct pipe_query *q ) static boolean svga_get_query_result(struct pipe_context *pipe, struct pipe_query *q, boolean wait, - void *result); + union pipe_query_result *result); static struct pipe_query *svga_create_query( struct pipe_context *pipe, unsigned query_type ) @@ -156,7 +156,7 @@ static void svga_begin_query(struct pipe_context *pipe, */ 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); } @@ -207,7 +207,7 @@ static void svga_end_query(struct pipe_context *pipe, static boolean svga_get_query_result(struct pipe_context *pipe, struct pipe_query *q, boolean wait, - void *vresult) + union pipe_query_result *vresult) { struct svga_context *svga = svga_context( pipe ); struct svga_screen *svgascreen = svga_screen( pipe->screen ); diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index b582abc8692..51a8b259a04 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -181,7 +181,7 @@ static INLINE boolean trace_context_get_query_result(struct pipe_context *_pipe, struct pipe_query *query, boolean wait, - void *presult) + union pipe_query_result *presult) { struct trace_context *tr_ctx = trace_context(_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); _result = pipe->get_query_result(pipe, query, wait, presult); + /* XXX this depends on the query type */ result = *((uint64_t*)presult); trace_dump_arg(uint, result); diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c index 057499615bf..b6a236e8d99 100644 --- a/src/mesa/state_tracker/st_cb_queryobj.c +++ b/src/mesa/state_tracker/st_cb_queryobj.c @@ -150,7 +150,7 @@ st_WaitQuery(struct gl_context *ctx, struct gl_query_object *q) !pipe->get_query_result(pipe, stq->pq, TRUE, - &q->Result)) + (void*)&q->Result)) { /* 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 st_query_object *stq = st_query_object(q); 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); } -- 2.30.2