summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_batch.h
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2019-02-19 09:29:49 -0500
committerRob Clark <[email protected]>2019-02-22 14:05:32 -0500
commit5d4fa194b8768701a7df1545cf10929ab4b67a23 (patch)
tree49142789a0eb0799d4050c71110d95e8a30e5134 /src/gallium/drivers/freedreno/freedreno_batch.h
parent3090c6b9e9c114b3438be83399c7bed12f920505 (diff)
freedreno: fix race condition
rsc->write_batch can be cleared behind our back, so we need to acquire the lock *before* deref'ing. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_batch.h')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_batch.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_batch.h b/src/gallium/drivers/freedreno/freedreno_batch.h
index 7b723db64af..e771ad6c0bd 100644
--- a/src/gallium/drivers/freedreno/freedreno_batch.h
+++ b/src/gallium/drivers/freedreno/freedreno_batch.h
@@ -243,6 +243,10 @@ void __fd_batch_destroy(struct fd_batch *batch);
* WARNING the _locked() version can briefly drop the lock. Without
* recursive mutexes, I'm not sure there is much else we can do (since
* __fd_batch_destroy() needs to unref resources)
+ *
+ * WARNING you must acquire the screen->lock and use the _locked()
+ * version in case that the batch being ref'd can disappear under
+ * you.
*/
/* fwd-decl prototypes to untangle header dependency :-/ */