projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
freedreno: make fd_batch a one-shot thing
[mesa.git]
/
src
/
gallium
/
drivers
/
freedreno
/
freedreno_query_hw.h
diff --git
a/src/gallium/drivers/freedreno/freedreno_query_hw.h
b/src/gallium/drivers/freedreno/freedreno_query_hw.h
index 8f4b1f58ee53beb37a3a48a4e9b3768923d1e374..f283985679d03e387ff0862314159b9cac54a0bd 100644
(file)
--- a/
src/gallium/drivers/freedreno/freedreno_query_hw.h
+++ b/
src/gallium/drivers/freedreno/freedreno_query_hw.h
@@
-76,10
+76,15
@@
struct fd_hw_sample_provider {
/* stages applicable to the query type: */
enum fd_render_stage active;
/* stages applicable to the query type: */
enum fd_render_stage active;
+ /* Optional hook for enabling a counter. Guaranteed to happen
+ * at least once before the first ->get_sample() in a batch.
+ */
+ void (*enable)(struct fd_context *ctx, struct fd_ringbuffer *ring);
+
/* when a new sample is required, emit appropriate cmdstream
* and return a sample object:
*/
/* 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: */
struct fd_ringbuffer *ring);
/* accumulate the results from specified sample period: */
@@
-102,7
+107,7
@@
struct fd_hw_sample {
* This way we can defer allocation until total # of requested
* samples, and total # of tiles, is known.
*/
* 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;
};
uint32_t num_tiles;
uint32_t tile_stride;
};
@@
-114,18
+119,17
@@
struct fd_hw_query {
const struct fd_hw_sample_provider *provider;
const struct fd_hw_sample_provider *provider;
- /* list of fd_hw_sample_period
in previous submit
s: */
+ /* list of fd_hw_sample_periods: */
struct list_head 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;
/* 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 *
};
static inline struct fd_hw_query *
@@
-136,14
+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_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);
/* 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);
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_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);
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);
@@
-157,8
+161,7
@@
fd_hw_sample_reference(struct fd_context *ctx,
if (pipe_reference(&(*ptr)->reference, &samp->reference))
__fd_hw_sample_destroy(ctx, old_samp);
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_ */
}
#endif /* FREEDRENO_QUERY_HW_H_ */