summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_gmem.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2017-04-21 09:50:30 -0400
committerRob Clark <[email protected]>2017-04-22 10:03:01 -0400
commitdf63ff4d8248d81ecb8d0f3059bf2c67431e6f2f (patch)
tree6bdc94b7326d0367ebdf6b5579fca13e19997ff4 /src/gallium/drivers/freedreno/freedreno_gmem.c
parent2faf227ec2e22c7a37e0a54783a3f0a0062ac852 (diff)
freedreno: make hw-query a helper
For a5xx (and actually some queries on a4xx) we can accumulate results in the cmdstream, so we don't need this elaborate mechanism of tracking per-tile query results. So make it into vfuncs so generation specific backend can use it when it makes sense. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_gmem.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_gmem.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.c b/src/gallium/drivers/freedreno/freedreno_gmem.c
index d9f707d9c9a..ded23219dc2 100644
--- a/src/gallium/drivers/freedreno/freedreno_gmem.c
+++ b/src/gallium/drivers/freedreno/freedreno_gmem.c
@@ -332,7 +332,8 @@ render_tiles(struct fd_batch *batch)
ctx->emit_tile_renderprep(batch, tile);
- fd_hw_query_prepare_tile(batch, i, batch->gmem);
+ if (ctx->query_prepare_tile)
+ ctx->query_prepare_tile(batch, i, batch->gmem);
/* emit IB to drawcmds: */
ctx->emit_ib(batch->gmem, batch->draw);
@@ -353,7 +354,8 @@ render_sysmem(struct fd_batch *batch)
ctx->emit_sysmem_prep(batch);
- fd_hw_query_prepare_tile(batch, 0, batch->gmem);
+ if (ctx->query_prepare_tile)
+ ctx->query_prepare_tile(batch, 0, batch->gmem);
/* emit IB to drawcmds: */
ctx->emit_ib(batch->gmem, batch->draw);
@@ -402,7 +404,8 @@ fd_gmem_render_tiles(struct fd_batch *batch)
batch, pfb->width, pfb->height,
util_format_short_name(pipe_surface_format(pfb->cbufs[0])),
util_format_short_name(pipe_surface_format(pfb->zsbuf)));
- fd_hw_query_prepare(batch, 1);
+ if (ctx->query_prepare)
+ ctx->query_prepare(batch, 1);
render_sysmem(batch);
ctx->stats.batch_sysmem++;
} else {
@@ -412,7 +415,8 @@ fd_gmem_render_tiles(struct fd_batch *batch)
batch, pfb->width, pfb->height, gmem->nbins_x, gmem->nbins_y,
util_format_short_name(pipe_surface_format(pfb->cbufs[0])),
util_format_short_name(pipe_surface_format(pfb->zsbuf)));
- fd_hw_query_prepare(batch, gmem->nbins_x * gmem->nbins_y);
+ if (ctx->query_prepare)
+ ctx->query_prepare(batch, gmem->nbins_x * gmem->nbins_y);
render_tiles(batch);
ctx->stats.batch_gmem++;
}