From 62294825b697d162e6726f0510a327bd3f4fa3dd Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sat, 13 Jun 2026 16:00:08 +0100 Subject: [PATCH 1/4] Fix small typo in gamemode.ini example --- example/gamemode.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/gamemode.ini b/example/gamemode.ini index 14dc9a01..6bbb98b0 100644 --- a/example/gamemode.ini +++ b/example/gamemode.ini @@ -80,7 +80,7 @@ disable_splitlock=1 ;nv_mem_clock_mhz_offset=0 ; Whether the GPU supports per-profile editable options for core and memory clock offsets. -; NOTE: if thi is set to 0 (AllPerformanceLevels) then nv_powermizer_mode must be set to 0 +; NOTE: if this is set to 0 (AllPerformanceLevels) then nv_powermizer_mode must be set to 0 ;nv_per_profile_editable = 1 ; AMD specific settings From 85f3524d3cb0d03fd069ae9b3b2b863f30dceb69 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sat, 13 Jun 2026 16:00:25 +0100 Subject: [PATCH 2/4] Fix incorrect error log when query status fails --- daemon/gamemoded.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon/gamemoded.c b/daemon/gamemoded.c index 55b8b271..f19cfaca 100644 --- a/daemon/gamemoded.c +++ b/daemon/gamemoded.c @@ -183,7 +183,8 @@ int main(int argc, char *argv[]) case 's': if (optarg != NULL) { pid_t pid = atoi(optarg); - switch (gamemode_query_status_for(pid)) { + int ret = gamemode_query_status_for(pid); + switch (ret) { case 0: /* inactive */ LOG_MSG("gamemode is inactive\n"); break; @@ -199,7 +200,7 @@ int main(int argc, char *argv[]) gamemode_error_string()); exit(EXIT_FAILURE); default: - LOG_ERROR("gamemode_query_status returned unexpected value 2\n"); + LOG_ERROR("gamemode_query_status returned unexpected value %d\n", ret); exit(EXIT_FAILURE); } } else { From e10f5fdf5cbf7a782f6cb5d5403b1f476c914e89 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sat, 13 Jun 2026 16:03:45 +0100 Subject: [PATCH 3/4] Add default cases for unexpected return values --- daemon/gamemoded.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/daemon/gamemoded.c b/daemon/gamemoded.c index f19cfaca..a845283f 100644 --- a/daemon/gamemoded.c +++ b/daemon/gamemoded.c @@ -229,7 +229,8 @@ int main(int argc, char *argv[]) pid_t pid = atoi(optarg); /* toggle gamemode for the process */ - switch (gamemode_query_status_for(pid)) { + int ret = gamemode_query_status_for(pid); + switch (ret) { case 0: /* inactive */ case 1: /* active not not registered */ LOG_MSG("gamemode not active for client, requesting start for %d...\n", pid); @@ -256,6 +257,11 @@ int main(int argc, char *argv[]) pid, gamemode_error_string()); exit(EXIT_FAILURE); + default: + LOG_ERROR("gamemode_query_status_for(%d) returned unexpected value %d\n", + pid, + ret); + exit(EXIT_FAILURE); } } else { @@ -266,7 +272,8 @@ int main(int argc, char *argv[]) } /* Request and report on the status */ - switch (gamemode_query_status()) { + int ret = gamemode_query_status(); + switch (ret) { case 2: /* active for this client */ LOG_MSG("gamemode request succeeded and is active\n"); break; @@ -279,6 +286,9 @@ int main(int argc, char *argv[]) case -1: /* error */ LOG_ERROR("gamemode_query_status failed: %s\n", gamemode_error_string()); exit(EXIT_FAILURE); + default: + LOG_ERROR("gamemode_query_status returned unexpected value %d\n", ret); + exit(EXIT_FAILURE); } /* Simply pause and wait a SIGINT */ @@ -297,7 +307,8 @@ int main(int argc, char *argv[]) exit(EXIT_SUCCESS); case 'R': - switch (gamemode_request_restart()) { + int ret = gamemode_request_restart(); + switch (ret) { case 0: /* success */ LOG_MSG("gamemode restart succeeded\n"); exit(EXIT_SUCCESS); @@ -307,6 +318,9 @@ int main(int argc, char *argv[]) case -1: /* error */ LOG_ERROR("gamemode_request_restart failed: %s\n", gamemode_error_string()); break; + default: + LOG_ERROR("gamemode_request_restart returned unexpected value %d\n", ret); + break; } exit(EXIT_FAILURE); From a1f5530f5adf09ffa246863519fbe0b7b2bd0a75 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sat, 13 Jun 2026 22:54:49 +0100 Subject: [PATCH 4/4] Fix another typo --- example/gamemode.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/gamemode.ini b/example/gamemode.ini index 6bbb98b0..67cf0887 100644 --- a/example/gamemode.ini +++ b/example/gamemode.ini @@ -16,7 +16,7 @@ desiredprof=performance igpu_desiredgov=powersave ; Threshold to use to decide when the integrated GPU is under heavy load. ; This is a ratio of iGPU Watts / CPU Watts which is used to determine when the -; integraged GPU is under heavy enough load to justify switching to +; integrated GPU is under heavy enough load to justify switching to ; igpu_desiredgov. Set this to -1 to disable all iGPU checking and always ; use desiredgov for games. igpu_power_threshold=0.3