summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2019-08-01 15:22:47 -0400
committerJonathan Marek <[email protected]>2019-08-02 15:58:22 +0000
commite652ca4e0b4dc773e0754993a5bea4fad1a2e8a1 (patch)
tree8061129fd553c9ea2ccff682cfccda957bb972a4 /src
parent257957b026ca96685d51f0954aba687c6effa104 (diff)
freedreno: a2xx: fix HW binning for batches with >256K vertices
Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/freedreno/a2xx/fd2_gmem.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c b/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c
index 0edc5e940c1..47cbb54d611 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c
@@ -590,14 +590,14 @@ fd2_emit_tile_init(struct fd_batch *batch)
for (int i = 0; i < gmem->num_vsc_pipes; i++) {
struct fd_vsc_pipe *pipe = &ctx->vsc_pipe[i];
- /* XXX we know how large this needs to be..
- * should do some sort of realloc
- * it should be ctx->batch->num_vertices bytes large
- * with this size it will break with more than 256k vertices..
- */
- if (!pipe->bo) {
- pipe->bo = fd_bo_new(ctx->dev, 0x40000,
+ /* allocate in 64k increments to avoid reallocs */
+ uint32_t bo_size = align(batch->num_vertices, 0x10000);
+ if (!pipe->bo || fd_bo_size(pipe->bo) < bo_size) {
+ if (pipe->bo)
+ fd_bo_del(pipe->bo);
+ pipe->bo = fd_bo_new(ctx->dev, bo_size,
DRM_FREEDRENO_GEM_TYPE_KMEM, "vsc_pipe[%u]", i);
+ assert(pipe->bo);
}
/* memory export address (export32):
@@ -609,7 +609,7 @@ fd2_emit_tile_init(struct fd_batch *batch)
OUT_RELOCW(ring, pipe->bo, 0, 0x40000000, -2);
OUT_RING(ring, 0x00000000);
OUT_RING(ring, 0x4B00D000);
- OUT_RING(ring, 0x4B000000 | 0x40000);
+ OUT_RING(ring, 0x4B000000 | bo_size);
}
OUT_PKT3(ring, CP_SET_CONSTANT, 1 + gmem->num_vsc_pipes * 8);