Signed-off-by: Rob Clark <robclark@freedesktop.org>
void fd_query_screen_init(struct pipe_screen *pscreen);
void fd_query_context_init(struct pipe_context *pctx);
+static inline bool
+skip_begin_query(int type)
+{
+ switch (type) {
+ case PIPE_QUERY_TIMESTAMP:
+ case PIPE_QUERY_GPU_FINISHED:
+ return true;
+ default:
+ return false;
+ }
+}
+
#endif /* FREEDRENO_QUERY_H_ */
fd_hw_end_query(struct fd_context *ctx, struct fd_query *q)
{
struct fd_hw_query *hq = fd_hw_query(q);
+ /* there are a couple special cases, which don't have
+ * a matching ->begin_query():
+ */
+ if (skip_begin_query(q->type) && !q->active) {
+ fd_hw_begin_query(ctx, q);
+ }
if (!q->active)
return;
if (is_active(hq, ctx->stage))