panfrost: Don't round up Midgard polygon list BOs
authorAlyssa Rosenzweig <alyssa@collabora.com>
Mon, 31 Oct 2022 01:37:51 +0000 (21:37 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 16 Mar 2023 04:13:46 +0000 (04:13 +0000)
commitf2617944bfd3200c590c440baa95f8ff63fa87b9
treee7cad68fc79a56a66e77cb22564cd95bac0c66d4
parent174d6e6a545c03a9ac2a14287fae0071a79c1cda
panfrost: Don't round up Midgard polygon list BOs

Rounding up the polygon list BO can waste large amounts of memory. In a common
case I observed, it rounded up 11MB to 16MB, wasting 5MB. That adds up quickly
across processes, especially on the 2GB machines.

This only applies to Midgard. On Bifrost and newer, the driver does not
explicitly allocate this data structure. Cc stable because this rounding is
incorrect and the increase in RAM usage can cause real problems (especially
given how slow the shrinker is).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21831>
src/gallium/drivers/panfrost/pan_cmdstream.c