Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions daemon/gamemoded.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -228,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);
Expand All @@ -255,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 {
Expand All @@ -265,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;
Expand All @@ -278,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 */
Expand All @@ -296,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);
Expand All @@ -306,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);

Expand Down
4 changes: 2 additions & 2 deletions example/gamemode.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading