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