gallium: adapt to get_query_result interface change
authorMarek Olšák <maraeo@gmail.com>
Tue, 27 Mar 2012 20:42:30 +0000 (22:42 +0200)
committerMarek Olšák <maraeo@gmail.com>
Fri, 30 Mar 2012 15:12:51 +0000 (17:12 +0200)
Reviewed-by: Brian Paul <brianp@vmware.com>
16 files changed:
src/gallium/drivers/galahad/glhd_context.c
src/gallium/drivers/i915/i915_query.c
src/gallium/drivers/identity/id_context.c
src/gallium/drivers/llvmpipe/lp_query.c
src/gallium/drivers/noop/noop_pipe.c
src/gallium/drivers/nv50/nv50_query.c
src/gallium/drivers/nvc0/nvc0_push.c
src/gallium/drivers/nvc0/nvc0_query.c
src/gallium/drivers/nvfx/nvfx_query.c
src/gallium/drivers/r300/r300_query.c
src/gallium/drivers/r600/r600_query.c
src/gallium/drivers/rbug/rbug_context.c
src/gallium/drivers/softpipe/sp_query.c
src/gallium/drivers/svga/svga_pipe_query.c
src/gallium/drivers/trace/tr_context.c
src/mesa/state_tracker/st_cb_queryobj.c

index f71048022ef5c9ca150998ca618653332e22075f..0bb18884c8dfdb5b4774e9e7ef2b00e3784c342d 100644 (file)
@@ -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;
index c886df74bad5564687d9e03e3c2be16a9d1baa16..0efceb192b63de350731bcf9e6464ec768f3a899 100644 (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,
                                      struct pipe_query *query,
                                      boolean wait,
-                                     void *vresult)
+                                     union pipe_query_result *vresult)
 {
    uint64_t *result = (uint64_t*)vresult;
 
index 681ef7bf097a75fcf0492cac808d67d47aea3ff5..af3f8239ccd9372b228dbb6eeea55eaee31e0059 100644 (file)
@@ -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;
index 42eb8566ef41a3403402aa975c5caea5d93f0dfb..20c0a1e0bcb8f95f0bbd7be3eee8640ce99673ab 100644 (file)
@@ -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
index 5453def8df5b227556a31ef24b74cf5a4c03ce70..e47f944b59b5b24e308d08e079aab8fd4e3f3d8b 100644 (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,
                                        struct pipe_query *query,
-                                       boolean wait, void *vresult)
+                                       boolean wait,
+                                       union pipe_query_result *vresult)
 {
        uint64_t *result = (uint64_t*)vresult;
 
index 2dce94a477515a2c022003c1e0200a901af321cd..59d315aa4756137b3d86386242cee89ecd0adee3 100644 (file)
@@ -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) {
index 412186c23454345c551844b7f50e698a520a416a..cea58b447a28996880b45305eb884c535c4347be 100644 (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 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;
       }
    }
index 7244d838f7d8594326923cbf9a72a1c2d3efe3a8..699d582fe3d1ec5486cf7b9d9c1a88344d6a5032 100644 (file)
@@ -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;
 
index 3cd6bf1e477d6870a96afecdf5ed90779549322f..76fb715b830bab47f0a679cd7a3e40922f1de7a0 100644 (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.
         */
        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);
index bcf6d0eb475116dc64732c63fce8505ec9af8669..829370b8dac22da3e1a741349a826888612fcb7b 100644 (file)
@@ -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;
         }
     }
index a0e1ac3e4a0bdbfe4d0665a610a18ab82a5cea61..8a7c7e307389dc951f924fe096dd1b107e242252 100644 (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,
                                        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;
index 3aa4f85babbc35d3e71d1d1e7b6a985d79392bb2..46518cd6977ffb178b8e2ac48e61e63105a6876b 100644 (file)
@@ -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;
index 2e54e0230917f8381a0ada16ce687b56dae0d141..c173736d71484016d44cf4ebfb04540d096c8e31 100644 (file)
@@ -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
index c44e0b8ec498af2a67d00a00d9ec4733695d9786..902f84c032ecfc0ed03c8586f793093bcec22199 100644 (file)
@@ -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 );
index b582abc8692f34d1cc09c50f883f75a1c0499e15..51a8b259a0497d1c1a61d4cd3e23d9dea0e58949 100644 (file)
@@ -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);
index 057499615bf7d43db82616da89641ed7a8616451..b6a236e8d99efbc9a20b4634d86c0584db1c7755 100644 (file)
@@ -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);
 }