]> git.pld-linux.org Git - packages/laptop-mode-tools.git/blob - intel_perf_bias.patch
f46228b357580015b92c8e3e7c92abf8999d45fd
[packages/laptop-mode-tools.git] / intel_perf_bias.patch
1 diff -urN laptop-mode-tools-1.72.2/etc/laptop-mode/conf.d/intel_perf_bias.conf laptop-mode-tools-1.72.2-perf_bias/etc/laptop-mode/conf.d/intel_perf_bias.conf
2 --- laptop-mode-tools-1.72.2/etc/laptop-mode/conf.d/intel_perf_bias.conf        1970-01-01 01:00:00.000000000 +0100
3 +++ laptop-mode-tools-1.72.2-perf_bias/etc/laptop-mode/conf.d/intel_perf_bias.conf      2018-03-21 21:39:56.484459906 +0100
4 @@ -0,0 +1,43 @@
5 +#
6 +# Configuration file for Laptop Mode Tools module intel_perf_bias.
7 +#
8 +# For more information, consult the laptop-mode.conf(8) manual page.
9 +#
10 +
11 +###############################################################################
12 +# Manage Energy vs. Performance Policy via x86 Model Specific Registers
13 +# -------------------------------------------------
14 +#
15 +#__COMMENT Laptop mode tools can automatically adjust your kernel CPU performance
16 +#__COMMENT vs. energy policy.
17 +#__COMMENT
18 +#__COMMENT See x86_energy_perf_policy(8) or cpupower-set(1) for details.
19 +#
20 +###############################################################################
21 +
22 +# Enable debug mode for this module
23 +# Set to 1 if you want to debug this module
24 +DEBUG=0
25 +
26 +#
27 +# Should laptop mode tools control the CPU energy policy settings?
28 +#
29 +# Set to 0 to disable
30 +CONTROL_INTEL_PERF_BIAS="auto"
31 +
32 +# The range of valid numbers is 0-15,
33 +# where 0 is maximum performance and 15 is maximum energy efficiency.
34 +# performance         0
35 +# balance-performance 4
36 +# normal, default     6
37 +# balance-power       8
38 +# power               15
39 +
40 +#On AC, Laptop Mode Tools inactive
41 +NOLM_AC_INTEL_PERF_BIAS=0 # Performance
42 +
43 +#On AC, Laptop Mode Tools active
44 +LM_AC_INTEL_PERF_BIAS=0 # Performance
45 +
46 +#On battery
47 +BATT_INTEL_PERF_BIAS=8 # Balance-power
48 diff -urN laptop-mode-tools-1.72.2/usr/share/laptop-mode-tools/modules/intel_perf_bias laptop-mode-tools-1.72.2-perf_bias/usr/share/laptop-mode-tools/modules/intel_perf_bias
49 --- laptop-mode-tools-1.72.2/usr/share/laptop-mode-tools/modules/intel_perf_bias        1970-01-01 01:00:00.000000000 +0100
50 +++ laptop-mode-tools-1.72.2-perf_bias/usr/share/laptop-mode-tools/modules/intel_perf_bias      2018-03-21 21:55:32.250744460 +0100
51 @@ -0,0 +1,39 @@
52 +#! /bin/sh
53 +#
54 +# Laptop mode tools module that handles Intel's performance policy.
55 +#
56 +
57 +X86_ENERGY_PERF_POLICY=$(which x86_energy_perf_policy 2>/dev/null)
58 +CPUPOWER=$(which cpupower 2>/dev/null)
59 +
60 +# Set perf bias value
61 +# Parameter 1: the value
62 +set_intel_perf_bias_param () {
63 +       local RESULT=1
64 +
65 +       if [ -x "$X86_ENERGY_PERF_POLICY" ]; then
66 +               log "VERBOSE" "Executing: '$X86_ENERGY_PERF_POLICY $1'"
67 +               x86_energy_perf_policy $1
68 +               RESULT=$?
69 +       elif [ -x "$CPUPOWER" ]; then
70 +               log "VERBOSE" "Executing: '$CPUPOWER set -b $1'"
71 +               cpupower set -b $1
72 +               RESULT=$?
73 +       fi
74 +       if [ $RESULT != 0 ]; then
75 +               echo "SETTING CPU PERFORMANCE POLICY FAILED"
76 +       fi
77 +}
78 +
79 +if [ x$CONTROL_INTEL_PERF_BIAS = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_INTEL_PERF_BIAS = xauto ]; then
80 +       if [ $ON_AC -eq 1 ] ; then
81 +               if [ "$ACTIVATE" -eq 1 ] ; then
82 +                       INTEL_PERF_BIAS="$LM_AC_INTEL_PERF_BIAS"
83 +               else
84 +                       INTEL_PERF_BIAS="$NOLM_AC_INTEL_PERF_BIAS"
85 +               fi
86 +       else
87 +               INTEL_PERF_BIAS="$BATT_INTEL_PERF_BIAS"
88 +       fi
89 +       set_intel_perf_bias_param "$INTEL_PERF_BIAS"
90 +fi
This page took 0.028527 seconds and 3 git commands to generate.