]> git.pld-linux.org Git - packages/xfce4-cpufreq-plugin.git/commitdiff
- /proc/cpuinfo shows only the basic cpu clock speed since kernel 4.13
authorJan Rękorajski <baggins@pld-linux.org>
Sat, 6 Jan 2018 12:59:17 +0000 (13:59 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Sat, 6 Jan 2018 12:59:17 +0000 (13:59 +0100)
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=51204e0639c49ada02fd823782ad673b6326d748
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f8475cef90082bf0902ddab106112de130d90395

no-freq-in-proc-cpuinfo.patch [new file with mode: 0644]
xfce4-cpufreq-plugin.spec

diff --git a/no-freq-in-proc-cpuinfo.patch b/no-freq-in-proc-cpuinfo.patch
new file mode 100644 (file)
index 0000000..39500e4
--- /dev/null
@@ -0,0 +1,85 @@
+--- xfce4-cpufreq-plugin-1.1.1/panel-plugin/xfce4-cpufreq-linux.c~     2014-12-22 18:50:31.000000000 +0100
++++ xfce4-cpufreq-plugin-1.1.1/panel-plugin/xfce4-cpufreq-linux.c      2018-01-06 13:32:33.608960079 +0100
+@@ -108,14 +108,12 @@
+       }
+       /* read available cpu freqs */
+-      if (cpuFreq->intel_pstate == NULL) {
+               file =
+                       g_strdup_printf ("/sys/devices/system/cpu/cpu%i/"
+                                                        "cpufreq/scaling_available_frequencies",
+                                                        cpu_number);
+               SYSFS_READ_INT_LIST (file, contents, cpu->available_freqs);
+               g_free (file);
+-      }
+       /* read available cpu governors */
+       file = g_strdup_printf (
+@@ -132,14 +132,12 @@
+       g_free (file);
+       /* read current cpu freq */
+-      if (cpuFreq->intel_pstate == NULL) {
+               file =
+                       g_strdup_printf ("/sys/devices/system/cpu/cpu%i/"
+                                                        "cpufreq/scaling_cur_freq",
+                                                        cpu_number);
+               SYSFS_READ_INT (file, contents, cpu->cur_freq);
+               g_free (file);
+-      }
+       /* read current cpu governor */
+       file = g_strdup_printf (
+@@ -173,14 +171,12 @@
+       cpu = g_ptr_array_index (cpuFreq->cpus, cpu_number);
+       /* read current cpu freq */
+-      if (cpuFreq->intel_pstate == NULL) {
+               file =
+                       g_strdup_printf ("/sys/devices/system/cpu/cpu%i/"
+                                                        "cpufreq/scaling_cur_freq",
+                                                        cpu_number);
+               SYSFS_READ_INT (file, contents, cpu->cur_freq);
+               g_free (file);
+-      }
+       /* read current cpu governor */
+       file = g_strdup_printf ("/sys/devices/system/cpu/cpu%i/"
+@@ -398,18 +396,7 @@
+       if (!cpufreq_intel_pstate_params ())
+               return FALSE;
+-      /* Read /proc/cpuinfo, that's where intel pstate stores
+-         the "current frequencies" that are readable by
+-         unprivileged users. */
+-      if (!cpufreq_cpu_read_procfs_cpuinfo ())
+-              return FALSE;
+-
+-      /* now read the remaining cpufreq info for each cpu from sysfs */
+-      for (i = 0; i < cpuFreq->cpus->len; i++) {
+-              cpu = g_ptr_array_index (cpuFreq->cpus, i);
+-              cpufreq_cpu_parse_sysfs_init (i, cpu);
+-      }
+-      return TRUE;
++      return cpufreq_cpu_read_sysfs ();
+ }
+ gboolean
+@@ -417,16 +404,7 @@
+ {
+       gint i;
+-      if (g_file_test ("/sys/devices/system/cpu/intel_pstate", G_FILE_TEST_EXISTS))
+-      {
+-              /* read current cpu frequencies from /proc/cpuinfo */
+-              cpufreq_cpu_read_procfs_cpuinfo ();
+-
+-              /* read current scaling governor from sysfs */
+-              for (i = 0; i < cpuFreq->cpus->len; i++)
+-                      cpufreq_cpu_read_sysfs_current (i);
+-      }
+-      else if (g_file_test ("/sys/devices/system/cpu/cpu0/cpufreq",
++      if (g_file_test ("/sys/devices/system/cpu/cpu0/cpufreq",
+                                                 G_FILE_TEST_EXISTS))
+       {
+               for (i = 0; i < cpuFreq->cpus->len; i++)
index 1f29871604530d1b47d429a3a185e1d724b76a9f..183d678e43d13843efc275c08ac8ae5a511f082a 100644 (file)
@@ -2,11 +2,12 @@ Summary:      A cpufreq plugin for the Xfce panel
 Summary(pl.UTF-8):     Wtyczka cpufreq dla panelu Xfce
 Name:          xfce4-cpufreq-plugin
 Version:       1.1.1
-Release:       1
+Release:       1.2
 License:       GPL v2
 Group:         X11/Applications
 Source0:       http://archive.xfce.org/src/panel-plugins/xfce4-cpufreq-plugin/1.1/%{name}-%{version}.tar.bz2
 # Source0-md5: cc3447ee6663f2946fce86308ba3566b
+Patch0:                no-freq-in-proc-cpuinfo.patch
 URL:           http://goodies.xfce.org/projects/panel-plugins/xfce4-cpufreq-plugin
 BuildRequires: autoconf
 BuildRequires: automake
@@ -34,6 +35,7 @@ procesora jako odpowiednio pokolorowany pasek.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %{__libtoolize}
This page took 0.094446 seconds and 4 git commands to generate.