summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/nvdrv/core/container.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/hle/service/nvdrv/core/container.cpp b/src/core/hle/service/nvdrv/core/container.cpp
index b5fd98a9d..21ef57d27 100644
--- a/src/core/hle/service/nvdrv/core/container.cpp
+++ b/src/core/hle/service/nvdrv/core/container.cpp
@@ -41,6 +41,8 @@ Container::Container(Tegra::Host1x::Host1x& host1x_) {
41Container::~Container() = default; 41Container::~Container() = default;
42 42
43SessionId Container::OpenSession(Kernel::KProcess* process) { 43SessionId Container::OpenSession(Kernel::KProcess* process) {
44 using namespace Common::Literals;
45
44 std::scoped_lock lk(impl->session_guard); 46 std::scoped_lock lk(impl->session_guard);
45 for (auto& session : impl->sessions) { 47 for (auto& session : impl->sessions) {
46 if (!session.is_active) { 48 if (!session.is_active) {
@@ -79,7 +81,7 @@ SessionId Container::OpenSession(Kernel::KProcess* process) {
79 cur_addr)); 81 cur_addr));
80 auto svc_mem_info = mem_info.GetSvcMemoryInfo(); 82 auto svc_mem_info = mem_info.GetSvcMemoryInfo();
81 83
82 // check if this memory block is heap 84 // Check if this memory block is heap.
83 if (svc_mem_info.state == Kernel::Svc::MemoryState::Normal) { 85 if (svc_mem_info.state == Kernel::Svc::MemoryState::Normal) {
84 if (svc_mem_info.size > region_size) { 86 if (svc_mem_info.size > region_size) {
85 region_size = svc_mem_info.size; 87 region_size = svc_mem_info.size;
@@ -96,13 +98,13 @@ SessionId Container::OpenSession(Kernel::KProcess* process) {
96 cur_addr = next_address; 98 cur_addr = next_address;
97 } 99 }
98 session.has_preallocated_area = false; 100 session.has_preallocated_area = false;
99 auto start_region = (region_size >> 15) >= 1024 ? smmu.Allocate(region_size) : 0; 101 auto start_region = region_size >= 32_MiB ? smmu.Allocate(region_size) : 0;
100 if (start_region != 0) { 102 if (start_region != 0) {
101 session.mapper = std::make_unique<HeapMapper>(region_start, start_region, region_size, 103 session.mapper = std::make_unique<HeapMapper>(region_start, start_region, region_size,
102 asid, impl->host1x); 104 asid, impl->host1x);
103 smmu.TrackContinuity(start_region, region_start, region_size, asid); 105 smmu.TrackContinuity(start_region, region_start, region_size, asid);
104 session.has_preallocated_area = true; 106 session.has_preallocated_area = true;
105 LOG_CRITICAL(Debug, "Preallocation created!"); 107 LOG_DEBUG(Debug, "Preallocation created!");
106 } 108 }
107 } 109 }
108 return SessionId{new_id}; 110 return SessionId{new_id};