This is not likely to be useful, and might take over a correctly-sized
BO that is going to be reused later.
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
if (entry->size < size || entry->flags != flags)
continue;
+ /* Do not return more than 2x oversized BOs. */
+ if (entry->size > 2 * size)
+ continue;
+
/* If the oldest BO in the cache is busy, likely so is
* everything newer, so bail. */
if (!agx_bo_wait(entry, dontwait ? 0 : INT64_MAX))