aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-07-25 13:09:51 -0700
committerJuan A. Suarez Romero <[email protected]>2019-07-30 08:33:26 +0000
commit3ec136d58301c5797617dd30547ba9323472219c (patch)
treea2fe80209471adf67ff49933f84c02257cd8a597 /src
parent8fbadb152cfb60e6b3b095e5b1e8b919707a543b (diff)
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 <[email protected]> (cherry picked from commit 6e3b220ad3c6b790ccba63e0ed742f3314c158ef)
Diffstat (limited to 'src')
-rw-r--r--src/freedreno/ir3/ir3.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c
index 97f4ae96cd9..5c049a5936f 100644
--- a/src/freedreno/ir3/ir3.c
+++ b/src/freedreno/ir3/ir3.c
@@ -48,7 +48,7 @@ void * ir3_alloc(struct ir3 *shader, int sz)
struct ir3 * ir3_create(struct ir3_compiler *compiler,
gl_shader_stage type, unsigned nin, unsigned nout)
{
- struct ir3 *shader = rzalloc(compiler, struct ir3);
+ struct ir3 *shader = rzalloc(NULL, struct ir3);
shader->compiler = compiler;
shader->type = type;