freedreno: make fd_batch a one-shot thing
[mesa.git] / src / gallium / drivers / freedreno / freedreno_query_hw.h
index 0afece3495f8193135114b7cc836a12815b9e896..f283985679d03e387ff0862314159b9cac54a0bd 100644 (file)
@@ -84,7 +84,7 @@ struct fd_hw_sample_provider {
        /* 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: */
@@ -119,18 +119,17 @@ struct fd_hw_query {
 
        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 *
@@ -141,15 +140,14 @@ fd_hw_query(struct fd_query *q)
 
 struct fd_query * fd_hw_create_query(struct fd_context *ctx, unsigned query_type);
 /* 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);