summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2023-05-04 00:04:22 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2023-05-04 00:15:21 +0200
commit1c13c74295ebd63a1236c1522e2f9f842742ccd8 (patch)
treecf9f32731f49c897f4bfb0d6e6dd636b2306e5d1 /src/video_core
parentMerge pull request #10088 from FernandoS27/100-gelato-flavor-test-builds-later (diff)
downloadyuzu-1c13c74295ebd63a1236c1522e2f9f842742ccd8.tar
yuzu-1c13c74295ebd63a1236c1522e2f9f842742ccd8.tar.gz
yuzu-1c13c74295ebd63a1236c1522e2f9f842742ccd8.tar.bz2
yuzu-1c13c74295ebd63a1236c1522e2f9f842742ccd8.tar.lz
yuzu-1c13c74295ebd63a1236c1522e2f9f842742ccd8.tar.xz
yuzu-1c13c74295ebd63a1236c1522e2f9f842742ccd8.tar.zst
yuzu-1c13c74295ebd63a1236c1522e2f9f842742ccd8.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/memory_manager.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp
index e06ce5d14..7b2cde7a7 100644
--- a/src/video_core/memory_manager.cpp
+++ b/src/video_core/memory_manager.cpp
@@ -82,6 +82,7 @@ void MemoryManager::SetEntry(size_t position, MemoryManager::EntryType entry) {
}
PTEKind MemoryManager::GetPageKind(GPUVAddr gpu_addr) const {
+ std::unique_lock<std::mutex> lock(guard);
return kind_map.GetValueAt(gpu_addr);
}
@@ -160,7 +161,10 @@ GPUVAddr MemoryManager::BigPageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr
}
remaining_size -= big_page_size;
}
- kind_map.Map(gpu_addr, gpu_addr + size, kind);
+ {
+ std::unique_lock<std::mutex> lock(guard);
+ kind_map.Map(gpu_addr, gpu_addr + size, kind);
+ }
return gpu_addr;
}
@@ -170,7 +174,6 @@ void MemoryManager::BindRasterizer(VideoCore::RasterizerInterface* rasterizer_)
GPUVAddr MemoryManager::Map(GPUVAddr gpu_addr, VAddr cpu_addr, std::size_t size, PTEKind kind,
bool is_big_pages) {
- std::unique_lock<std::mutex> lock(guard);
if (is_big_pages) [[likely]] {
return BigPageTableOp<EntryType::Mapped>(gpu_addr, cpu_addr, size, kind);
}
@@ -178,7 +181,6 @@ GPUVAddr MemoryManager::Map(GPUVAddr gpu_addr, VAddr cpu_addr, std::size_t size,
}
GPUVAddr MemoryManager::MapSparse(GPUVAddr gpu_addr, std::size_t size, bool is_big_pages) {
- std::unique_lock<std::mutex> lock(guard);
if (is_big_pages) [[likely]] {
return BigPageTableOp<EntryType::Reserved>(gpu_addr, 0, size, PTEKind::INVALID);
}
@@ -189,7 +191,6 @@ void MemoryManager::Unmap(GPUVAddr gpu_addr, std::size_t size) {
if (size == 0) {
return;
}
- std::unique_lock<std::mutex> lock(guard);
GetSubmappedRangeImpl<false>(gpu_addr, size, page_stash);
for (const auto& [map_addr, map_size] : page_stash) {