panfrost: Use implementation-specific tile size
authorAlyssa Rosenzweig <alyssa@collabora.com>
Thu, 7 Jul 2022 22:39:17 +0000 (18:39 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 13 Jul 2022 19:00:41 +0000 (19:00 +0000)
commit96d65b47c715155bb0403f3e0b5555b348d68539
tree0958ed0b808a2a2b662ffb61d137282a419772fb
parentd67681c4ead6f6fd33beda7643056df355109312
panfrost: Use implementation-specific tile size

The physical tile buffer size (and hence the maximum available tilebuffer size)
are implementation-defined. Track this information on the device so we can
correctly select tile sizes, instead of hardcoding the value for Midgard.

Implementation values are pulled from the "Tile bits/pixel" row of the public
Mali data sheet [1]. That row lists the maximum number of bits available for a
pixel given the maximum tile size and pipelining. For currently supported
hardware (v9 and older), that maximum tile size is 16x16. So those values should
be multiplied by (16 * 16 * 2) / 8 to get the physical size in bytes.

This may improve Bifrost/Valhall performance on workloads using multiple render
targets. It also gets us ready for the dazzling array of tile sizes available
with v10.

[1] https://developer.arm.com/documentation/102849/latest/

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17432>
src/panfrost/lib/pan_cs.c
src/panfrost/lib/pan_device.h
src/panfrost/lib/pan_props.c