Reviewed-by: Brian Paul <brianp@vmware.com>tags/i965-primitive-restart-v2
| @@ -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; | |||
| @@ -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; | |||
| @@ -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; | |||
| @@ -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 | |||
| @@ -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; | |||
| @@ -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) { | |||
| @@ -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; | |||
| } | |||
| } | |||
| @@ -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; | |||
| @@ -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); | |||
| @@ -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; | |||
| } | |||
| } | |||
| @@ -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; | |||
| @@ -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; | |||
| @@ -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 | |||
| @@ -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 ); | |||
| @@ -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); | |||
| @@ -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); | |||
| } | |||