freedreno: Fix data races with allocating/freeing struct ir3.
authorEric Anholt <eric@anholt.net>
Thu, 25 Jul 2019 20:09:51 +0000 (13:09 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 29 Jul 2019 19:50:49 +0000 (12:50 -0700)
commit6e3b220ad3c6b790ccba63e0ed742f3314c158ef
treef960b267e30b7b6af48b71a23b18d3069186061d
parent65aeeae6708269081206624f75163c8df6ddd67c
freedreno: Fix data races with allocating/freeing struct ir3.

There is a single ir3_compiler in the screen, and each context may be
compiling ir3 shaders, which call ir3_create.  ralloc doesn't do any
locking on its own, so eventually you can end up racing to break
ralloc's linked lists.

We really don't want struct ir3 to live as long as the compiler (maybe
struct ir3_shader's lifetime, if anything), so you'd better be freeing
it anyway.

Fixes: 8fe20762433d ("freedreno/ir3: convert over to ralloc")
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/freedreno/ir3/ir3.c