diff options
author | Samuel Pitoiset <[email protected]> | 2014-07-05 12:46:03 +0200 |
---|---|---|
committer | Martin Peres <[email protected]> | 2015-05-06 00:03:36 +0300 |
commit | 96f164f6f047833091eb98a73aa80c31dc94f962 (patch) | |
tree | 1d6eff6ab916eb590752012102f50b706f4a36ea /src/gallium/drivers/freedreno | |
parent | 546ec980f850fee067fd1dddad19a8dfd6b7e672 (diff) |
gallium: make pipe_context::begin_query return a boolean
GL_AMD_performance_monitor must return an error when a monitoring
session cannot be started.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Martin Peres <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
4 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_query.c b/src/gallium/drivers/freedreno/freedreno_query.c index 6f01e0313c1..db2683c9b6f 100644 --- a/src/gallium/drivers/freedreno/freedreno_query.c +++ b/src/gallium/drivers/freedreno/freedreno_query.c @@ -59,11 +59,11 @@ fd_destroy_query(struct pipe_context *pctx, struct pipe_query *pq) q->funcs->destroy_query(fd_context(pctx), q); } -static void +static boolean fd_begin_query(struct pipe_context *pctx, struct pipe_query *pq) { struct fd_query *q = fd_query(pq); - q->funcs->begin_query(fd_context(pctx), q); + return q->funcs->begin_query(fd_context(pctx), q); } static void diff --git a/src/gallium/drivers/freedreno/freedreno_query.h b/src/gallium/drivers/freedreno/freedreno_query.h index bc9a7a20559..c2c71da2790 100644 --- a/src/gallium/drivers/freedreno/freedreno_query.h +++ b/src/gallium/drivers/freedreno/freedreno_query.h @@ -37,7 +37,7 @@ struct fd_query; struct fd_query_funcs { void (*destroy_query)(struct fd_context *ctx, struct fd_query *q); - void (*begin_query)(struct fd_context *ctx, struct fd_query *q); + boolean (*begin_query)(struct fd_context *ctx, struct fd_query *q); void (*end_query)(struct fd_context *ctx, struct fd_query *q); boolean (*get_query_result)(struct fd_context *ctx, struct fd_query *q, boolean wait, diff --git a/src/gallium/drivers/freedreno/freedreno_query_hw.c b/src/gallium/drivers/freedreno/freedreno_query_hw.c index b29f9d409ce..027fdc9de23 100644 --- a/src/gallium/drivers/freedreno/freedreno_query_hw.c +++ b/src/gallium/drivers/freedreno/freedreno_query_hw.c @@ -131,12 +131,12 @@ fd_hw_destroy_query(struct fd_context *ctx, struct fd_query *q) free(hq); } -static void +static boolean fd_hw_begin_query(struct fd_context *ctx, struct fd_query *q) { struct fd_hw_query *hq = fd_hw_query(q); if (q->active) - return; + return false; /* begin_query() should clear previous results: */ destroy_periods(ctx, &hq->periods); @@ -149,6 +149,7 @@ fd_hw_begin_query(struct fd_context *ctx, struct fd_query *q) /* add to active list: */ list_del(&hq->list); list_addtail(&hq->list, &ctx->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 8d81698f31d..514df145fa8 100644 --- a/src/gallium/drivers/freedreno/freedreno_query_sw.c +++ b/src/gallium/drivers/freedreno/freedreno_query_sw.c @@ -85,7 +85,7 @@ is_rate_query(struct fd_query *q) } } -static void +static boolean fd_sw_begin_query(struct fd_context *ctx, struct fd_query *q) { struct fd_sw_query *sq = fd_sw_query(q); @@ -93,6 +93,7 @@ fd_sw_begin_query(struct fd_context *ctx, struct fd_query *q) sq->begin_value = read_counter(ctx, q->type); if (is_rate_query(q)) sq->begin_time = os_time_get(); + return true; } static void |