asahi: Assert that freed BOs have no pending writers

This is just a sanity check, I haven't actually hit this case but if we
ever do something is very broken (e.g. BO refcounting bug).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22891>
This commit is contained in:
Asahi Lina 2023-05-03 15:40:33 +09:00 committed by Alyssa Rosenzweig
parent d7d098679b
commit 3f55eff0e5

View file

@ -193,6 +193,8 @@ agx_bo_unreference(struct agx_bo *bo)
* lock, let's make sure it's still not referenced before freeing it.
*/
if (p_atomic_read(&bo->refcnt) == 0) {
assert(!bo->writer_syncobj);
if (dev->debug & AGX_DBG_TRACE)
agxdecode_track_free(bo);