diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp index 1403a39d0..207a5b90d 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp | |||
| @@ -178,30 +178,11 @@ NvResult nvhost_nvdec_common::MapBuffer(const std::vector<u8>& input, std::vecto | |||
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | NvResult nvhost_nvdec_common::UnmapBuffer(const std::vector<u8>& input, std::vector<u8>& output) { | 180 | NvResult nvhost_nvdec_common::UnmapBuffer(const std::vector<u8>& input, std::vector<u8>& output) { |
| 181 | IoctlMapBuffer params{}; | 181 | // This is intntionally stubbed. |
| 182 | std::memcpy(¶ms, input.data(), sizeof(IoctlMapBuffer)); | 182 | // Skip unmapping buffers here, as to not break the continuity of the VP9 reference frame |
| 183 | std::vector<MapBufferEntry> cmd_buffer_handles(params.num_entries); | 183 | // addresses, and risk invalidating data before the async GPU thread is done with it |
| 184 | SliceVectors(input, cmd_buffer_handles, params.num_entries, sizeof(IoctlMapBuffer)); | ||
| 185 | |||
| 186 | auto& gpu = system.GPU(); | ||
| 187 | |||
| 188 | for (auto& cmd_buffer : cmd_buffer_handles) { | ||
| 189 | const auto object{nvmap_dev->GetObject(cmd_buffer.map_handle)}; | ||
| 190 | if (!object) { | ||
| 191 | LOG_ERROR(Service_NVDRV, "invalid cmd_buffer nvmap_handle={:X}", cmd_buffer.map_handle); | ||
| 192 | std::memcpy(output.data(), ¶ms, output.size()); | ||
| 193 | return NvResult::InvalidState; | ||
| 194 | } | ||
| 195 | if (const auto size{RemoveBufferMap(object->dma_map_addr)}; size) { | ||
| 196 | gpu.MemoryManager().Unmap(object->dma_map_addr, *size); | ||
| 197 | } else { | ||
| 198 | // This occurs quite frequently, however does not seem to impact functionality | ||
| 199 | LOG_DEBUG(Service_NVDRV, "invalid offset=0x{:X} dma=0x{:X}", object->addr, | ||
| 200 | object->dma_map_addr); | ||
| 201 | } | ||
| 202 | object->dma_map_addr = 0; | ||
| 203 | } | ||
| 204 | std::memset(output.data(), 0, output.size()); | 184 | std::memset(output.data(), 0, output.size()); |
| 185 | LOG_DEBUG(Service_NVDRV, "(STUBBED) called"); | ||
| 205 | return NvResult::Success; | 186 | return NvResult::Success; |
| 206 | } | 187 | } |
| 207 | 188 | ||