Merge pull request #2799 from yuriks/virtual-cached-range-flush
Add address conversion functions returning optional, Add function to flush virtual region from rasterizer cache
This commit is contained in:
commit
045d0b5bbd
6 changed files with 113 additions and 68 deletions
|
@ -149,7 +149,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
|
|||
|
||||
if (base_address == 0 && target_address == 0) {
|
||||
// Calculate the address at which to map the memory block.
|
||||
target_address = Memory::PhysicalToVirtualAddress(linear_heap_phys_address);
|
||||
target_address = Memory::PhysicalToVirtualAddress(linear_heap_phys_address).value();
|
||||
}
|
||||
|
||||
// Map the memory block into the target process
|
||||
|
|
|
@ -85,7 +85,7 @@ void GetSharedFont(Service::Interface* self) {
|
|||
// The shared font has to be relocated to the new address before being passed to the
|
||||
// application.
|
||||
VAddr target_address =
|
||||
Memory::PhysicalToVirtualAddress(shared_font_mem->linear_heap_phys_address);
|
||||
Memory::PhysicalToVirtualAddress(shared_font_mem->linear_heap_phys_address).value();
|
||||
if (!shared_font_relocated) {
|
||||
BCFNT::RelocateSharedFont(shared_font_mem, target_address);
|
||||
shared_font_relocated = true;
|
||||
|
|
|
@ -475,12 +475,11 @@ static void ExecuteCommand(const Command& command, u32 thread_id) {
|
|||
|
||||
// TODO: Consider attempting rasterizer-accelerated surface blit if that usage is ever
|
||||
// possible/likely
|
||||
Memory::RasterizerFlushRegion(
|
||||
Memory::VirtualToPhysicalAddress(command.dma_request.source_address),
|
||||
command.dma_request.size);
|
||||
Memory::RasterizerFlushAndInvalidateRegion(
|
||||
Memory::VirtualToPhysicalAddress(command.dma_request.dest_address),
|
||||
command.dma_request.size);
|
||||
Memory::RasterizerFlushVirtualRegion(command.dma_request.source_address,
|
||||
command.dma_request.size, Memory::FlushMode::Flush);
|
||||
Memory::RasterizerFlushVirtualRegion(command.dma_request.dest_address,
|
||||
command.dma_request.size,
|
||||
Memory::FlushMode::FlushAndInvalidate);
|
||||
|
||||
// TODO(Subv): These memory accesses should not go through the application's memory mapping.
|
||||
// They should go through the GSP module's memory mapping.
|
||||
|
|
|
@ -587,8 +587,8 @@ static void StartConversion(Interface* self) {
|
|||
// dst_image_size would seem to be perfect for this, but it doesn't include the gap :(
|
||||
u32 total_output_size =
|
||||
conversion.input_lines * (conversion.dst.transfer_unit + conversion.dst.gap);
|
||||
Memory::RasterizerFlushAndInvalidateRegion(
|
||||
Memory::VirtualToPhysicalAddress(conversion.dst.address), total_output_size);
|
||||
Memory::RasterizerFlushVirtualRegion(conversion.dst.address, total_output_size,
|
||||
Memory::FlushMode::FlushAndInvalidate);
|
||||
|
||||
HW::Y2R::PerformConversion(conversion);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue