-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
/*
* Copyright (C) 2014 Rob Clark <robclark@freedesktop.org>
*
/* when a new sample is required, emit appropriate cmdstream
* and return a sample object:
*/
- struct fd_hw_sample *(*get_sample)(struct fd_context *ctx,
+ struct fd_hw_sample *(*get_sample)(struct fd_batch *batch,
struct fd_ringbuffer *ring);
/* accumulate the results from specified sample period: */
* This way we can defer allocation until total # of requested
* samples, and total # of tiles, is known.
*/
- struct fd_bo *bo;
+ struct pipe_resource *prsc;
uint32_t num_tiles;
uint32_t tile_stride;
};
const struct fd_hw_sample_provider *provider;
- /* list of fd_hw_sample_period in previous submits: */
+ /* list of fd_hw_sample_periods: */
struct list_head periods;
- /* list of fd_hw_sample_period's in current submit: */
- struct list_head current_periods;
-
/* if active and not paused, the current sample period (not
* yet added to current_periods):
*/
struct fd_hw_sample_period *period;
- struct list_head list; /* list-node in ctx->active_queries */
+ struct list_head list; /* list-node in batch->active_queries */
+
+ int no_wait_cnt; /* see fd_hw_get_query_result */
};
static inline struct fd_hw_query *
return (struct fd_hw_query *)q;
}
-struct fd_query * fd_hw_create_query(struct fd_context *ctx, unsigned query_type);
+struct fd_query * fd_hw_create_query(struct fd_context *ctx, unsigned query_type, unsigned index);
/* helper for sample providers: */
-struct fd_hw_sample * fd_hw_sample_init(struct fd_context *ctx, uint32_t size);
+struct fd_hw_sample * fd_hw_sample_init(struct fd_batch *batch, uint32_t size);
/* don't call directly, use fd_hw_sample_reference() */
void __fd_hw_sample_destroy(struct fd_context *ctx, struct fd_hw_sample *samp);
-void fd_hw_query_prepare(struct fd_context *ctx, uint32_t num_tiles);
-void fd_hw_query_prepare_tile(struct fd_context *ctx, uint32_t n,
+void fd_hw_query_prepare(struct fd_batch *batch, uint32_t num_tiles);
+void fd_hw_query_prepare_tile(struct fd_batch *batch, uint32_t n,
struct fd_ringbuffer *ring);
-void fd_hw_query_set_stage(struct fd_context *ctx,
- struct fd_ringbuffer *ring, enum fd_render_stage stage);
-void fd_hw_query_enable(struct fd_context *ctx, struct fd_ringbuffer *ring);
+void fd_hw_query_set_stage(struct fd_batch *batch, enum fd_render_stage stage);
+void fd_hw_query_enable(struct fd_batch *batch, struct fd_ringbuffer *ring);
void fd_hw_query_register_provider(struct pipe_context *pctx,
const struct fd_hw_sample_provider *provider);
void fd_hw_query_init(struct pipe_context *pctx);
if (pipe_reference(&(*ptr)->reference, &samp->reference))
__fd_hw_sample_destroy(ctx, old_samp);
- if (ptr)
- *ptr = samp;
+ *ptr = samp;
}
#endif /* FREEDRENO_QUERY_HW_H_ */