diff options
| author | 2023-06-08 21:53:57 -0400 | |
|---|---|---|
| committer | 2023-06-08 21:53:57 -0400 | |
| commit | 2a1acbfb4d0de3f5dadea014dc7a5c2a31366f27 (patch) | |
| tree | 0e8077362c472ee5d30ff92a036fa4d8f45d9ee6 /src/core/hle | |
| parent | Merge pull request #10676 from bunnei/fix-mi-5-android (diff) | |
| parent | nvnflinger: allow locking framerate during video playback (diff) | |
| download | yuzu-2a1acbfb4d0de3f5dadea014dc7a5c2a31366f27.tar.gz yuzu-2a1acbfb4d0de3f5dadea014dc7a5c2a31366f27.tar.xz yuzu-2a1acbfb4d0de3f5dadea014dc7a5c2a31366f27.zip | |
Merge pull request #10666 from liamwhite/my-framerate-is-fine
nvnflinger: allow locking framerate during video playback
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/nvnflinger/nvnflinger.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp index 0c7aee1b8..dc45169ad 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp | |||
| @@ -69,7 +69,7 @@ NvResult nvhost_nvdec::Ioctl3(DeviceFD fd, Ioctl command, std::span<const u8> in | |||
| 69 | 69 | ||
| 70 | void nvhost_nvdec::OnOpen(DeviceFD fd) { | 70 | void nvhost_nvdec::OnOpen(DeviceFD fd) { |
| 71 | LOG_INFO(Service_NVDRV, "NVDEC video stream started"); | 71 | LOG_INFO(Service_NVDRV, "NVDEC video stream started"); |
| 72 | system.AudioCore().SetNVDECActive(true); | 72 | system.SetNVDECActive(true); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | void nvhost_nvdec::OnClose(DeviceFD fd) { | 75 | void nvhost_nvdec::OnClose(DeviceFD fd) { |
| @@ -79,7 +79,7 @@ void nvhost_nvdec::OnClose(DeviceFD fd) { | |||
| 79 | if (iter != host1x_file.fd_to_id.end()) { | 79 | if (iter != host1x_file.fd_to_id.end()) { |
| 80 | system.GPU().ClearCdmaInstance(iter->second); | 80 | system.GPU().ClearCdmaInstance(iter->second); |
| 81 | } | 81 | } |
| 82 | system.AudioCore().SetNVDECActive(false); | 82 | system.SetNVDECActive(false); |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | } // namespace Service::Nvidia::Devices | 85 | } // namespace Service::Nvidia::Devices |
diff --git a/src/core/hle/service/nvnflinger/nvnflinger.cpp b/src/core/hle/service/nvnflinger/nvnflinger.cpp index 4988e6e17..da2d5890f 100644 --- a/src/core/hle/service/nvnflinger/nvnflinger.cpp +++ b/src/core/hle/service/nvnflinger/nvnflinger.cpp | |||
| @@ -324,6 +324,10 @@ s64 Nvnflinger::GetNextTicks() const { | |||
| 324 | speed_scale = 0.01f; | 324 | speed_scale = 0.01f; |
| 325 | } | 325 | } |
| 326 | } | 326 | } |
| 327 | if (system.GetNVDECActive() && settings.use_video_framerate.GetValue()) { | ||
| 328 | // Run at intended presentation rate during video playback. | ||
| 329 | speed_scale = 1.f; | ||
| 330 | } | ||
| 327 | 331 | ||
| 328 | // As an extension, treat nonpositive swap interval as framerate multiplier. | 332 | // As an extension, treat nonpositive swap interval as framerate multiplier. |
| 329 | const f32 effective_fps = swap_interval <= 0 ? 120.f * static_cast<f32>(1 - swap_interval) | 333 | const f32 effective_fps = swap_interval <= 0 ? 120.f * static_cast<f32>(1 - swap_interval) |