iris: destroy our mutexes a little later
While there seems to be no bug with the state things are today, I was recently doing some debugging and put an iris_bo_wait() before a bo_close() in iris_bufmgr_destroy(), which caused an issue since the bo_deps_lock mutex had already been destroyed. Since there are quite a few things we do with the bufmgr after destroying the mutexes, I figured we should probably postpone mutex destruction in order to be a little safer against future code modifications like the one I just did. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13494>
This commit is contained in:
@@ -1650,9 +1650,6 @@ iris_bufmgr_destroy(struct iris_bufmgr *bufmgr)
|
||||
pb_slabs_deinit(&bufmgr->bo_slabs[i]);
|
||||
}
|
||||
|
||||
simple_mtx_destroy(&bufmgr->lock);
|
||||
simple_mtx_destroy(&bufmgr->bo_deps_lock);
|
||||
|
||||
/* Free any cached buffer objects we were going to reuse */
|
||||
for (int i = 0; i < bufmgr->num_buckets; i++) {
|
||||
struct bo_cache_bucket *bucket = &bufmgr->cache_bucket[i];
|
||||
@@ -1680,6 +1677,9 @@ iris_bufmgr_destroy(struct iris_bufmgr *bufmgr)
|
||||
|
||||
close(bufmgr->fd);
|
||||
|
||||
simple_mtx_destroy(&bufmgr->lock);
|
||||
simple_mtx_destroy(&bufmgr->bo_deps_lock);
|
||||
|
||||
free(bufmgr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user