freedreno: Remove always-true return from per-gen begin_query.
authorEric Anholt <eric@anholt.net>
Fri, 27 Mar 2020 23:46:22 +0000 (16:46 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 30 Mar 2020 21:35:21 +0000 (21:35 +0000)
You should do failure-prone allocation in create_query, not begin, anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4356>

src/gallium/drivers/freedreno/freedreno_query.c
src/gallium/drivers/freedreno/freedreno_query.h
src/gallium/drivers/freedreno/freedreno_query_acc.c
src/gallium/drivers/freedreno/freedreno_query_hw.c
src/gallium/drivers/freedreno/freedreno_query_sw.c

index 852c828..6f99abd 100644 (file)
@@ -62,15 +62,14 @@ static bool
 fd_begin_query(struct pipe_context *pctx, struct pipe_query *pq)
 {
        struct fd_query *q = fd_query(pq);
-       bool ret;
 
        if (q->active)
                return false;
 
-       ret = q->funcs->begin_query(fd_context(pctx), q);
-       q->active = ret;
+       q->funcs->begin_query(fd_context(pctx), q);
+       q->active = true;
 
-       return ret;
+       return true;
 }
 
 static bool
index e69ff7a..907106e 100644 (file)
@@ -35,7 +35,7 @@ struct fd_query;
 struct fd_query_funcs {
        void (*destroy_query)(struct fd_context *ctx,
                        struct fd_query *q);
-       bool (*begin_query)(struct fd_context *ctx, struct fd_query *q);
+       void (*begin_query)(struct fd_context *ctx, struct fd_query *q);
        void (*end_query)(struct fd_context *ctx, struct fd_query *q);
        bool (*get_query_result)(struct fd_context *ctx,
                        struct fd_query *q, bool wait,
index 89282f2..ed7b607 100644 (file)
@@ -74,7 +74,7 @@ realloc_query_bo(struct fd_context *ctx, struct fd_acc_query *aq)
        fd_bo_cpu_fini(rsc->bo);
 }
 
-static bool
+static void
 fd_acc_begin_query(struct fd_context *ctx, struct fd_query *q)
 {
        struct fd_batch *batch = fd_context_batch(ctx);
@@ -93,8 +93,6 @@ fd_acc_begin_query(struct fd_context *ctx, struct fd_query *q)
        /* add to active list: */
        assert(list_is_empty(&aq->node));
        list_addtail(&aq->node, &ctx->acc_active_queries);
-
-       return true;
 }
 
 static void
index bed59a5..3bf38ac 100644 (file)
@@ -132,7 +132,7 @@ fd_hw_destroy_query(struct fd_context *ctx, struct fd_query *q)
        free(hq);
 }
 
-static bool
+static void
 fd_hw_begin_query(struct fd_context *ctx, struct fd_query *q)
 {
        struct fd_batch *batch = fd_context_batch(ctx);
@@ -149,8 +149,6 @@ fd_hw_begin_query(struct fd_context *ctx, struct fd_query *q)
        /* add to active list: */
        assert(list_is_empty(&hq->list));
        list_addtail(&hq->list, &ctx->hw_active_queries);
-
-       return true;
 }
 
 static void
index 96bc814..2164ad5 100644 (file)
@@ -108,7 +108,7 @@ is_draw_rate_query(struct fd_query *q)
        }
 }
 
-static bool
+static void
 fd_sw_begin_query(struct fd_context *ctx, struct fd_query *q)
 {
        struct fd_sw_query *sq = fd_sw_query(q);
@@ -118,7 +118,6 @@ fd_sw_begin_query(struct fd_context *ctx, struct fd_query *q)
        } else if (is_draw_rate_query(q)) {
                sq->begin_time = ctx->stats.draw_calls;
        }
-       return true;
 }
 
 static void