summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_screen.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-06-27 09:44:15 -0400
committerRob Clark <[email protected]>2016-07-30 09:23:42 -0400
commit9f219c7047b51561f6f69274d445e6a6ec41c5f8 (patch)
tree9222818fd1f2d961640e0ae1752659ee58926268 /src/gallium/drivers/freedreno/freedreno_screen.c
parentf02a64dbdd2ec147167ad60357bd46d8d964290a (diff)
freedreno: add batch-cache and batch reordering
Note that I originally also had a entry-point that would construct a key and do lookup from a pipe_surface. I ended up not needing that (yet?) but it is easy-enough to re-introduce later if we need it for the blit path. For now, not enabled by default, but can be enabled (on a3xx/a4xx) with FD_MESA_DEBUG=reorder. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_screen.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_screen.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
index 222f2881f01..31f2cb2147a 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -75,6 +75,7 @@ static const struct debug_named_value debug_options[] = {
{"flush", FD_DBG_FLUSH, "Force flush after every draw"},
{"deqp", FD_DBG_DEQP, "Enable dEQP hacks"},
{"nir", FD_DBG_NIR, "Prefer NIR as native IR"},
+ {"reorder", FD_DBG_REORDER,"Enable reordering for draws/blits"},
DEBUG_NAMED_VALUE_END
};
@@ -134,6 +135,8 @@ fd_screen_destroy(struct pipe_screen *pscreen)
if (screen->dev)
fd_device_del(screen->dev);
+ fd_bc_fini(&screen->batch_cache);
+
free(screen);
}
@@ -662,6 +665,16 @@ fd_screen_create(struct fd_device *dev)
goto fail;
}
+ /* NOTE: don't enable reordering on a2xx, since completely untested.
+ * Also, don't enable if we have too old of a kernel to support
+ * growable cmdstream buffers, since memory requirement for cmdstream
+ * buffers would be too much otherwise.
+ */
+ if ((screen->gpu_id >= 300) && (fd_device_version(dev) >= FD_VERSION_UNLIMITED_CMDS))
+ screen->reorder = !!(fd_mesa_debug & FD_DBG_REORDER);
+
+ fd_bc_init(&screen->batch_cache);
+
pscreen->destroy = fd_screen_destroy;
pscreen->get_param = fd_screen_get_param;
pscreen->get_paramf = fd_screen_get_paramf;