summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2024-02-06 16:25:03 +0100
committerGitHub <noreply@github.com>2024-02-06 16:25:03 +0100
commitc10e720ba9cb979577b3af53adb1347f13ec4ad5 (patch)
tree45094c231d85f9ab51ffe8299cf893affb4e7be8 /src/video_core
parentMerge pull request #12928 from german77/motion-mp (diff)
parentMemoryManager: Reduce the page table size based on last big page address. (diff)
downloadyuzu-c10e720ba9cb979577b3af53adb1347f13ec4ad5.tar
yuzu-c10e720ba9cb979577b3af53adb1347f13ec4ad5.tar.gz
yuzu-c10e720ba9cb979577b3af53adb1347f13ec4ad5.tar.bz2
yuzu-c10e720ba9cb979577b3af53adb1347f13ec4ad5.tar.lz
yuzu-c10e720ba9cb979577b3af53adb1347f13ec4ad5.tar.xz
yuzu-c10e720ba9cb979577b3af53adb1347f13ec4ad5.tar.zst
yuzu-c10e720ba9cb979577b3af53adb1347f13ec4ad5.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/host1x/host1x.cpp2
-rw-r--r--src/video_core/memory_manager.cpp17
-rw-r--r--src/video_core/memory_manager.h8
3 files changed, 15 insertions, 12 deletions
diff --git a/src/video_core/host1x/host1x.cpp b/src/video_core/host1x/host1x.cpp
index c4c7a5883..e923bfa22 100644
--- a/src/video_core/host1x/host1x.cpp
+++ b/src/video_core/host1x/host1x.cpp
@@ -10,7 +10,7 @@ namespace Host1x {
Host1x::Host1x(Core::System& system_)
: system{system_}, syncpoint_manager{},
- memory_manager(system.DeviceMemory()), gmmu_manager{system, memory_manager, 32, 12},
+ memory_manager(system.DeviceMemory()), gmmu_manager{system, memory_manager, 32, 0, 12},
allocator{std::make_unique<Common::FlatAllocator<u32, 0, 32>>(1 << 12)} {}
Host1x::~Host1x() = default;
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp
index a52f8e486..ffafc48ef 100644
--- a/src/video_core/memory_manager.cpp
+++ b/src/video_core/memory_manager.cpp
@@ -22,11 +22,12 @@ using Tegra::Memory::GuestMemoryFlags;
std::atomic<size_t> MemoryManager::unique_identifier_generator{};
MemoryManager::MemoryManager(Core::System& system_, MaxwellDeviceMemoryManager& memory_,
- u64 address_space_bits_, u64 big_page_bits_, u64 page_bits_)
+ u64 address_space_bits_, GPUVAddr split_address_, u64 big_page_bits_,
+ u64 page_bits_)
: system{system_}, memory{memory_}, address_space_bits{address_space_bits_},
- page_bits{page_bits_}, big_page_bits{big_page_bits_}, entries{}, big_entries{},
- page_table{address_space_bits, address_space_bits + page_bits - 38,
- page_bits != big_page_bits ? page_bits : 0},
+ split_address{split_address_}, page_bits{page_bits_}, big_page_bits{big_page_bits_},
+ entries{}, big_entries{}, page_table{address_space_bits, address_space_bits + page_bits - 38,
+ page_bits != big_page_bits ? page_bits : 0},
kind_map{PTEKind::INVALID}, unique_identifier{unique_identifier_generator.fetch_add(
1, std::memory_order_acq_rel)},
accumulator{std::make_unique<VideoCommon::InvalidationAccumulator>()} {
@@ -48,10 +49,10 @@ MemoryManager::MemoryManager(Core::System& system_, MaxwellDeviceMemoryManager&
entries.resize(page_table_size / 32, 0);
}
-MemoryManager::MemoryManager(Core::System& system_, u64 address_space_bits_, u64 big_page_bits_,
- u64 page_bits_)
- : MemoryManager(system_, system_.Host1x().MemoryManager(), address_space_bits_, big_page_bits_,
- page_bits_) {}
+MemoryManager::MemoryManager(Core::System& system_, u64 address_space_bits_,
+ GPUVAddr split_address_, u64 big_page_bits_, u64 page_bits_)
+ : MemoryManager(system_, system_.Host1x().MemoryManager(), address_space_bits_, split_address_,
+ big_page_bits_, page_bits_) {}
MemoryManager::~MemoryManager() = default;
diff --git a/src/video_core/memory_manager.h b/src/video_core/memory_manager.h
index c5255f36c..ac7c1472a 100644
--- a/src/video_core/memory_manager.h
+++ b/src/video_core/memory_manager.h
@@ -36,10 +36,11 @@ namespace Tegra {
class MemoryManager final {
public:
explicit MemoryManager(Core::System& system_, u64 address_space_bits_ = 40,
- u64 big_page_bits_ = 16, u64 page_bits_ = 12);
- explicit MemoryManager(Core::System& system_, MaxwellDeviceMemoryManager& memory_,
- u64 address_space_bits_ = 40, u64 big_page_bits_ = 16,
+ GPUVAddr split_address = 1ULL << 34, u64 big_page_bits_ = 16,
u64 page_bits_ = 12);
+ explicit MemoryManager(Core::System& system_, MaxwellDeviceMemoryManager& memory_,
+ u64 address_space_bits_ = 40, GPUVAddr split_address = 1ULL << 34,
+ u64 big_page_bits_ = 16, u64 page_bits_ = 12);
~MemoryManager();
size_t GetID() const {
@@ -192,6 +193,7 @@ private:
MaxwellDeviceMemoryManager& memory;
const u64 address_space_bits;
+ GPUVAddr split_address;
const u64 page_bits;
u64 address_space_size;
u64 page_size;