freedreno/gmem: fix nbins_x/y mismatch
authorRob Clark <robdclark@chromium.org>
Sat, 23 May 2020 19:27:17 +0000 (12:27 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 26 May 2020 19:29:34 +0000 (19:29 +0000)
commitfcecdcd82252013020a224f9e2887fcedbe23789
tree324fafbbf46f19d5a092f4af6b72440ea1e72bbb
parent9b91d88b3390d264d06ccc11142325e99780e808
freedreno/gmem: fix nbins_x/y mismatch

`layout_gmem()` recalculates the # of bins in x/y dimensions after
aligning the bin width/height to required dimensions.  Because of this,
the resulting gmem config could have fewer bins in either dimension.
But the tile/bin layout and the pipe assignment logic were still using
the original values.  Which could result in extraneous bins with a
width and/or height of zero.

Because the gmem rendering code uses `gmem->bin_w`/`h` to determine
the number of bins, this could result in some zero size bins being
executed, while later valid bins are skipped.  Which can leave un-
rendered portions of the screen (generally lower-right).

To fix this, be sure to use `gmem->bin_w`/`h` rather than the local
variables.

Fixes: 1bd38746d5a ("freedreno/gmem: rework gmem layout algo")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5189>
src/gallium/drivers/freedreno/freedreno_gmem.c