If a system does not support setting the platform profile (i.e., does
not have the file /sys/firmware/acpi/platform_profile), then everything
that interacts with it is skipped to prevent errors. This situation is
more common than I expected.[1]
[1] https://github.com/FeralInteractive/gamemode/issues/524
This reduces duplication of the split lock mitigation path.
Additionally, it allows extending the functionality of procsysctl into
also getting the split lock mitigation state.
The platform profile may restrict what values the governor can take, so
we need to save all state first to ensure the restored state is correct.
Then, the platform profile is the first thing we set (and restore) to
ensure all other changes are made to the best of our ability.
The platform profile lives in /sys/firmware/acpi/platform_profile. The
desiredprof and defaultprof options correspond to the values for the
platform profile set when gamescope begins and ends, respectively.
HACK: The platform profile may restrict what values the governor can
take, so we choose to set the governor before the platform profile in
order to store the correct default governor, and restore the platform
profile before the governor. This is done to maximize correctness after
restoration, but it can cause issues if the previous platform profile
restricts the governor.
TODO: Save all the state we care about before any of it is changed. In
thsi case, we should set (and restore) the platform profile before the
governor.
GameMode integration is widespread nowadays, and it works out of the box
for the most common use cases.
There is no longer a need for us to maintain a list of supported games
and applications, allowing us to streamline the readme file.
Attribute the contributions made by members of the community, but avoid
unweildy and inconsistent copyright notices at the top of each file.
Existing contributor copyright notices have been left as-is.
There's a proper kernel way to check for the presence of P- and E-cores so we don't have to check the frequency differences.
Kept the frequency check in case the kernel way does not exist on the users kernel but upped the fail-safe to 10% from 5% to close#498
PolyMC seems to have been removed for the reason "PolyMC died" yet the project is still active. Requesting this be added back as it still supports gamemode even on the latest version
* README: Add new gamemode extension link
Since the old extension is no longer maintained by the original author and has stopped working in the latest releases of GNOME, I recommend including my extension in the README.
glibc provides a nonstandard basename implementation,
this can be overriden and posix basename can be used
by includeing libgen.h, however musl only has posix
basename, and must always include libgen.h
In this particular case, it doesn't appear that using
the posix version of basename will cause any issues,
as it is simply being used to match a hardcoded config
file name.
Systemd commit [bf1b9ae487b65b1cb1639b222724fab95e508cf5](bf1b9ae487) (present in Systemd v254 and later) effectively broke gamemodelist as the process map for the `systemd --user` process became unreadable. After this change gamemodelist would exit with an error like the following:
```
awk: fatal: cannot open file `/proc/2281/maps' for reading: Permission denied
```
To work around this let's add a hook to the awk statement to skip any files that can't be read.
ClosesFeralInteractive/gamemode#456
Fixes the following build failure:
In file included from ../common/common-cpu.c:32:
../common/common-cpu.h:44:9: error: unknown type name 'cpu_set_t'
44 | cpu_set_t *online;
| ^~~~~~~~~
../common/common-cpu.h:45:9: error: unknown type name 'cpu_set_t'
45 | cpu_set_t *to_keep;
| ^~~~~~~~~
Signed-off-by: Kostadin Shishmanov <kocelfc@tutanota.com>