From b7fe793869e1f9b0a8013c5c5e161122e326540e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 27 Mar 2020 16:46:22 -0700 Subject: [PATCH] freedreno: Remove always-true return from per-gen begin_query. You should do failure-prone allocation in create_query, not begin, anyway. Part-of: --- src/gallium/drivers/freedreno/freedreno_query.c | 7 +++---- src/gallium/drivers/freedreno/freedreno_query.h | 2 +- src/gallium/drivers/freedreno/freedreno_query_acc.c | 4 +--- src/gallium/drivers/freedreno/freedreno_query_hw.c | 4 +--- src/gallium/drivers/freedreno/freedreno_query_sw.c | 3 +-- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/gallium/drivers/freedreno/freedreno_query.c b/src/gallium/drivers/freedreno/freedreno_query.c index 852c828fb06..6f99abd85ab 100644 --- a/src/gallium/drivers/freedreno/freedreno_query.c +++ b/src/gallium/drivers/freedreno/freedreno_query.c @@ -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 diff --git a/src/gallium/drivers/freedreno/freedreno_query.h b/src/gallium/drivers/freedreno/freedreno_query.h index e69ff7a88a1..907106e6ea1 100644 --- a/src/gallium/drivers/freedreno/freedreno_query.h +++ b/src/gallium/drivers/freedreno/freedreno_query.h @@ -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, diff --git a/src/gallium/drivers/freedreno/freedreno_query_acc.c b/src/gallium/drivers/freedreno/freedreno_query_acc.c index 89282f28966..ed7b6070b20 100644 --- a/src/gallium/drivers/freedreno/freedreno_query_acc.c +++ b/src/gallium/drivers/freedreno/freedreno_query_acc.c @@ -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 diff --git a/src/gallium/drivers/freedreno/freedreno_query_hw.c b/src/gallium/drivers/freedreno/freedreno_query_hw.c index bed59a53ab2..3bf38ac868b 100644 --- a/src/gallium/drivers/freedreno/freedreno_query_hw.c +++ b/src/gallium/drivers/freedreno/freedreno_query_hw.c @@ -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 diff --git a/src/gallium/drivers/freedreno/freedreno_query_sw.c b/src/gallium/drivers/freedreno/freedreno_query_sw.c index 96bc814ccb1..2164ad55e2e 100644 --- a/src/gallium/drivers/freedreno/freedreno_query_sw.c +++ b/src/gallium/drivers/freedreno/freedreno_query_sw.c @@ -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 -- 2.30.2