Merge pull request #1476 from bunnei/fix-unmap-flush

nvhost_as_gpu: Flush/invalidate CPU VAddr on UnmapBuffer.
This commit is contained in:
bunnei 2018-10-11 16:51:28 -04:00 committed by GitHub
commit bc293e1751
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,10 +167,11 @@ u32 nvhost_as_gpu::UnmapBuffer(const std::vector<u8>& input, std::vector<u8>& ou
auto& system_instance = Core::System::GetInstance();
// Remove this memory region from the rasterizer cache.
system_instance.Renderer().Rasterizer().FlushAndInvalidateRegion(params.offset,
itr->second.size);
auto& gpu = system_instance.GPU();
auto cpu_addr = gpu.MemoryManager().GpuToCpuAddress(params.offset);
ASSERT(cpu_addr);
system_instance.Renderer().Rasterizer().FlushAndInvalidateRegion(*cpu_addr, itr->second.size);
params.offset = gpu.MemoryManager().UnmapBuffer(params.offset, itr->second.size);
buffer_mappings.erase(itr->second.offset);