backports: remove reading of consumed energy from sysfs
authorHauke Mehrtens <hauke@hauke-m.de>
Thu, 3 Oct 2013 12:29:48 +0000 (14:29 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 21 Oct 2013 21:58:37 +0000 (23:58 +0200)
MSR_RAPL_POWER_UNIT is not available on older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
patches/collateral-evolutions/drm/16-remove-energy-read/i915.patch [new file with mode: 0644]

diff --git a/patches/collateral-evolutions/drm/16-remove-energy-read/i915.patch b/patches/collateral-evolutions/drm/16-remove-energy-read/i915.patch
new file mode 100644 (file)
index 0000000..6511b99
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/drivers/gpu/drm/i915/i915_debugfs.c
++++ b/drivers/gpu/drm/i915/i915_debugfs.c
+@@ -1770,6 +1770,7 @@ static int i915_edp_psr_status(struct se
+       return 0;
+ }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
+ static int i915_energy_uJ(struct seq_file *m, void *data)
+ {
+       struct drm_info_node *node = m->private;
+@@ -1790,6 +1791,7 @@ static int i915_energy_uJ(struct seq_fil
+       seq_printf(m, "%llu", (long long unsigned)power);
+       return 0;
+ }
++#endif
+ static int
+ i915_wedged_get(void *data, u64 *val)
+@@ -2230,7 +2232,9 @@ static struct drm_info_list i915_debugfs
+       {"i915_dpio", i915_dpio_info, 0},
+       {"i915_llc", i915_llc, 0},
+       {"i915_edp_psr_status", i915_edp_psr_status, 0},
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
+       {"i915_energy_uJ", i915_energy_uJ, 0},
++#endif
+ };
+ #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)