mesa/src/asahi
Alyssa Rosenzweig 04360a270e asahi: Copy panfrost's bo cache
Massive performance gains, some fps before/after numbers from glmark2:

   [shading] 1486 -> 2391
   [refract] 87   -> 127
   [terrain] 32   -> 56

...and it's basically for free with enough copy/paste, so thank you to Boris
Brezillon for an excellent Asahi patch, the LRU cache seems to work great on M1
:-p

There are a few minor changes I made from panfrost, notably adjusting the
constants to account for 16KiB pages and switching from pthread_mutex to
simple_mtx to be less weird in Mesa.

For context on the design, the following commits evolved it in Panfrost and
their commit messages may be useful... The logic in this module is the product
of years of mistakes and correcting course :-)

   f06809cdca ("panfrost: Evict the BO cache when allocation fails")
   77d0498913 ("panfrost: Fix major flaw in BO cache")
   ee82f9f07e ("panfrost: Try to evict unused BOs from the cache")
   2225383af8 ("panfrost: Make sure the BO is 'ready' when picked from the cache")
   9af4aeaaf7 ("panfrost: Don't return imported/exported BOs to the cache")

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19971>
2022-11-24 23:37:48 +00:00
..
compiler tree-wide: Use __func__ instead of __FUNCTION__ in non-gallium code 2022-11-22 06:53:46 +00:00
drm-shim asahi: Add drm-shim implementation 2022-11-07 16:10:11 +00:00
layout ail: Handle multisampling 2022-11-19 20:25:41 +00:00
lib asahi: Copy panfrost's bo cache 2022-11-24 23:37:48 +00:00
meson.build asahi: Add drm-shim implementation 2022-11-07 16:10:11 +00:00