pan/bi: Use safe helpers to remove srcs/dests
authorAlyssa Rosenzweig <alyssa@collabora.com>
Fri, 22 Jul 2022 15:46:51 +0000 (11:46 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 2 Sep 2022 16:03:23 +0000 (16:03 +0000)
commit50995dcb90bec802f046e564e3a705d0ca77184f
tree7ef788ba5e68350d1085b7940a411165f0318e61
parent9c45ce309d47b688a7f5483909a091d945da52ea
pan/bi: Use safe helpers to remove srcs/dests

Changing I->nr_srcs or I->nr_dests directly is generally unsafe, but the special
case of removing sources/destinations at the end is safe. Add and use helpers to
wrap this operation simplifying the remaining code audit before we can
dynamically allocate sources/destinations.

At this point in the series, nothing modifies I->nr_dests after allocation
except these helpers, so destinations should be safe to make dynamic. There's a
bit more work needed for sources.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>
src/panfrost/bifrost/bi_pack.c
src/panfrost/bifrost/bi_schedule.c
src/panfrost/bifrost/compiler.h
src/panfrost/bifrost/valhall/va_optimize.c