diff --git a/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp b/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp index d78bc25508..813915820b 100644 --- a/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPUCommonRecompiler.cpp @@ -8721,7 +8721,7 @@ spu_program spu_recompiler_base::analyse(const be_t* ls, u32 entry_point, s // This difference cannot be known at analyzer time but from observing callers. static constexpr std::initializer_list allowed_patterns = { - "620oYSe8uQqq9eTkhWfMqoEXX0us"sv, // CellSpurs JobChain acquire pattern + "disabled_620oYSe8uQqq9eTkhWfMqoEXX0us"sv, // CellSpurs JobChain acquire pattern (disabled for now) }; allow_pattern = std::any_of(allowed_patterns.begin(), allowed_patterns.end(), FN(pattern_hash == x)); diff --git a/rpcs3/Emu/Memory/vm.cpp b/rpcs3/Emu/Memory/vm.cpp index 9e460a7aa2..0a899f7a7d 100644 --- a/rpcs3/Emu/Memory/vm.cpp +++ b/rpcs3/Emu/Memory/vm.cpp @@ -483,6 +483,14 @@ namespace vm { auto& bits = get_range_lock_bits(true); + if (!!bits) + { + if (i == 0 && g_cfg.core.ppu_reservation_priority_over_spu) + { + busy_wait(5000); + } + } + if (!range_lock) { if (!bits && bits.compare_and_swap_test(0, u64{umax})) diff --git a/rpcs3/Emu/system_config.h b/rpcs3/Emu/system_config.h index 89ee372a82..ea7de326f8 100644 --- a/rpcs3/Emu/system_config.h +++ b/rpcs3/Emu/system_config.h @@ -41,6 +41,7 @@ struct cfg_root : cfg::node cfg::_bool spu_accurate_reservations{ this, "Accurate SPU Reservations", true }; cfg::_bool accurate_cache_line_stores{ this, "Accurate Cache Line Stores", false }; cfg::_bool rsx_accurate_res_access{this, "Accurate RSX reservation access", false, true}; + cfg::_bool ppu_reservation_priority_over_spu{this, "PPU Reservation Priority Over SPUs", false, true}; struct fifo_setting : public cfg::_enum { diff --git a/rpcs3/rpcs3qt/emu_settings_type.cpp b/rpcs3/rpcs3qt/emu_settings_type.cpp index 53260c2c39..e8de70f334 100644 --- a/rpcs3/rpcs3qt/emu_settings_type.cpp +++ b/rpcs3/rpcs3qt/emu_settings_type.cpp @@ -58,6 +58,7 @@ const std::map settings_location = { emu_settings_type::SPUProfiler, get_cfg_location(local_cfg.core.spu_prof) }, { emu_settings_type::DisableSpinOptimization, get_cfg_location(local_cfg.core.spu_getllar_spin_optimization_disabled) }, { emu_settings_type::EnabledSPUEventsBusyLoop, get_cfg_location(local_cfg.core.spu_reservation_busy_waiting_enabled) }, + { emu_settings_type::PPUReservationPriorityOverSPUs, get_cfg_location(local_cfg.core.ppu_reservation_priority_over_spu) }, // Graphics Tab { emu_settings_type::Renderer, get_cfg_location(local_cfg.video.renderer) }, diff --git a/rpcs3/rpcs3qt/emu_settings_type.h b/rpcs3/rpcs3qt/emu_settings_type.h index 81f7f5e725..0f3cd313a9 100644 --- a/rpcs3/rpcs3qt/emu_settings_type.h +++ b/rpcs3/rpcs3qt/emu_settings_type.h @@ -52,6 +52,7 @@ enum class emu_settings_type SPUProfiler, DisableSpinOptimization, EnabledSPUEventsBusyLoop, + PPUReservationPriorityOverSPUs, // Graphics Renderer, diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index c84cdc53c6..116057fcf1 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -260,6 +260,9 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std m_emu_settings->EnhanceCheckBox(ui->spuLoopDetection, emu_settings_type::SPULoopDetection); SubscribeTooltip(ui->spuLoopDetection, tooltips.settings.spu_loop_detection); + m_emu_settings->EnhanceCheckBox(ui->ppuReservationPrority, emu_settings_type::PPUReservationPriorityOverSPUs); + SubscribeTooltip(ui->ppuReservationPrority, tooltips.settings.ppu_reservation_priority); + // Comboboxes m_emu_settings->EnhanceComboBox(ui->xfloatAccuracy, emu_settings_type::XFloatAccuracy); SubscribeTooltip(ui->gb_xfloat_accuracy, tooltips.settings.xfloat); diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index 46feb0c224..6f587470ff 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -2519,6 +2519,13 @@ + + + + PPU Reservation Priority + + + diff --git a/rpcs3/rpcs3qt/tooltips.h b/rpcs3/rpcs3qt/tooltips.h index f0f7ded85b..4bc688db38 100644 --- a/rpcs3/rpcs3qt/tooltips.h +++ b/rpcs3/rpcs3qt/tooltips.h @@ -96,6 +96,7 @@ public: const QString spu_block_size = tr("This option controls the SPU analyser, particularly the size of compiled units. The Mega and Giga modes may improve performance by tying smaller units together, decreasing the number of compiled units but increasing their size.\nUse the Safe mode for maximum compatibility."); const QString preferred_spu_threads = tr("Some SPU stages are sensitive to race conditions and allowing a limited number at a time helps alleviate performance stalls.\nSetting this to a smaller value might improve performance and reduce stuttering in some games.\nLeave this on auto if performance is negatively affected when setting a small value."); const QString max_cpu_preempt = tr("Reduces CPU usage and power consumption, improving battery life on mobile devices. (0 means disabled)\nHigher values cause a more pronounced effect, but may cause audio or performance issues. A value of 50 or less is recommended.\nThis option forces an FPS limit because it's active when framerate is stable.\nThe lighter the game is on the hardware, the more power is saved by it. (until the preemption count barrier is reached)"); + const QString ppu_reservation_priority = tr("Give PPUs an execution advantage when the SPUs are using reservations.\nThis setting is recommended only for a few game for improving performance.\nDO NOT use it without being advised to due to potential performance degradation."); // debug