mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-27 01:41:45 +02:00
Support setting the platform profile
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.
This commit is contained in:

committed by
afayaz-feral

parent
81d26c79b4
commit
e75f2c3942
@ -58,4 +58,16 @@
|
||||
<annotate key="org.freedesktop.policykit.exec.path">@LIBEXECDIR@/procsysctl</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
|
||||
<action id="com.feralinteractive.GameMode.profile-helper">
|
||||
<description>Modify the platform profile</description>
|
||||
<message>Authentication is required to modify platform profile</message>
|
||||
<defaults>
|
||||
<allow_any>no</allow_any>
|
||||
<allow_inactive>no</allow_inactive>
|
||||
<allow_active>no</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">@LIBEXECDIR@/platprofctl</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
</policyconfig>
|
||||
|
@ -6,7 +6,8 @@ polkit.addRule(function (action, subject) {
|
||||
if ((action.id == "com.feralinteractive.GameMode.governor-helper" ||
|
||||
action.id == "com.feralinteractive.GameMode.gpu-helper" ||
|
||||
action.id == "com.feralinteractive.GameMode.cpu-helper" ||
|
||||
action.id == "com.feralinteractive.GameMode.procsys-helper") &&
|
||||
action.id == "com.feralinteractive.GameMode.procsys-helper" ||
|
||||
action.id == "com.feralinteractive.GameMode.profile-helper") &&
|
||||
subject.isInGroup("@GAMEMODE_PRIVILEGED_GROUP@"))
|
||||
{
|
||||
return polkit.Result.YES;
|
||||
|
Reference in New Issue
Block a user