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
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,
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);
/* add to active list: */
list_del(&hq->list);
list_addtail(&hq->list, &ctx->active_queries);
+ return true;
}
static void
}
}
-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);
sq->begin_value = read_counter(ctx, q->type);
if (is_rate_query(q))
sq->begin_time = os_time_get();
+ return true;
}
static void
FREE(query);
}
-static void i915_begin_query(struct pipe_context *ctx,
+static boolean i915_begin_query(struct pipe_context *ctx,
struct pipe_query *query)
{
+ return true;
}
static void i915_end_query(struct pipe_context *ctx, struct pipe_query *query)
FREE(q);
}
-static void
+static boolean
ilo_begin_query(struct pipe_context *pipe, struct pipe_query *query)
{
struct ilo_query *q = ilo_query(query);
q->active = true;
ilo_query_table[q->type].begin(ilo_context(pipe), q);
+ return true;
}
static void
}
-static void
+static boolean
llvmpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
{
struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe );
default:
break;
}
+ return true;
}
FREE(query);
}
-static void noop_begin_query(struct pipe_context *ctx, struct pipe_query *query)
+static boolean noop_begin_query(struct pipe_context *ctx, struct pipe_query *query)
{
+ return true;
}
static void noop_end_query(struct pipe_context *ctx, struct pipe_query *query)
FREE(pq);
}
-static void
+static boolean
nv30_query_begin(struct pipe_context *pipe, struct pipe_query *pq)
{
struct nv30_context *nv30 = nv30_context(pipe);
}
break;
case PIPE_QUERY_TIMESTAMP:
- return;
+ return true;
default:
BEGIN_NV04(push, NV30_3D(QUERY_RESET), 1);
PUSH_DATA (push, q->report);
BEGIN_NV04(push, SUBC_3D(q->enable), 1);
PUSH_DATA (push, 1);
}
+ return true;
}
static void
PUSH_DATA (push, get);
}
-static void
+static boolean
nv50_query_begin(struct pipe_context *pipe, struct pipe_query *pq)
{
struct nv50_context *nv50 = nv50_context(pipe);
break;
}
q->ready = FALSE;
+ return true;
}
static void
nvc0_query_allocate(nvc0, q, NVC0_QUERY_ALLOC_SPACE);
}
-static void
+static boolean
nvc0_query_begin(struct pipe_context *pipe, struct pipe_query *pq)
{
struct nvc0_context *nvc0 = nvc0_context(pipe);
break;
}
q->state = NVC0_QUERY_STATE_ACTIVE;
+ return true;
}
static void
r300_mark_atom_dirty(r300, &r300->query_start);
}
-static void r300_begin_query(struct pipe_context* pipe,
- struct pipe_query* query)
+static boolean r300_begin_query(struct pipe_context* pipe,
+ struct pipe_query* query)
{
struct r300_context* r300 = r300_context(pipe);
struct r300_query* q = r300_query(query);
if (q->type == PIPE_QUERY_GPU_FINISHED)
- return;
+ return true;
if (r300->query_current != NULL) {
fprintf(stderr, "r300: begin_query: "
"Some other query has already been started.\n");
assert(0);
- return;
+ return false;
}
q->num_results = 0;
r300_resume_query(r300, q);
+ return true;
}
void r300_stop_query(struct r300_context *r300)
FREE(query);
}
-static void r600_begin_query(struct pipe_context *ctx, struct pipe_query *query)
+static boolean r600_begin_query(struct pipe_context *ctx,
+ struct pipe_query *query)
{
struct r600_common_context *rctx = (struct r600_common_context *)ctx;
struct r600_query *rquery = (struct r600_query *)query;
if (!r600_query_needs_begin(rquery->type)) {
assert(0);
- return;
+ return false;
}
/* Non-GPU queries. */
return;
case R600_QUERY_DRAW_CALLS:
rquery->begin_result = rctx->num_draw_calls;
- return;
+ return true;
case R600_QUERY_REQUESTED_VRAM:
case R600_QUERY_REQUESTED_GTT:
case R600_QUERY_VRAM_USAGE:
case R600_QUERY_CURRENT_GPU_SCLK:
case R600_QUERY_CURRENT_GPU_MCLK:
rquery->begin_result = 0;
- return;
+ return true;
case R600_QUERY_BUFFER_WAIT_TIME:
rquery->begin_result = rctx->ws->query_value(rctx->ws, RADEON_BUFFER_WAIT_TIME_NS);
- return;
+ return true;
case R600_QUERY_NUM_CS_FLUSHES:
rquery->begin_result = rctx->ws->query_value(rctx->ws, RADEON_NUM_CS_FLUSHES);
- return;
+ return true;
case R600_QUERY_NUM_BYTES_MOVED:
rquery->begin_result = rctx->ws->query_value(rctx->ws, RADEON_NUM_BYTES_MOVED);
- return;
+ return true;
case R600_QUERY_GPU_LOAD:
rquery->begin_result = r600_gpu_load_begin(rctx->screen);
- return;
+ return true;
}
/* Discard the old query buffers. */
if (!r600_is_timer_query(rquery->type)) {
LIST_ADDTAIL(&rquery->list, &rctx->active_nontimer_queries);
}
+ return true;
}
static void r600_end_query(struct pipe_context *ctx, struct pipe_query *query)
pipe_mutex_unlock(rb_pipe->call_mutex);
}
-static void
+static boolean
rbug_begin_query(struct pipe_context *_pipe,
struct pipe_query *query)
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ boolean ret;
pipe_mutex_lock(rb_pipe->call_mutex);
- pipe->begin_query(pipe,
- query);
+ ret = pipe->begin_query(pipe, query);
pipe_mutex_unlock(rb_pipe->call_mutex);
+ return ret;
}
static void
}
-static void
+static boolean
softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
{
struct softpipe_context *softpipe = softpipe_context( pipe );
}
softpipe->active_query_count++;
softpipe->dirty |= SP_NEW_QUERY;
+ return true;
}
}
-static void
+static boolean
svga_begin_query(struct pipe_context *pipe, struct pipe_query *q)
{
struct svga_screen *svgascreen = svga_screen(pipe->screen);
default:
assert(!"unexpected query type in svga_begin_query()");
}
+ return true;
}
}
-static INLINE void
+static INLINE boolean
trace_context_begin_query(struct pipe_context *_pipe,
struct pipe_query *query)
{
struct trace_context *tr_ctx = trace_context(_pipe);
struct pipe_context *pipe = tr_ctx->pipe;
+ boolean ret;
query = trace_query_unwrap(query);
trace_dump_arg(ptr, pipe);
trace_dump_arg(ptr, query);
- pipe->begin_query(pipe, query);
+ ret = pipe->begin_query(pipe, query);
trace_dump_call_end();
+ return ret;
}
void (*destroy_query)(struct pipe_context *pipe,
struct pipe_query *q);
- void (*begin_query)(struct pipe_context *pipe, struct pipe_query *q);
+ boolean (*begin_query)(struct pipe_context *pipe, struct pipe_query *q);
void (*end_query)(struct pipe_context *pipe, struct pipe_query *q);
/**