diff options
author | Jonathan Marek <[email protected]> | 2018-12-18 23:33:54 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2019-01-28 18:21:16 -0500 |
commit | cb2322c7c0f95d6d1a2b90494cf5f6fd55f55638 (patch) | |
tree | 2456dacc3bab7f9d0be62965913b8922d78f7f46 /src/gallium/drivers/freedreno/freedreno_gmem.c | |
parent | 501c6e70d417b6e7347e41976a753c0680268854 (diff) |
freedreno: a2xx: a20x hw binning
Signed-off-by: Jonathan Marek <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_gmem.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_gmem.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.c b/src/gallium/drivers/freedreno/freedreno_gmem.c index 0814a0c7631..d0420b27d31 100644 --- a/src/gallium/drivers/freedreno/freedreno_gmem.c +++ b/src/gallium/drivers/freedreno/freedreno_gmem.c @@ -215,12 +215,21 @@ calculate_tiles(struct fd_batch *batch) #define div_round_up(v, a) (((v) + (a) - 1) / (a)) /* figure out number of tiles per pipe: */ - tpp_x = tpp_y = 1; - while (div_round_up(nbins_y, tpp_y) > screen->num_vsc_pipes) - tpp_y += 2; - while ((div_round_up(nbins_y, tpp_y) * - div_round_up(nbins_x, tpp_x)) > screen->num_vsc_pipes) - tpp_x += 1; + if (is_a20x(ctx->screen)) { + /* for a20x we want to minimize the number of "pipes" + * binning data has 3 bits for x/y (8x8) but the edges are used to + * cull off-screen vertices with hw binning, so we have 6x6 pipes + */ + tpp_x = 6; + tpp_y = 6; + } else { + tpp_x = tpp_y = 1; + while (div_round_up(nbins_y, tpp_y) > screen->num_vsc_pipes) + tpp_y += 2; + while ((div_round_up(nbins_y, tpp_y) * + div_round_up(nbins_x, tpp_x)) > screen->num_vsc_pipes) + tpp_x += 1; + } gmem->maxpw = tpp_x; gmem->maxph = tpp_y; @@ -247,6 +256,9 @@ calculate_tiles(struct fd_batch *batch) xoff += tpp_x; } + /* number of pipes to use for a20x */ + gmem->num_vsc_pipes = MAX2(1, i); + for (; i < npipes; i++) { struct fd_vsc_pipe *pipe = &ctx->vsc_pipe[i]; pipe->x = pipe->y = pipe->w = pipe->h = 0; @@ -281,11 +293,12 @@ calculate_tiles(struct fd_batch *batch) /* pipe number: */ p = ((i / tpp_y) * div_round_up(nbins_x, tpp_x)) + (j / tpp_x); + assert(p < gmem->num_vsc_pipes); /* clip bin width: */ bw = MIN2(bin_w, minx + width - xoff); - - tile->n = tile_n[p]++; + tile->n = !is_a20x(ctx->screen) ? tile_n[p]++ : + ((i % tpp_y + 1) << 3 | (j % tpp_x + 1)); tile->p = p; tile->bin_w = bw; tile->bin_h = bh; |