diff options
| author | 2020-12-28 01:21:41 -0500 | |
|---|---|---|
| committer | 2021-01-07 14:33:45 -0500 | |
| commit | 06cef3355e415be83db3bc6d19b022de0b977580 (patch) | |
| tree | e4252a544bf01586f651238a8a08c76bb2a3377f /src/core | |
| parent | nvdec syncpt incorporation (diff) | |
| download | yuzu-06cef3355e415be83db3bc6d19b022de0b977580.tar.gz yuzu-06cef3355e415be83db3bc6d19b022de0b977580.tar.xz yuzu-06cef3355e415be83db3bc6d19b022de0b977580.zip | |
fix for nvdec disabled, cleanup host1x
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp | 25 |
1 files changed, 14 insertions, 11 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 64370ad4c..4898dc27a 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp | |||
| @@ -73,14 +73,15 @@ NvResult nvhost_nvdec_common::Submit(const std::vector<u8>& input, std::vector<u | |||
| 73 | offset = SpliceVectors(input, wait_checks, params.syncpoint_count, offset); | 73 | offset = SpliceVectors(input, wait_checks, params.syncpoint_count, offset); |
| 74 | offset = SpliceVectors(input, fences, params.fence_count, offset); | 74 | offset = SpliceVectors(input, fences, params.fence_count, offset); |
| 75 | 75 | ||
| 76 | for (std::size_t i = 0; i < syncpt_increments.size(); i++) { | ||
| 77 | SyncptIncr syncpt_incr = syncpt_increments[i]; | ||
| 78 | |||
| 79 | fences[i].id = syncpt_incr.id; | ||
| 80 | fences[i].value = | ||
| 81 | syncpoint_manager.IncreaseSyncpoint(syncpt_incr.id, syncpt_incr.increments); | ||
| 82 | } | ||
| 83 | auto& gpu = system.GPU(); | 76 | auto& gpu = system.GPU(); |
| 77 | if (gpu.UseNvdec()) { | ||
| 78 | for (std::size_t i = 0; i < syncpt_increments.size(); i++) { | ||
| 79 | const SyncptIncr& syncpt_incr = syncpt_increments[i]; | ||
| 80 | fences[i].id = syncpt_incr.id; | ||
| 81 | fences[i].value = | ||
| 82 | syncpoint_manager.IncreaseSyncpoint(syncpt_incr.id, syncpt_incr.increments); | ||
| 83 | } | ||
| 84 | } | ||
| 84 | for (const auto& cmd_buffer : command_buffers) { | 85 | for (const auto& cmd_buffer : command_buffers) { |
| 85 | auto object = nvmap_dev->GetObject(cmd_buffer.memory_id); | 86 | auto object = nvmap_dev->GetObject(cmd_buffer.memory_id); |
| 86 | ASSERT_OR_EXECUTE(object, return NvResult::InvalidState;); | 87 | ASSERT_OR_EXECUTE(object, return NvResult::InvalidState;); |
| @@ -95,11 +96,13 @@ NvResult nvhost_nvdec_common::Submit(const std::vector<u8>& input, std::vector<u | |||
| 95 | cmdlist.size() * sizeof(u32)); | 96 | cmdlist.size() * sizeof(u32)); |
| 96 | gpu.PushCommandBuffer(cmdlist); | 97 | gpu.PushCommandBuffer(cmdlist); |
| 97 | } | 98 | } |
| 98 | fences[0].value = syncpoint_manager.IncreaseSyncpoint(fences[0].id, 1); | 99 | if (gpu.UseNvdec()) { |
| 99 | 100 | ||
| 100 | Tegra::ChCommandHeaderList cmdlist{{(4 << 28) | fences[0].id}}; | 101 | fences[0].value = syncpoint_manager.IncreaseSyncpoint(fences[0].id, 1); |
| 101 | gpu.PushCommandBuffer(cmdlist); | ||
| 102 | 102 | ||
| 103 | Tegra::ChCommandHeaderList cmdlist{{(4 << 28) | fences[0].id}}; | ||
| 104 | gpu.PushCommandBuffer(cmdlist); | ||
| 105 | } | ||
| 103 | std::memcpy(output.data(), ¶ms, sizeof(IoctlSubmit)); | 106 | std::memcpy(output.data(), ¶ms, sizeof(IoctlSubmit)); |
| 104 | // Some games expect command_buffers to be written back | 107 | // Some games expect command_buffers to be written back |
| 105 | offset = sizeof(IoctlSubmit); | 108 | offset = sizeof(IoctlSubmit); |
| @@ -118,7 +121,7 @@ NvResult nvhost_nvdec_common::GetSyncpoint(const std::vector<u8>& input, std::ve | |||
| 118 | std::memcpy(¶ms, input.data(), sizeof(IoctlGetSyncpoint)); | 121 | std::memcpy(¶ms, input.data(), sizeof(IoctlGetSyncpoint)); |
| 119 | LOG_DEBUG(Service_NVDRV, "called GetSyncpoint, id={}", params.param); | 122 | LOG_DEBUG(Service_NVDRV, "called GetSyncpoint, id={}", params.param); |
| 120 | 123 | ||
| 121 | if (device_syncpoints[params.param] == 0) { | 124 | if (device_syncpoints[params.param] == 0 && system.GPU().UseNvdec()) { |
| 122 | device_syncpoints[params.param] = syncpoint_manager.AllocateSyncpoint(); | 125 | device_syncpoints[params.param] = syncpoint_manager.AllocateSyncpoint(); |
| 123 | } | 126 | } |
| 124 | params.value = device_syncpoints[params.param]; | 127 | params.value = device_syncpoints[params.param]; |