yuzu: integrate gamemode support on linux
This commit is contained in:
parent
9485b44d25
commit
e21bdc68db
11 changed files with 481 additions and 1 deletions
src/yuzu_cmd
|
@ -63,6 +63,10 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
#include <gamemode_client.h>
|
||||
#endif
|
||||
|
||||
static void PrintHelp(const char* argv0) {
|
||||
std::cout << "Usage: " << argv0
|
||||
<< " [options] <filename>\n"
|
||||
|
@ -425,6 +429,16 @@ int main(int argc, char** argv) {
|
|||
exit(0);
|
||||
});
|
||||
|
||||
#ifdef __linux__
|
||||
if (Settings::values.disable_gamemode) {
|
||||
if (gamemode_request_start() < 0) {
|
||||
LOG_WARNING(Frontend, "Failed to start gamemode: {}", gamemode_error_string());
|
||||
} else {
|
||||
LOG_INFO(Frontend, "Started gamemode");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void(system.Run());
|
||||
if (system.DebuggerEnabled()) {
|
||||
system.InitializeDebugger();
|
||||
|
@ -436,6 +450,16 @@ int main(int argc, char** argv) {
|
|||
void(system.Pause());
|
||||
system.ShutdownMainProcess();
|
||||
|
||||
#ifdef __linux__
|
||||
if (Settings::values.disable_gamemode) {
|
||||
if (gamemode_request_end() < 0) {
|
||||
LOG_WARNING(Frontend, "Failed to stop gamemode: {}", gamemode_error_string());
|
||||
} else {
|
||||
LOG_INFO(Frontend, "Stopped gamemode");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
detached_tasks.WaitForAllTasks();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue