mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-14 14:28:08 +02:00
venus: recheck valid bit after acquiring lock to init ahb mem type bits
Fixes: 432ffaf10a ("venus: refactor ahb buffer mem type bits cache to be lazy")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24033>
This commit is contained in:
parent
ee7e440743
commit
75fd29036f
1 changed files with 5 additions and 3 deletions
|
|
@ -106,9 +106,11 @@ vn_buffer_get_ahb_memory_type_bits(struct vn_device *dev)
|
||||||
struct vn_buffer_cache *cache = &dev->buffer_cache;
|
struct vn_buffer_cache *cache = &dev->buffer_cache;
|
||||||
if (unlikely(!cache->ahb_mem_type_bits_valid)) {
|
if (unlikely(!cache->ahb_mem_type_bits_valid)) {
|
||||||
simple_mtx_lock(&cache->mutex);
|
simple_mtx_lock(&cache->mutex);
|
||||||
cache->ahb_mem_type_bits =
|
if (!cache->ahb_mem_type_bits_valid) {
|
||||||
vn_android_get_ahb_buffer_memory_type_bits(dev);
|
cache->ahb_mem_type_bits =
|
||||||
cache->ahb_mem_type_bits_valid = true;
|
vn_android_get_ahb_buffer_memory_type_bits(dev);
|
||||||
|
cache->ahb_mem_type_bits_valid = true;
|
||||||
|
}
|
||||||
simple_mtx_unlock(&cache->mutex);
|
simple_mtx_unlock(&cache->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue