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
8 changes: 4 additions & 4 deletions tuned/ppd/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
BATTERY_SECTION = "battery"
DEFAULT_PROFILE_OPTION = "default"
BATTERY_DETECTION_OPTION = "battery_detection"
THINKPAD_FUNCTION_KEYS_OPTION = "thinkpad_function_keys"
SYSFS_ACPI_MONITOR_OPTION = "sysfs_acpi_monitor"


class ProfileMap:
Expand Down Expand Up @@ -75,13 +75,13 @@ def tuned_to_ppd(self):
return self._tuned_to_ppd

@property
def thinkpad_function_keys(self):
def sysfs_acpi_monitor(self):
"""
Whether to react to changes of ACPI platform profile
done via function keys (e.g., Fn-L) on newer Thinkpad
machines. Experimental feature.
"""
return self._thinkpad_function_keys
return self._sysfs_acpi_monitor

def load_from_file(self, config_file):
"""
Expand Down Expand Up @@ -141,4 +141,4 @@ def load_from_file(self, config_file):
self._ppd_to_tuned = ProfileMap(profile_dict_ac, profile_dict_dc)
self._tuned_to_ppd = ProfileMap({v: k for k, v in profile_dict_ac.items()}, {v: k for k, v in profile_dict_dc.items()})

self._thinkpad_function_keys = cfg.getboolean(MAIN_SECTION, THINKPAD_FUNCTION_KEYS_OPTION, fallback=False)
self._sysfs_acpi_monitor = cfg.getboolean(MAIN_SECTION, SYSFS_ACPI_MONITOR_OPTION, fallback=True)
2 changes: 1 addition & 1 deletion tuned/ppd/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def _setup_inotify(self):
self._inotify_watches |= self._watch_manager.add_watch(path=os.path.dirname(LAP_MODE_PATH),
mask=pyinotify.IN_MODIFY,
proc_fun=PerformanceDegradedEventHandler(self, LAP_MODE_PATH))
if self._platform_profile_supported and self._config.thinkpad_function_keys:
if self._platform_profile_supported and self._config.sysfs_acpi_monitor:
self._pinned_virtual_files.append(open(PLATFORM_PROFILE_PATH, "r"))
self._inotify_watches |= self._watch_manager.add_watch(path=os.path.dirname(PLATFORM_PROFILE_PATH),
mask=pyinotify.IN_OPEN | pyinotify.IN_MODIFY | pyinotify.IN_CLOSE_WRITE | pyinotify.IN_CLOSE_NOWRITE,
Expand Down
1 change: 1 addition & 0 deletions tuned/ppd/ppd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# The default PPD profile
default=balanced
battery_detection=true
sysfs_acpi_monitor=true

[profiles]
# PPD = TuneD
Expand Down
Loading