Conversation
chaoticgd
left a comment
There was a problem hiding this comment.
Found some problems, haven't benchmarked it.
| <item row="4" column="0"> | ||
| <widget class="QCheckBox" name="feralGameMode"> | ||
| <property name="text"> | ||
| <string>Enable Thread Pinning</string> |
There was a problem hiding this comment.
There's an odd gap when the fast CDVD option is disabled but the game mode option is enabled. You should add some logic to the .cpp file to correct this. Ideally we'd have a layout that just deals with it, but I think for now we should just do it manually.
| #include "common/Darwin/DarwinMisc.h" | ||
| #endif | ||
|
|
||
| #ifdef __linux__ |
There was a problem hiding this comment.
There seems to be two separate layers of ifdefs checking the OS. I would remove the ones here and keep the ones in GameMode.h.
| #include "common/Console.h" | ||
|
|
||
| namespace GameMode { | ||
| static std::atomic<bool> s_gamemode_active{false}; |
There was a problem hiding this comment.
Why is this atomic? It looks like it's only accessed from a single thread.
There was a problem hiding this comment.
Actually, thinking about this some more, it appears to be possible for another process to enable game mode for PCSX2 on its behalf, so we should probably be using gamemode_query_status rather than storing this in a variable.
| #include <atomic> | ||
| #include "common/Console.h" | ||
|
|
||
| namespace GameMode { |
There was a problem hiding this comment.
You can remove this namespace line and prefix function names with "GameMode::" instead. That way you can run clang-format and everything won't be indented.
| @@ -0,0 +1,26 @@ | |||
| Copyright (c) 2017-2025, Feral Interactive and the GameMode contributors | |||
There was a problem hiding this comment.
You should also add this to the third party licenses file.
| @@ -0,0 +1,234 @@ | |||
| ## 1.8.2 | |||
| ${LIBC_LIBRARIES} | ||
| ) | ||
|
|
||
| if(LINUX) |
There was a problem hiding this comment.
This breaks when -DUSE_GAMEMODE=OFF is passed to CMake since the library hasn't been added.
| set(pcsx2LinuxSources | ||
| CDVD/Linux/DriveUtility.cpp | ||
| CDVD/Linux/IOCtlSrc.cpp | ||
| Host/Linux/GameMode.cpp |
There was a problem hiding this comment.
If the ifdefs are going to go in GameMode.cpp/GameMode.h, these shouldn't be platform-specific sources.
|
|
||
| if (enabled) | ||
| { | ||
| if (gamemode_request_start() == 0) |
There was a problem hiding this comment.
I wonder if this logic is actually required, or if you could just call gamemode_request_start/gamemode_request_stop repeatedly without issue.
| SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.precacheCDVD, "EmuCore", "CdvdPrecache", false); | ||
| SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.feralGameMode, "EmuCore", "EnableGameMode", false); | ||
|
|
||
| m_ui.feralGameMode->setVisible(GameMode::IsAvailable() && QtHost::ShouldShowAdvancedSettings()); |
There was a problem hiding this comment.
I don't see a good reason to gate this behind the advanced settings.
Description of Changes
This PR implements support for Feral Interactive's GameMode. (Only for Linux)
For more information, check out the Arch Linux Wiki.
You can find the settings on
Settings -> Emulation -> Enable Feral GameModeNote: You will need to have the actual gamemode's daemon itself installed on your system, otherwise PCSX2 will not do anything on its own.
PCSX2 will also detects if you have the daemon available and will automatically hide the setting if its not available on the running system.
NOTE 2: You have to enable advanced settings as well for the setting to show up. If this is too restrictive, further discussion are welcome.
2026-04-03.20-18-37.mp4
Rationale behind Changes
Hopefully better performance for those who needs it.
Closes #13237
Suggested Testing Steps
-1. Use Linux
0. Make sure GameMode is installed on your system
Also make sure nothing is broken on Windows and macOS side.
Did you use AI to help find, test, or implement this issue or feature?
Nop