Fix bugs introduced by refactoring

GPU VMM was mistakenly checking the alignment of the PA rather than the
VA and NvMap::Free was not accounting for the handle index starting from
one.
This commit is contained in:
Billy Laws 2020-10-21 22:29:20 +01:00 committed by ◱ PixelyIon
parent c65c91e1bc
commit 39f0345ac7
2 changed files with 2 additions and 2 deletions

View File

@ -118,7 +118,7 @@ namespace skyline::gpu::vmm {
} }
u64 MemoryManager::MapFixed(u64 address, u8 *pointer, u64 size) { u64 MemoryManager::MapFixed(u64 address, u8 *pointer, u64 size) {
if (!util::IsAligned(pointer, constant::GpuPageSize)) if (!util::IsAligned(address, constant::GpuPageSize))
return false; return false;
size = util::AlignUp(size, constant::GpuPageSize); size = util::AlignUp(size, constant::GpuPageSize);

View File

@ -80,7 +80,7 @@ namespace skyline::service::nvdrv::device {
std::unique_lock lock(mapMutex); std::unique_lock lock(mapMutex);
try { try {
auto &object{maps.at(data.handle)}; auto &object{maps.at(data.handle - 1)};
if (object.use_count() > 1) { if (object.use_count() > 1) {
data.pointer = object->pointer; data.pointer = object->pointer;
data.flags = 0x0; data.flags = 0x0;