Module: Mesa Branch: main Commit: 2497741a1b142b0e19f3946d3f49f064c0c8f119 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2497741a1b142b0e19f3946d3f49f064c0c8f119
Author: Rob Clark <[email protected]> Date: Fri Aug 5 08:40:38 2022 -0700 freedreno/gmem: Fix col0 calc Fix typo in calculation of position of start of a row of tiles. This could otherwise cause an out-of-bounds access in the next patch. Fixes: 81d85be9a5c freedreno/gmem: Reverse order of alternative tile rows Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17888> --- src/gallium/drivers/freedreno/freedreno_gmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.c b/src/gallium/drivers/freedreno/freedreno_gmem.c index 681063f003e..e0b0d95ca8a 100644 --- a/src/gallium/drivers/freedreno/freedreno_gmem.c +++ b/src/gallium/drivers/freedreno/freedreno_gmem.c @@ -433,7 +433,7 @@ gmem_stateobj_init(struct fd_screen *screen, struct gmem_key *key) */ if (!FD_DBG(NOSBIN)) { for (i = 0; i < gmem->nbins_y; i+=2) { - unsigned col0 = gmem->nbins_y * i; + unsigned col0 = gmem->nbins_x * i; for (j = 0; j < gmem->nbins_x/2; j++) { swap(gmem->tile[col0 + j], gmem->tile[col0 + gmem->nbins_x - j - 1]); }
