iris: avoid stack overflow in iris_bo_wait_syncobj()
authorPaulo Zanoni <paulo.r.zanoni@intel.com>
Fri, 8 Sep 2023 21:29:51 +0000 (14:29 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 19 Sep 2023 18:33:48 +0000 (18:33 +0000)
commit3cec15dd142b47c33b9e266a9b9f8e2c6540fa99
tree95a04bf825a3a857523d19c74a28216693396723
parent762b9aad01c9bdc78e10f7bf53d750942322b289
iris: avoid stack overflow in iris_bo_wait_syncobj()

Keep most cases using the stack as it's cheaper, but fall back to the
heap when the size gets too big.

This should fix a stack overflow reported by @rhezashan for a case
where we had lots of iris_screens.

Credits to Matt Turner and José Roberto de Souza for their work on
this issue, which led us to find its root cause.

Cc: mesa-stable
Reported-by: rheza shandikri (@rhezashan in gitlab)
Credits-to: José Roberto de Souza <jose.souza@intel.com>
Credits-to: Matt Turner <mattst88@gmail.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25236>
src/gallium/drivers/iris/iris_bufmgr.c