panfrost: Split panfrost_batch_submit to prevent stack overflows
authorIcecream95 <ixn@disroot.org>
Fri, 23 Apr 2021 11:48:00 +0000 (23:48 +1200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 3 May 2021 08:58:58 +0000 (08:58 +0000)
commit64246c3ae49d4bcde7a73585a8ee7470d20398ab
treeab3058dae220bcffe974ffa8abb858d96b53ca11
parent8b31092bcd38db242eba9e2267fb17b841c93735
panfrost: Split panfrost_batch_submit to prevent stack overflows

panfrost_batch_submit can recurse to hundreds of levels to submit
dependencies, so split the actual submit code from the dependency
recursion, saving over a kilobyte of stack space per recursion
level. Enforce this with ATTRIBUTE_NOINLINE.

Use ATTRIBUTE_NOINLINE on panfrost_batch_submit itself as well to
prevent GCC from inlining the function into itself, which would use a
few hundred bytes of stack.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10574>
src/gallium/drivers/panfrost/pan_job.c