Support setting the X3D V-Cache Mode

This commit is contained in:
cjwilsontech
2025-09-03 20:38:56 -07:00
parent 3c024dd6d9
commit e98e6837bb
9 changed files with 467 additions and 3 deletions

View File

@@ -70,4 +70,16 @@
<annotate key="org.freedesktop.policykit.exec.path">@LIBEXECDIR@/platprofctl</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
<action id="com.feralinteractive.GameMode.x3dmode-helper">
<description>Modify the AMD X3D cache mode</description>
<message>Authentication is required to modify AMD X3D cache mode</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@/x3dmodectl</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>

View File

@@ -1,13 +1,15 @@
/*
* Allow users in privileged gamemode group to run cpugovctl &
* gpuclockctl without authentication
* Allow users in privileged gamemode group to run gamemode utilities
* (cpugovctl, gpuclockctl, cpucorectl, procsysctl, platprofctl, x3dmodectl)
* without authentication
*/
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.profile-helper") &&
action.id == "com.feralinteractive.GameMode.profile-helper" ||
action.id == "com.feralinteractive.GameMode.x3dmode-helper") &&
subject.isInGroup("@GAMEMODE_PRIVILEGED_GROUP@"))
{
return polkit.Result.YES;