diff options
| -rw-r--r-- | src/video_core/engines/maxwell_dma.cpp | 20 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_dma.h | 2 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index 67388d980..1fc1358bc 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp | |||
| @@ -53,7 +53,6 @@ void MaxwellDMA::Launch() { | |||
| 53 | 53 | ||
| 54 | // TODO(Subv): Perform more research and implement all features of this engine. | 54 | // TODO(Subv): Perform more research and implement all features of this engine. |
| 55 | const LaunchDMA& launch = regs.launch_dma; | 55 | const LaunchDMA& launch = regs.launch_dma; |
| 56 | ASSERT(launch.semaphore_type == LaunchDMA::SemaphoreType::NONE); | ||
| 57 | ASSERT(launch.interrupt_type == LaunchDMA::InterruptType::NONE); | 56 | ASSERT(launch.interrupt_type == LaunchDMA::InterruptType::NONE); |
| 58 | ASSERT(launch.data_transfer_type == LaunchDMA::DataTransferType::NON_PIPELINED); | 57 | ASSERT(launch.data_transfer_type == LaunchDMA::DataTransferType::NON_PIPELINED); |
| 59 | ASSERT(regs.dst_params.origin.x == 0); | 58 | ASSERT(regs.dst_params.origin.x == 0); |
| @@ -79,6 +78,7 @@ void MaxwellDMA::Launch() { | |||
| 79 | CopyPitchToBlockLinear(); | 78 | CopyPitchToBlockLinear(); |
| 80 | } | 79 | } |
| 81 | } | 80 | } |
| 81 | ReleaseSemaphore(); | ||
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | void MaxwellDMA::CopyPitchToPitch() { | 84 | void MaxwellDMA::CopyPitchToPitch() { |
| @@ -244,4 +244,22 @@ void MaxwellDMA::FastCopyBlockLinearToPitch() { | |||
| 244 | memory_manager.WriteBlock(regs.offset_out, write_buffer.data(), dst_size); | 244 | memory_manager.WriteBlock(regs.offset_out, write_buffer.data(), dst_size); |
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | void MaxwellDMA::ReleaseSemaphore() { | ||
| 248 | const auto type = regs.launch_dma.semaphore_type; | ||
| 249 | const GPUVAddr address = regs.semaphore.address; | ||
| 250 | switch (type) { | ||
| 251 | case LaunchDMA::SemaphoreType::NONE: | ||
| 252 | break; | ||
| 253 | case LaunchDMA::SemaphoreType::RELEASE_ONE_WORD_SEMAPHORE: | ||
| 254 | memory_manager.Write<u32>(address, regs.semaphore.payload); | ||
| 255 | break; | ||
| 256 | case LaunchDMA::SemaphoreType::RELEASE_FOUR_WORD_SEMAPHORE: | ||
| 257 | memory_manager.Write<u64>(address, static_cast<u64>(regs.semaphore.payload)); | ||
| 258 | memory_manager.Write<u64>(address + 8, system.GPU().GetTicks()); | ||
| 259 | break; | ||
| 260 | default: | ||
| 261 | UNREACHABLE_MSG("Unknown semaphore type: {}", static_cast<u32>(type.Value())); | ||
| 262 | } | ||
| 263 | } | ||
| 264 | |||
| 247 | } // namespace Tegra::Engines | 265 | } // namespace Tegra::Engines |
diff --git a/src/video_core/engines/maxwell_dma.h b/src/video_core/engines/maxwell_dma.h index a04514425..2692cac8a 100644 --- a/src/video_core/engines/maxwell_dma.h +++ b/src/video_core/engines/maxwell_dma.h | |||
| @@ -224,6 +224,8 @@ private: | |||
| 224 | 224 | ||
| 225 | void FastCopyBlockLinearToPitch(); | 225 | void FastCopyBlockLinearToPitch(); |
| 226 | 226 | ||
| 227 | void ReleaseSemaphore(); | ||
| 228 | |||
| 227 | Core::System& system; | 229 | Core::System& system; |
| 228 | 230 | ||
| 229 | MemoryManager& memory_manager; | 231 | MemoryManager& memory_manager; |