summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_state.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-07-11 17:36:45 -0400
committerRob Clark <[email protected]>2016-07-30 09:23:42 -0400
commit7f8fd02dc7cad1ddcfb610db10ffbb41e3e34e7d (patch)
tree755aec6bfa8e4d9cb4614dd5a8b58e4b21a6b73d /src/gallium/drivers/freedreno/freedreno_state.c
parent10baf05b2caaa0900c71ac64c91301e953176516 (diff)
freedreno: re-order support for hw queries
Push query state down to batch, and use the resource tracking to figure out which batch(es) need to be flushed to get the query result. This means we actually need to allocate the prsc up front, before we know the size. So we have to add a special way to allocate an un- backed resource, and then later allocate the backing storage. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_state.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_state.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_state.c b/src/gallium/drivers/freedreno/freedreno_state.c
index 8ac41d29077..849ea08037d 100644
--- a/src/gallium/drivers/freedreno/freedreno_state.c
+++ b/src/gallium/drivers/freedreno/freedreno_state.c
@@ -37,6 +37,7 @@
#include "freedreno_resource.h"
#include "freedreno_texture.h"
#include "freedreno_gmem.h"
+#include "freedreno_query_hw.h"
#include "freedreno_util.h"
/* All the generic state handling.. In case of CSO's that are specific
@@ -118,8 +119,10 @@ fd_set_framebuffer_state(struct pipe_context *pctx,
struct pipe_framebuffer_state *cso;
if (ctx->screen->reorder) {
- struct fd_batch *batch =
- fd_batch_from_fb(&ctx->screen->batch_cache, ctx, framebuffer);
+ struct fd_batch *batch;
+ if (likely(ctx->batch))
+ fd_hw_query_set_stage(ctx->batch, ctx->batch->draw, FD_STAGE_NULL);
+ batch = fd_batch_from_fb(&ctx->screen->batch_cache, ctx, framebuffer);
fd_batch_reference(&ctx->batch, NULL);
ctx->batch = batch;
ctx->dirty = ~0;