All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 0/8] Add hwmon energy support for dgfx
@ 2022-10-13 15:13 Ashutosh Dixit
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_hwmon: Introduce library igt_hwmon Ashutosh Dixit
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Ashutosh Dixit @ 2022-10-13 15:13 UTC (permalink / raw)
  To: igt-dev

Introduce igt_power library that reads energy from hwmon & rapl
interfaces. Replace igt_rapl with igt_power.

Modify the existing tests that use igt_rapl to igt_power.

v2: Re-order patches to fix compilation
v3: Changes not documented but all patches R-b'd
v4: Identical to v3, sending again in order to "Test-with" kernel
    hwmon series

Riana Tauro (8):
  lib/igt_hwmon: Introduce library igt_hwmon
  lib/igt_power: Rename lib igt_rapl with igt_power
  lib/igt_power: Add hwmon interface to igt_power
  i915/i915_pm_rc6_residency: Add energy support for dgfx
  i915/gem_exec_schedule: Add energy support for dgfx
  i915/gem_exec_whisper: Add energy support for dgfx
  lib/igt_power: clean-up igt_power library
  HAX: run i915_pm_rc6_residency tests in BAT

 lib/igt_hwmon.c                       |  73 +++++++++
 lib/igt_hwmon.h                       |  12 ++
 lib/igt_power.c                       | 211 ++++++++++++++++++++++++++
 lib/{igt_rapl.h => igt_power.h}       |  78 +++-------
 lib/igt_rapl.c                        |  69 ---------
 lib/meson.build                       |   3 +-
 tests/i915/gem_exec_fair.c            |   1 -
 tests/i915/gem_exec_schedule.c        |  51 +++----
 tests/i915/gem_exec_whisper.c         |  16 +-
 tests/i915/i915_pm_rc6_residency.c    |  65 ++++----
 tests/intel-ci/fast-feedback.testlist |   2 +
 11 files changed, 392 insertions(+), 189 deletions(-)
 create mode 100644 lib/igt_hwmon.c
 create mode 100644 lib/igt_hwmon.h
 create mode 100644 lib/igt_power.c
 rename lib/{igt_rapl.h => igt_power.h} (51%)
 delete mode 100644 lib/igt_rapl.c

-- 
2.38.0

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [igt-dev] [PATCH i-g-t 1/8] lib/igt_hwmon: Introduce library igt_hwmon
  2022-10-13 15:13 [igt-dev] [PATCH i-g-t 0/8] Add hwmon energy support for dgfx Ashutosh Dixit
@ 2022-10-13 15:13 ` Ashutosh Dixit
  2022-10-14  7:23   ` Petri Latvala
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 2/8] lib/igt_power: Rename lib igt_rapl with igt_power Ashutosh Dixit
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 12+ messages in thread
From: Ashutosh Dixit @ 2022-10-13 15:13 UTC (permalink / raw)
  To: igt-dev

From: Riana Tauro <riana.tauro@intel.com>

igt_hwmon exposes methods to open hwmon directories identified by name

Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Riana Tauro <riana.tauro@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 lib/igt_hwmon.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++
 lib/igt_hwmon.h | 12 ++++++++
 lib/meson.build |  1 +
 3 files changed, 86 insertions(+)
 create mode 100644 lib/igt_hwmon.c
 create mode 100644 lib/igt_hwmon.h

diff --git a/lib/igt_hwmon.c b/lib/igt_hwmon.c
new file mode 100644
index 0000000000..1e4dab1bb2
--- /dev/null
+++ b/lib/igt_hwmon.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright © 2022 Intel Corporation
+ */
+#include <sys/stat.h>
+#include <sys/sysmacros.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <unistd.h>
+
+#include "drmtest.h"
+#include "igt_core.h"
+#include "igt_hwmon.h"
+#include "igt_sysfs.h"
+
+static char *igt_hwmon_path(int device, char *path, const char *name)
+{
+	char buf[80];
+	int path_offset;
+	struct dirent *entry;
+	struct stat st;
+	DIR *dir;
+
+	if (igt_debug_on(device < 0))
+		return NULL;
+
+	if (igt_debug_on(fstat(device, &st)) || igt_debug_on(!S_ISCHR(st.st_mode)))
+		return NULL;
+
+	path_offset = snprintf(path, PATH_MAX, "/sys/dev/char/%d:%d/device/hwmon",
+			       major(st.st_rdev), minor(st.st_rdev));
+
+	dir = opendir(path);
+	if (!dir)
+		return NULL;
+
+	while ((entry = readdir(dir))) {
+		if (entry->d_name[0] == '.')
+			continue;
+
+		snprintf(path + path_offset, PATH_MAX - path_offset, "/%s/name", entry->d_name);
+		igt_sysfs_scanf(dirfd(dir), path, "%s", buf);
+
+		if (strncmp(buf, name, strlen(name)) == 0) {
+			snprintf(path + path_offset, PATH_MAX - path_offset, "/%s", entry->d_name);
+			closedir(dir);
+			return path;
+		}
+	}
+
+	closedir(dir);
+	return NULL;
+}
+
+/**
+ * igt_hwmon_open:
+ * @device: fd of the device
+ *
+ * Opens the hwmon directory corresponding to device
+ *
+ * Returns:
+ * The directory fd, or -1 on failure.
+ */
+int igt_hwmon_open(int device)
+{
+	char path[PATH_MAX];
+
+	if (!is_i915_device(device) || !igt_hwmon_path(device, path, "i915"))
+		return -1;
+
+	return open(path, O_RDONLY);
+}
+
diff --git a/lib/igt_hwmon.h b/lib/igt_hwmon.h
new file mode 100644
index 0000000000..aa418fdcb0
--- /dev/null
+++ b/lib/igt_hwmon.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright © 2022 Intel Corporation
+ */
+
+#ifndef IGT_HWMON_H
+#define IGT_HWMON_H
+
+#include <stdbool.h>
+
+int igt_hwmon_open(int device);
+
+#endif /* IGT_HWMON_H */
diff --git a/lib/meson.build b/lib/meson.build
index c665bd2507..b1b8e80cbf 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -24,6 +24,7 @@ lib_sources = [
 	'igt_aux.c',
 	'igt_gt.c',
 	'igt_halffloat.c',
+	'igt_hwmon.c',
 	'igt_io.c',
 	'igt_matrix.c',
 	'igt_os.c',
-- 
2.38.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [igt-dev] [PATCH i-g-t 2/8] lib/igt_power: Rename lib igt_rapl with igt_power
  2022-10-13 15:13 [igt-dev] [PATCH i-g-t 0/8] Add hwmon energy support for dgfx Ashutosh Dixit
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_hwmon: Introduce library igt_hwmon Ashutosh Dixit
@ 2022-10-13 15:13 ` Ashutosh Dixit
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 3/8] lib/igt_power: Add hwmon interface to igt_power Ashutosh Dixit
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Ashutosh Dixit @ 2022-10-13 15:13 UTC (permalink / raw)
  To: igt-dev

From: Riana Tauro <riana.tauro@intel.com>

Rename igt_rapl library to igt_power.
No functional changes

Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Riana Tauro <riana.tauro@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 lib/{igt_rapl.c => igt_power.c}    | 2 +-
 lib/{igt_rapl.h => igt_power.h}    | 6 +++---
 lib/meson.build                    | 2 +-
 tests/i915/gem_exec_fair.c         | 1 -
 tests/i915/gem_exec_schedule.c     | 2 +-
 tests/i915/gem_exec_whisper.c      | 2 +-
 tests/i915/i915_pm_rc6_residency.c | 2 +-
 7 files changed, 8 insertions(+), 9 deletions(-)
 rename lib/{igt_rapl.c => igt_power.c} (98%)
 rename lib/{igt_rapl.h => igt_power.h} (97%)

diff --git a/lib/igt_rapl.c b/lib/igt_power.c
similarity index 98%
rename from lib/igt_rapl.c
rename to lib/igt_power.c
index 03e4922602..814ad5561b 100644
--- a/lib/igt_rapl.c
+++ b/lib/igt_power.c
@@ -7,7 +7,7 @@
 #include <inttypes.h>
 
 #include "igt_perf.h"
-#include "igt_rapl.h"
+#include "igt_power.h"
 #include "igt_sysfs.h"
 
 static int rapl_parse(struct rapl *r, const char *str)
diff --git a/lib/igt_rapl.h b/lib/igt_power.h
similarity index 97%
rename from lib/igt_rapl.h
rename to lib/igt_power.h
index 13f4f88a73..11ddcdeee8 100644
--- a/lib/igt_rapl.h
+++ b/lib/igt_power.h
@@ -22,8 +22,8 @@
  *
  */
 
-#ifndef IGT_RAPL_H
-#define IGT_RAPL_H
+#ifndef IGT_POWER_H
+#define IGT_POWER_H
 
 #include <stdbool.h>
 #include <stdint.h>
@@ -98,4 +98,4 @@ static inline double power_W(const struct rapl *r,
 	return power_J(r, p0, p1) / power_s(r, p0, p1);
 }
 
-#endif /* IGT_RAPL_H */
+#endif /* IGT_POWER_H */
diff --git a/lib/meson.build b/lib/meson.build
index b1b8e80cbf..8d6c8a244a 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -30,9 +30,9 @@ lib_sources = [
 	'igt_os.c',
 	'igt_params.c',
 	'igt_perf.c',
+	'igt_power.c',
 	'igt_primes.c',
 	'igt_rand.c',
-	'igt_rapl.c',
 	'igt_stats.c',
 	'igt_syncobj.c',
 	'igt_sysfs.c',
diff --git a/tests/i915/gem_exec_fair.c b/tests/i915/gem_exec_fair.c
index 89921697f7..93a138ba47 100644
--- a/tests/i915/gem_exec_fair.c
+++ b/tests/i915/gem_exec_fair.c
@@ -21,7 +21,6 @@
 #include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_rand.h"
-#include "igt_rapl.h"
 #include "igt_sysfs.h"
 #include "igt_syncobj.h"
 #include "igt_vgem.h"
diff --git a/tests/i915/gem_exec_schedule.c b/tests/i915/gem_exec_schedule.c
index 5ddf39bfe2..4693894f82 100644
--- a/tests/i915/gem_exec_schedule.c
+++ b/tests/i915/gem_exec_schedule.c
@@ -38,8 +38,8 @@
 #include "i915/gem_create.h"
 #include "i915/gem_vm.h"
 #include "igt.h"
+#include "igt_power.h"
 #include "igt_rand.h"
-#include "igt_rapl.h"
 #include "igt_sysfs.h"
 #include "igt_vgem.h"
 #include "intel_ctx.h"
diff --git a/tests/i915/gem_exec_whisper.c b/tests/i915/gem_exec_whisper.c
index c93134db4f..c763cc8e8d 100644
--- a/tests/i915/gem_exec_whisper.c
+++ b/tests/i915/gem_exec_whisper.c
@@ -32,8 +32,8 @@
 #include "i915/gem_vm.h"
 #include "igt.h"
 #include "igt_debugfs.h"
-#include "igt_rapl.h"
 #include "igt_gt.h"
+#include "igt_power.h"
 #include "igt_rand.h"
 #include "igt_sysfs.h"
 #include "intel_ctx.h"
diff --git a/tests/i915/i915_pm_rc6_residency.c b/tests/i915/i915_pm_rc6_residency.c
index cf7a92b988..670461c867 100644
--- a/tests/i915/i915_pm_rc6_residency.c
+++ b/tests/i915/i915_pm_rc6_residency.c
@@ -37,7 +37,7 @@
 #include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_perf.h"
-#include "igt_rapl.h"
+#include "igt_power.h"
 #include "igt_sysfs.h"
 #include "sw_sync.h"
 
-- 
2.38.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [igt-dev] [PATCH i-g-t 3/8] lib/igt_power: Add hwmon interface to igt_power
  2022-10-13 15:13 [igt-dev] [PATCH i-g-t 0/8] Add hwmon energy support for dgfx Ashutosh Dixit
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_hwmon: Introduce library igt_hwmon Ashutosh Dixit
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 2/8] lib/igt_power: Rename lib igt_rapl with igt_power Ashutosh Dixit
@ 2022-10-13 15:13 ` Ashutosh Dixit
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 4/8] i915/i915_pm_rc6_residency: Add energy support for dgfx Ashutosh Dixit
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Ashutosh Dixit @ 2022-10-13 15:13 UTC (permalink / raw)
  To: igt-dev

From: Riana Tauro <riana.tauro@intel.com>

Modify igt_power to expose functions to read energy, power
using hwmon and rapl interface

Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Riana Tauro <riana.tauro@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 lib/igt_power.c | 131 ++++++++++++++++++++++++++++++++++++++++++++++++
 lib/igt_power.h |  22 ++++++++
 2 files changed, 153 insertions(+)

diff --git a/lib/igt_power.c b/lib/igt_power.c
index 814ad5561b..3f3633eb96 100644
--- a/lib/igt_power.c
+++ b/lib/igt_power.c
@@ -6,10 +6,14 @@
 #include <unistd.h>
 #include <inttypes.h>
 
+#include "igt.h"
+#include "igt_hwmon.h"
 #include "igt_perf.h"
 #include "igt_power.h"
 #include "igt_sysfs.h"
 
+static const char *rapl_domains[] = { "cpu", "gpu", "pkg", "ram" };
+
 static int rapl_parse(struct rapl *r, const char *str)
 {
 	locale_t locale, oldlocale;
@@ -67,3 +71,130 @@ err:
 	errno = 0;
 	return r->fd;
 }
+
+/**
+ * igt_power_open:
+ * @fd : device fd
+ * @igt_power : power struct
+ * @domain: rapl domain
+ *
+ * opens the hwmon/rapl fd based on domain
+ * hwmon fd - domain gpu -dgfx
+ * rapl fd - all domains - igfx
+ *
+ * Returns
+ * 0 on success, errno otherwise
+ */
+int igt_power_open(int fd, struct igt_power *p, const char *domain)
+{
+	int i;
+
+	p->hwmon_fd = -1;
+	p->rapl.fd = -1;
+
+	if (gem_has_lmem(fd)) {
+		if (strncmp(domain, "gpu", strlen("gpu")) == 0) {
+			p->hwmon_fd = igt_hwmon_open(fd);
+			if (p->hwmon_fd >= 0)
+				return 0;
+		}
+	} else {
+		for (i = 0; i < ARRAY_SIZE(rapl_domains); i++)
+			if (strncmp(domain, rapl_domains[i], strlen(rapl_domains[i])) == 0)
+				return rapl_open(&p->rapl, domain);
+	}
+
+	return -EINVAL;
+}
+
+/**
+ * igt_power_get_energy:
+ * @igt_power : power struct
+ * @power_sample: sample of energy and time
+ *
+ * Reads energy from hwmon if energy1_input file is present, else read
+ * from rapl interface
+ *
+ */
+void igt_power_get_energy(struct igt_power *power, struct power_sample *s)
+{
+	struct timespec ts;
+
+	s->energy = 0;
+	igt_assert(!clock_gettime(CLOCK_MONOTONIC, &ts));
+	s->time =  ts.tv_sec * NSEC_PER_SEC + ts.tv_nsec;
+
+	if (power->hwmon_fd >= 0) {
+		if (igt_sysfs_has_attr(power->hwmon_fd, "energy1_input"))
+			s->energy = igt_sysfs_get_u64(power->hwmon_fd, "energy1_input");
+	} else if (power->rapl.fd >= 0) {
+		rapl_read(&power->rapl, s);
+	}
+}
+
+/**
+ * igt_power_get_mJ:
+ * @igt_power : power struct
+ * @power_sample: sample of energy and time
+ *
+ * Calculates energy difference between two power samples
+ *
+ * Returns
+ * energy in mJ from hwmon/rapl
+ */
+double igt_power_get_mJ(const struct igt_power *power,
+			const struct power_sample *p0, const struct power_sample *p1)
+{
+	if (power->hwmon_fd >= 0)
+		return (p1->energy - p0->energy) * 1e-3;
+	else if (power->rapl.fd >= 0)
+		return ((p1->energy - p0->energy) *  power->rapl.scale) * 1e3;
+
+	return 0;
+}
+
+/**
+ * igt_power_get_mW:
+ * @igt_power : power struct
+ * @power_sample: sample of energy and time
+ *
+ * Calculates power
+ *
+ * Returns
+ * power in milliWatts
+ */
+double igt_power_get_mW(const struct igt_power *power,
+			const struct power_sample *p0, const struct power_sample *p1)
+{
+	return igt_power_get_mJ(power, p0, p1) / igt_power_get_s(p0, p1);
+}
+
+/**
+ * igt_power_get_s:
+ * @power_sample: sample of energy and time
+ *
+ * Returns
+ * time differnce in seconds
+ */
+double igt_power_get_s(const struct power_sample *p0,
+		       const struct power_sample *p1)
+{
+	return (p1->time - p0->time) * 1e-9;
+}
+
+/**
+ * igt_power_close:
+ * @igt_power : power struct
+ *
+ * closes hwmon/rapl fd
+ *
+ */
+void igt_power_close(struct igt_power *power)
+{
+	if (power->hwmon_fd >= 0) {
+		close(power->hwmon_fd);
+		power->hwmon_fd = -1;
+	} else if (power->rapl.fd >= 0) {
+		rapl_close(&power->rapl);
+	}
+}
diff --git a/lib/igt_power.h b/lib/igt_power.h
index 11ddcdeee8..0984c2df6b 100644
--- a/lib/igt_power.h
+++ b/lib/igt_power.h
@@ -39,7 +39,14 @@ struct power_sample {
 	uint64_t time;
 };
 
+struct igt_power {
+	struct rapl rapl;
+	int hwmon_fd;
+};
+
 int rapl_open(struct rapl *r, const char *domain);
+int igt_power_open(int i915, struct igt_power *p, const char *domain);
+void igt_power_close(struct igt_power *p);
 
 static inline int cpu_power_open(struct rapl *r)
 {
@@ -77,6 +84,11 @@ static inline void rapl_close(struct rapl *r)
 	r->fd = -1;
 }
 
+static inline bool igt_power_valid(struct igt_power *p)
+{
+	return (p->rapl.fd >= 0) || (p->hwmon_fd >= 0);
+}
+
 static inline double power_J(const struct rapl *r,
 			     const struct power_sample *p0,
 			     const struct power_sample *p1)
@@ -98,4 +110,14 @@ static inline double power_W(const struct rapl *r,
 	return power_J(r, p0, p1) / power_s(r, p0, p1);
 }
 
+void igt_power_get_energy(struct igt_power *p, struct power_sample *s);
+
+double igt_power_get_mJ(const struct igt_power *power,
+			const struct power_sample *p0,
+			const struct power_sample *p1);
+double igt_power_get_mW(const struct igt_power *power,
+			const struct power_sample *p0,
+			const struct power_sample *p1);
+double igt_power_get_s(const struct power_sample *p0,
+		       const struct power_sample *p1);
 #endif /* IGT_POWER_H */
-- 
2.38.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [igt-dev] [PATCH i-g-t 4/8] i915/i915_pm_rc6_residency: Add energy support for dgfx
  2022-10-13 15:13 [igt-dev] [PATCH i-g-t 0/8] Add hwmon energy support for dgfx Ashutosh Dixit
                   ` (2 preceding siblings ...)
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 3/8] lib/igt_power: Add hwmon interface to igt_power Ashutosh Dixit
@ 2022-10-13 15:13 ` Ashutosh Dixit
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 5/8] i915/gem_exec_schedule: " Ashutosh Dixit
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Ashutosh Dixit @ 2022-10-13 15:13 UTC (permalink / raw)
  To: igt-dev

From: Riana Tauro <riana.tauro@intel.com>

igt_power library reads energy using hwmon interface for dgfx and
rapl otherwise. Modify rc6-idle and rc6-fence to use igt_power interface.

Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Riana Tauro <riana.tauro@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 tests/i915/i915_pm_rc6_residency.c | 63 +++++++++++++++++-------------
 1 file changed, 36 insertions(+), 27 deletions(-)

diff --git a/tests/i915/i915_pm_rc6_residency.c b/tests/i915/i915_pm_rc6_residency.c
index 670461c867..3554f5d774 100644
--- a/tests/i915/i915_pm_rc6_residency.c
+++ b/tests/i915/i915_pm_rc6_residency.c
@@ -378,26 +378,29 @@ static void rc6_idle(int i915, uint32_t ctx_id, uint64_t flags)
 	unsigned long slept, cycles;
 	unsigned long *done;
 	uint64_t rc6, ts[2];
-	struct rapl rapl;
+	struct igt_power gpu;
 	int fd;
 
 	fd = open_pmu(i915, I915_PMU_RC6_RESIDENCY);
 	igt_drop_caches_set(i915, DROP_IDLE);
 	igt_require(__pmu_wait_for_rc6(fd));
-	gpu_power_open(&rapl);
+	igt_power_open(i915, &gpu, "gpu");
 
 	/* While idle check full RC6. */
-	rapl_read(&rapl, &sample[0]);
+	igt_power_get_energy(&gpu, &sample[0]);
 	rc6 = -__pmu_read_single(fd, &ts[0]);
 	slept = measured_usleep(duration_ns / 1000);
 	rc6 += __pmu_read_single(fd, &ts[1]);
 	igt_debug("slept=%lu perf=%"PRIu64", rc6=%"PRIu64"\n",
 		  slept, ts[1] - ts[0], rc6);
-	if (rapl_read(&rapl, &sample[1]))  {
-		double idle = power_J(&rapl, &sample[0], &sample[1]);
+	igt_power_get_energy(&gpu, &sample[1]);
+	if (sample[1].energy) {
+		double idle = igt_power_get_mJ(&gpu, &sample[0], &sample[1]);
+
 		igt_log(IGT_LOG_DOMAIN,
-                        idle > 1e-3 && gen > 6 ? IGT_LOG_WARN : IGT_LOG_INFO,
-                        "Total energy used while idle: %.1fmJ\n", idle * 1e3);
+			!gem_has_lmem(i915) && idle > 1e-3 && gen > 6 ? IGT_LOG_WARN : IGT_LOG_INFO,
+			"Total energy used while idle: %.1fmJ (%.1fmW)\n",
+			idle, (idle * 1e9) / slept);
 	}
 	assert_within_epsilon(rc6, ts[1] - ts[0], 5);
 
@@ -408,7 +411,7 @@ static void rc6_idle(int i915, uint32_t ctx_id, uint64_t flags)
 		igt_fork(child, 1) /* Setup up a very light load */
 			bg_load(i915, ctx_id, flags, phases[p].flags, done);
 
-		rapl_read(&rapl, &sample[0]);
+		igt_power_get_energy(&gpu, &sample[0]);
 		cycles = -READ_ONCE(done[1]);
 		rc6 = -__pmu_read_single(fd, &ts[0]);
 		slept = measured_usleep(duration_ns / 1000);
@@ -416,14 +419,15 @@ static void rc6_idle(int i915, uint32_t ctx_id, uint64_t flags)
 		cycles += READ_ONCE(done[1]);
 		igt_debug("%s: slept=%lu perf=%"PRIu64", cycles=%lu, rc6=%"PRIu64"\n",
 			  phases[p].name, slept, ts[1] - ts[0], cycles, rc6);
-		if (rapl_read(&rapl, &sample[1]))  {
-			phases[p].power = power_J(&rapl, &sample[0], &sample[1]);
+		igt_power_get_energy(&gpu, &sample[1]);
+		if (sample[1].energy) {
+			phases[p].power = igt_power_get_mJ(&gpu, &sample[0], &sample[1]);
 			igt_info("Total energy used for %s: %.1fmJ (%.1fmW)\n",
 				 phases[p].name,
-				 phases[p].power * 1e3,
-				 phases[p].power * 1e12 / slept);
+				 phases[p].power,
+				 phases[p].power * 1e9 / slept);
 			phases[p].power /= slept; /* normalize */
-			phases[p].power *= 1e12; /* => mW */
+			phases[p].power *= 1e9; /* => mW */
 		}
 
 		*done = 1;
@@ -440,7 +444,7 @@ static void rc6_idle(int i915, uint32_t ctx_id, uint64_t flags)
 	munmap(done, 4096);
 	close(fd);
 
-	rapl_close(&rapl);
+	igt_power_close(&gpu);
 
 	if (phases[1].power - phases[0].power > 10) {
 		igt_assert_f(2 * phases[2].power - phases[0].power <= phases[1].power,
@@ -460,7 +464,7 @@ static void rc6_fence(int i915, const intel_ctx_t *ctx)
 	struct power_sample sample[2];
 	unsigned long slept;
 	uint64_t rc6, ts[2], ahnd;
-	struct rapl rapl;
+	struct igt_power gpu;
 	int fd;
 
 	igt_require_sw_sync();
@@ -468,20 +472,23 @@ static void rc6_fence(int i915, const intel_ctx_t *ctx)
 	fd = open_pmu(i915, I915_PMU_RC6_RESIDENCY);
 	igt_drop_caches_set(i915, DROP_IDLE);
 	igt_require(__pmu_wait_for_rc6(fd));
-	gpu_power_open(&rapl);
+	igt_power_open(i915, &gpu, "gpu");
 
 	/* While idle check full RC6. */
-	rapl_read(&rapl, &sample[0]);
+	igt_power_get_energy(&gpu, &sample[0]);
 	rc6 = -__pmu_read_single(fd, &ts[0]);
 	slept = measured_usleep(duration_ns / 1000);
 	rc6 += __pmu_read_single(fd, &ts[1]);
 	igt_debug("slept=%lu perf=%"PRIu64", rc6=%"PRIu64"\n",
 		  slept, ts[1] - ts[0], rc6);
-	if (rapl_read(&rapl, &sample[1]))  {
-		double idle = power_J(&rapl, &sample[0], &sample[1]);
+
+	igt_power_get_energy(&gpu, &sample[1]);
+	if (sample[1].energy) {
+		double idle = igt_power_get_mJ(&gpu, &sample[0], &sample[1]);
 		igt_log(IGT_LOG_DOMAIN,
-			idle > 1e-3 && gen > 6 ? IGT_LOG_WARN : IGT_LOG_INFO,
-			"Total energy used while idle: %.1fmJ\n", idle * 1e3);
+			!gem_has_lmem(i915) && idle > 1e-3 && gen > 6 ? IGT_LOG_WARN : IGT_LOG_INFO,
+			"Total energy used while idle: %.1fmJ (%.1fmW)\n",
+			idle, (idle * 1e9) / slept);
 	}
 	assert_within_epsilon(rc6, ts[1] - ts[0], 5);
 
@@ -502,18 +509,20 @@ static void rc6_fence(int i915, const intel_ctx_t *ctx)
 				    .flags = IGT_SPIN_FENCE_IN);
 		close(fence);
 
-		rapl_read(&rapl, &sample[0]);
+		igt_power_get_energy(&gpu, &sample[0]);
 		rc6 = -__pmu_read_single(fd, &ts[0]);
 		slept = measured_usleep(duration_ns / 1000);
 		rc6 += __pmu_read_single(fd, &ts[1]);
 		igt_debug("%s: slept=%lu perf=%"PRIu64", rc6=%"PRIu64"\n",
 			  e->name, slept, ts[1] - ts[0], rc6);
-		if (rapl_read(&rapl, &sample[1]))  {
-			double power = power_J(&rapl, &sample[0], &sample[1]);
+
+		igt_power_get_energy(&gpu, &sample[1]);
+		if (sample[1].energy) {
+			double power = igt_power_get_mJ(&gpu, &sample[0], &sample[1]);
 			igt_info("Total energy used for %s: %.1fmJ (%.1fmW)\n",
 				 e->name,
-				 power * 1e3,
-				 power * 1e12 / slept);
+				 power,
+				 power * 1e9 / slept);
 		}
 
 		igt_assert(gem_bo_busy(i915, spin->handle));
@@ -526,7 +535,7 @@ static void rc6_fence(int i915, const intel_ctx_t *ctx)
 	}
 	put_ahnd(ahnd);
 
-	rapl_close(&rapl);
+	igt_power_close(&gpu);
 	close(fd);
 }
 
-- 
2.38.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [igt-dev] [PATCH i-g-t 5/8] i915/gem_exec_schedule: Add energy support for dgfx
  2022-10-13 15:13 [igt-dev] [PATCH i-g-t 0/8] Add hwmon energy support for dgfx Ashutosh Dixit
                   ` (3 preceding siblings ...)
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 4/8] i915/i915_pm_rc6_residency: Add energy support for dgfx Ashutosh Dixit
@ 2022-10-13 15:13 ` Ashutosh Dixit
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 6/8] i915/gem_exec_whisper: " Ashutosh Dixit
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Ashutosh Dixit @ 2022-10-13 15:13 UTC (permalink / raw)
  To: igt-dev

From: Riana Tauro <riana.tauro@intel.com>

igt_power library reads energy using hwmon interface for dgfx and
rapl otherwise. Modify semaphore-power test to use igt_power interface.

Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Riana Tauro <riana.tauro@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 tests/i915/gem_exec_schedule.c | 49 +++++++++++++++++-----------------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/tests/i915/gem_exec_schedule.c b/tests/i915/gem_exec_schedule.c
index 4693894f82..58b118c79e 100644
--- a/tests/i915/gem_exec_schedule.c
+++ b/tests/i915/gem_exec_schedule.c
@@ -2844,11 +2844,11 @@ static void test_pi_iova(int i915, const intel_ctx_cfg_t *cfg,
 static void measure_semaphore_power(int i915, const intel_ctx_t *ctx)
 {
 	const struct intel_execution_engine2 *signaler, *e;
-	struct rapl gpu, pkg;
+	struct igt_power gpu, pkg;
 	uint64_t ahnd = get_simple_l2h_ahnd(i915, ctx->id);
 
-	igt_require(gpu_power_open(&gpu) == 0);
-	pkg_power_open(&pkg);
+	igt_require(igt_power_open(i915, &gpu, "gpu") == 0);
+	igt_power_open(i915, &pkg, "pkg");
 
 	for_each_ctx_engine(i915, ctx, signaler) {
 		struct {
@@ -2870,11 +2870,11 @@ static void measure_semaphore_power(int i915, const intel_ctx_t *ctx)
 		gem_wait(i915, spin->handle, &jiffie); /* waitboost */
 		igt_spin_busywait_until_started(spin);
 
-		rapl_read(&pkg, &s_spin[0].pkg);
-		rapl_read(&gpu, &s_spin[0].gpu);
+		igt_power_get_energy(&pkg, &s_spin[0].pkg);
+		igt_power_get_energy(&gpu, &s_spin[0].gpu);
 		usleep(100*1000);
-		rapl_read(&gpu, &s_spin[1].gpu);
-		rapl_read(&pkg, &s_spin[1].pkg);
+		igt_power_get_energy(&gpu, &s_spin[1].gpu);
+		igt_power_get_energy(&pkg, &s_spin[1].pkg);
 
 		/* Add a waiter to each engine */
 		i = 0;
@@ -2905,34 +2905,33 @@ static void measure_semaphore_power(int i915, const intel_ctx_t *ctx)
 				igt_spin_free(i915, sema[i]);
 		usleep(10); /* just give the tasklets a chance to run */
 
-		rapl_read(&pkg, &s_sema[0].pkg);
-		rapl_read(&gpu, &s_sema[0].gpu);
+		igt_power_get_energy(&pkg, &s_sema[0].pkg);
+		igt_power_get_energy(&gpu, &s_sema[0].gpu);
 		usleep(100*1000);
-		rapl_read(&gpu, &s_sema[1].gpu);
-		rapl_read(&pkg, &s_sema[1].pkg);
+		igt_power_get_energy(&gpu, &s_sema[1].gpu);
+		igt_power_get_energy(&pkg, &s_sema[1].pkg);
 
 		igt_spin_free(i915, spin);
 
-		baseline = power_W(&gpu, &s_spin[0].gpu, &s_spin[1].gpu);
-		total = power_W(&gpu, &s_sema[0].gpu, &s_sema[1].gpu);
+		baseline = igt_power_get_mW(&gpu, &s_spin[0].gpu, &s_spin[1].gpu);
+		total = igt_power_get_mW(&gpu, &s_sema[0].gpu, &s_sema[1].gpu);
 		igt_info("%s: %.1fmW + %.1fmW (total %1.fmW)\n",
 			 signaler->name,
-			 1e3 * baseline,
-			 1e3 * (total - baseline),
-			 1e3 * total);
+			 baseline,
+			 (total - baseline),
+			 total);
 
-		if (rapl_valid(&pkg)) {
-			baseline = power_W(&pkg, &s_spin[0].pkg, &s_spin[1].pkg);
-			total = power_W(&pkg, &s_sema[0].pkg, &s_sema[1].pkg);
+		if (igt_power_valid(&pkg)) {
+			baseline = igt_power_get_mW(&pkg, &s_spin[0].pkg, &s_spin[1].pkg);
+			total = igt_power_get_mW(&pkg, &s_sema[0].pkg, &s_sema[1].pkg);
 			igt_info("pkg: %.1fmW + %.1fmW (total %1.fmW)\n",
-				 1e3 * baseline,
-				 1e3 * (total - baseline),
-				 1e3 * total);
+				 baseline,
+				 (total - baseline),
+				 total);
 		}
 	}
-
-	rapl_close(&gpu);
-	rapl_close(&pkg);
+	igt_power_close(&gpu);
+	igt_power_close(&pkg);
 	put_ahnd(ahnd);
 }
 
-- 
2.38.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [igt-dev] [PATCH i-g-t 6/8] i915/gem_exec_whisper: Add energy support for dgfx
  2022-10-13 15:13 [igt-dev] [PATCH i-g-t 0/8] Add hwmon energy support for dgfx Ashutosh Dixit
                   ` (4 preceding siblings ...)
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 5/8] i915/gem_exec_schedule: " Ashutosh Dixit
@ 2022-10-13 15:13 ` Ashutosh Dixit
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 7/8] lib/igt_power: clean-up igt_power library Ashutosh Dixit
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Ashutosh Dixit @ 2022-10-13 15:13 UTC (permalink / raw)
  To: igt-dev

From: Riana Tauro <riana.tauro@intel.com>

igt_power library reads energy using hwmon interface for dgfx and
rapl otherwise. Modify gem_exec_whisper test to use igt_power interface.

Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Riana Tauro <riana.tauro@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 tests/i915/gem_exec_whisper.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tests/i915/gem_exec_whisper.c b/tests/i915/gem_exec_whisper.c
index c763cc8e8d..c3fc5ba804 100644
--- a/tests/i915/gem_exec_whisper.c
+++ b/tests/i915/gem_exec_whisper.c
@@ -210,7 +210,7 @@ static void whisper(int fd, const intel_ctx_t *ctx,
 	unsigned int reloc_interruptions = 0;
 	unsigned int eb_migrations = 0;
 	struct power_sample sample[2];
-	struct rapl rapl;
+	struct igt_power gpu;
 	uint64_t old_offset;
 	int i, n, loc;
 	int debugfs;
@@ -223,7 +223,7 @@ static void whisper(int fd, const intel_ctx_t *ctx,
 	}
 
 	debugfs = igt_debugfs_dir(fd);
-	gpu_power_open(&rapl);
+	igt_power_open(fd, &gpu, "gpu");
 
 	nengine = 0;
 	if (engine == ALL_ENGINES) {
@@ -258,7 +258,7 @@ static void whisper(int fd, const intel_ctx_t *ctx,
 		nchild *= nengine;
 
 	intel_detect_and_clear_missed_interrupts(fd);
-	rapl_read(&rapl, &sample[0]);
+	igt_power_get_energy(&gpu, &sample[0]);
 	igt_fork(child, nchild) {
 		unsigned int pass;
 
@@ -559,12 +559,14 @@ static void whisper(int fd, const intel_ctx_t *ctx,
 		fini_hang(&hang);
 	else
 		igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
-	if (rapl_read(&rapl, &sample[1]))  {
+
+	igt_power_get_energy(&gpu, &sample[1]);
+	if (sample[1].energy) {
 		igt_info("Total energy used: %.1fmJ\n",
-			 power_J(&rapl, &sample[0], &sample[1]) * 1e3);
+			 igt_power_get_mJ(&gpu, &sample[0], &sample[1]));
 	}
 
-	rapl_close(&rapl);
+	igt_power_close(&gpu);
 	close(debugfs);
 }
 
-- 
2.38.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [igt-dev] [PATCH i-g-t 7/8] lib/igt_power: clean-up igt_power library
  2022-10-13 15:13 [igt-dev] [PATCH i-g-t 0/8] Add hwmon energy support for dgfx Ashutosh Dixit
                   ` (5 preceding siblings ...)
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 6/8] i915/gem_exec_whisper: " Ashutosh Dixit
@ 2022-10-13 15:13 ` Ashutosh Dixit
  2022-10-13 15:14 ` [igt-dev] [PATCH i-g-t 8/8] HAX: run i915_pm_rc6_residency tests in BAT Ashutosh Dixit
  2022-10-13 16:09 ` [igt-dev] ✗ Fi.CI.BAT: failure for Add hwmon energy support for dgfx (rev4) Patchwork
  8 siblings, 0 replies; 12+ messages in thread
From: Ashutosh Dixit @ 2022-10-13 15:13 UTC (permalink / raw)
  To: igt-dev

From: Riana Tauro <riana.tauro@intel.com>

Remove unused rapl functions from igt_power.
No functional changes

Signed-off-by: Riana Tauro <riana.tauro@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 lib/igt_power.c | 13 ++++++++++-
 lib/igt_power.h | 58 -------------------------------------------------
 2 files changed, 12 insertions(+), 59 deletions(-)

diff --git a/lib/igt_power.c b/lib/igt_power.c
index 3f3633eb96..3b34be4064 100644
--- a/lib/igt_power.c
+++ b/lib/igt_power.c
@@ -53,7 +53,7 @@ static int rapl_parse(struct rapl *r, const char *str)
 	return 0;
 }
 
-int rapl_open(struct rapl *r, const char *domain)
+static int rapl_open(struct rapl *r, const char *domain)
 {
 	r->fd = rapl_parse(r, domain);
 	if (r->fd < 0)
@@ -72,6 +72,17 @@ err:
 	return r->fd;
 }
 
+static inline bool rapl_read(struct rapl *r, struct power_sample *s)
+{
+	return read(r->fd, s, sizeof(*s)) == sizeof(*s);
+}
+
+static inline void rapl_close(struct rapl *r)
+{
+	close(r->fd);
+	r->fd = -1;
+}
+
 /**
  * igt_power_open:
  * @fd : device fd
diff --git a/lib/igt_power.h b/lib/igt_power.h
index 0984c2df6b..68a05300ee 100644
--- a/lib/igt_power.h
+++ b/lib/igt_power.h
@@ -44,72 +44,14 @@ struct igt_power {
 	int hwmon_fd;
 };
 
-int rapl_open(struct rapl *r, const char *domain);
 int igt_power_open(int i915, struct igt_power *p, const char *domain);
 void igt_power_close(struct igt_power *p);
 
-static inline int cpu_power_open(struct rapl *r)
-{
-	return rapl_open(r, "cpu");
-}
-
-static inline int gpu_power_open(struct rapl *r)
-{
-	return rapl_open(r, "gpu");
-}
-
-static inline int pkg_power_open(struct rapl *r)
-{
-	return rapl_open(r, "pkg");
-}
-
-static inline bool rapl_valid(struct rapl *r)
-{
-	return r->fd >= 0;
-}
-
-static inline int ram_power_open(struct rapl *r)
-{
-	return rapl_open(r, "ram");
-}
-
-static inline bool rapl_read(struct rapl *r, struct power_sample *s)
-{
-	return read(r->fd, s, sizeof(*s)) == sizeof(*s);
-}
-
-static inline void rapl_close(struct rapl *r)
-{
-	close(r->fd);
-	r->fd = -1;
-}
-
 static inline bool igt_power_valid(struct igt_power *p)
 {
 	return (p->rapl.fd >= 0) || (p->hwmon_fd >= 0);
 }
 
-static inline double power_J(const struct rapl *r,
-			     const struct power_sample *p0,
-			     const struct power_sample *p1)
-{
-	return (p1->energy - p0->energy) * r->scale;
-}
-
-static inline double power_s(const struct rapl *r,
-			     const struct power_sample *p0,
-			     const struct power_sample *p1)
-{
-	return (p1->time - p0->time) * 1e-9;
-}
-
-static inline double power_W(const struct rapl *r,
-			     const struct power_sample *p0,
-			     const struct power_sample *p1)
-{
-	return power_J(r, p0, p1) / power_s(r, p0, p1);
-}
-
 void igt_power_get_energy(struct igt_power *p, struct power_sample *s);
 
 double igt_power_get_mJ(const struct igt_power *power,
-- 
2.38.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [igt-dev] [PATCH i-g-t 8/8] HAX: run i915_pm_rc6_residency tests in BAT
  2022-10-13 15:13 [igt-dev] [PATCH i-g-t 0/8] Add hwmon energy support for dgfx Ashutosh Dixit
                   ` (6 preceding siblings ...)
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 7/8] lib/igt_power: clean-up igt_power library Ashutosh Dixit
@ 2022-10-13 15:14 ` Ashutosh Dixit
  2022-10-13 16:09 ` [igt-dev] ✗ Fi.CI.BAT: failure for Add hwmon energy support for dgfx (rev4) Patchwork
  8 siblings, 0 replies; 12+ messages in thread
From: Ashutosh Dixit @ 2022-10-13 15:14 UTC (permalink / raw)
  To: igt-dev

From: Riana Tauro <riana.tauro@intel.com>

Add i915_pm_rc6_residency tests to test hwmon
interface

Signed-off-by: Riana Tauro <riana.tauro@intel.com>
---
 tests/intel-ci/fast-feedback.testlist | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
index bd5538a035..57c6e61846 100644
--- a/tests/intel-ci/fast-feedback.testlist
+++ b/tests/intel-ci/fast-feedback.testlist
@@ -124,6 +124,8 @@ igt@kms_psr@sprite_plane_onoff
 igt@kms_psr@primary_mmap_gtt
 igt@kms_setmode@basic-clone-single-crtc
 igt@i915_pm_backlight@basic-brightness
+igt@i915_pm_rc6_residency@rc6-fence
+igt@i915_pm_rc6_residency@rc6-idle
 igt@i915_pm_rpm@basic-pci-d3-state
 igt@i915_pm_rpm@basic-rte
 igt@i915_pm_rps@basic-api
-- 
2.38.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: failure for Add hwmon energy support for dgfx (rev4)
  2022-10-13 15:13 [igt-dev] [PATCH i-g-t 0/8] Add hwmon energy support for dgfx Ashutosh Dixit
                   ` (7 preceding siblings ...)
  2022-10-13 15:14 ` [igt-dev] [PATCH i-g-t 8/8] HAX: run i915_pm_rc6_residency tests in BAT Ashutosh Dixit
@ 2022-10-13 16:09 ` Patchwork
  8 siblings, 0 replies; 12+ messages in thread
From: Patchwork @ 2022-10-13 16:09 UTC (permalink / raw)
  To: Tauro, Riana; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 15292 bytes --]

== Series Details ==

Series: Add hwmon energy support for dgfx (rev4)
URL   : https://patchwork.freedesktop.org/series/108185/
State : failure

== Summary ==

CI Bug Log - changes from IGT_7013 -> IGTPW_7958
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_7958 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_7958, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/index.html

Participating hosts (48 -> 45)
------------------------------

  Additional (2): fi-hsw-4770 fi-icl-u2 
  Missing    (5): fi-ilk-m540 fi-hsw-4200u bat-dg1-5 bat-atsm-1 bat-jsl-1 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_7958:

### IGT changes ###

#### Possible regressions ####

  * igt@i915_pm_rc6_residency@rc6-idle@vcs0:
    - fi-cfl-8109u:       NOTRUN -> [WARN][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-cfl-8109u/igt@i915_pm_rc6_residency@rc6-idle@vcs0.html

  
#### Warnings ####

  * igt@gem_lmem_swapping@random-engines:
    - fi-apl-guc:         [SKIP][2] ([fdo#109271] / [i915#4613]) -> [INCOMPLETE][3]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7013/fi-apl-guc/igt@gem_lmem_swapping@random-engines.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-apl-guc/igt@gem_lmem_swapping@random-engines.html

  
#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@i915_selftest@live:
    - {fi-tgl-mst}:       NOTRUN -> [FAIL][4]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-tgl-mst/igt@i915_selftest@live.html

  * igt@i915_suspend@basic-s3-without-i915:
    - {bat-rpls-1}:       [PASS][5] -> [INCOMPLETE][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7013/bat-rpls-1/igt@i915_suspend@basic-s3-without-i915.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/bat-rpls-1/igt@i915_suspend@basic-s3-without-i915.html

  * igt@kms_pipe_crc_basic@suspend-read-crc@pipe-b-dp-3:
    - {bat-dg2-9}:        [PASS][7] -> [INCOMPLETE][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7013/bat-dg2-9/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-b-dp-3.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/bat-dg2-9/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-b-dp-3.html

  
Known issues
------------

  Here are the changes found in IGTPW_7958 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_suspend@basic-s3@smem:
    - fi-rkl-11600:       NOTRUN -> [INCOMPLETE][9] ([i915#6179])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-rkl-11600/igt@gem_exec_suspend@basic-s3@smem.html

  * igt@gem_huc_copy@huc-copy:
    - fi-icl-u2:          NOTRUN -> [SKIP][10] ([i915#2190])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-icl-u2/igt@gem_huc_copy@huc-copy.html

  * igt@gem_lmem_swapping@random-engines:
    - fi-icl-u2:          NOTRUN -> [SKIP][11] ([i915#4613]) +3 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-icl-u2/igt@gem_lmem_swapping@random-engines.html

  * igt@gem_softpin@allocator-basic-reserve:
    - fi-hsw-4770:        NOTRUN -> [SKIP][12] ([fdo#109271]) +9 similar issues
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-hsw-4770/igt@gem_softpin@allocator-basic-reserve.html

  * igt@i915_pm_backlight@basic-brightness:
    - fi-hsw-4770:        NOTRUN -> [SKIP][13] ([fdo#109271] / [i915#3012])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-hsw-4770/igt@i915_pm_backlight@basic-brightness.html

  * igt@i915_pm_rc6_residency@rc6-fence:
    - fi-icl-u2:          NOTRUN -> [WARN][14] ([i915#2684]) +4 similar issues
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-icl-u2/igt@i915_pm_rc6_residency@rc6-fence.html
    - fi-elk-e7500:       NOTRUN -> [SKIP][15] ([fdo#109271]) +2 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-elk-e7500/igt@i915_pm_rc6_residency@rc6-fence.html
    - fi-pnv-d510:        NOTRUN -> [SKIP][16] ([fdo#109271]) +1 similar issue
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-pnv-d510/igt@i915_pm_rc6_residency@rc6-fence.html

  * igt@i915_pm_rc6_residency@rc6-idle@bcs0:
    - fi-hsw-4770:        NOTRUN -> [WARN][17] ([i915#1804])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-hsw-4770/igt@i915_pm_rc6_residency@rc6-idle@bcs0.html

  * igt@i915_pm_rc6_residency@rc6-idle@rcs0:
    - fi-ilk-650:         NOTRUN -> [SKIP][18] ([fdo#109271]) +2 similar issues
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-ilk-650/igt@i915_pm_rc6_residency@rc6-idle@rcs0.html
    - fi-blb-e6850:       NOTRUN -> [SKIP][19] ([fdo#109271]) +1 similar issue
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-blb-e6850/igt@i915_pm_rc6_residency@rc6-idle@rcs0.html

  * igt@i915_pm_rc6_residency@rc6-idle@vcs0:
    - fi-tgl-u2:          NOTRUN -> [WARN][20] ([i915#2681]) +4 similar issues
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-tgl-u2/igt@i915_pm_rc6_residency@rc6-idle@vcs0.html
    - fi-kbl-8809g:       NOTRUN -> [WARN][21] ([i915#1804])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-kbl-8809g/igt@i915_pm_rc6_residency@rc6-idle@vcs0.html
    - fi-kbl-x1275:       NOTRUN -> [WARN][22] ([i915#1804])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-kbl-x1275/igt@i915_pm_rc6_residency@rc6-idle@vcs0.html
    - fi-bdw-5557u:       NOTRUN -> [FAIL][23] ([i915#3591])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-bdw-5557u/igt@i915_pm_rc6_residency@rc6-idle@vcs0.html
    - fi-skl-guc:         NOTRUN -> [WARN][24] ([i915#1804])
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-skl-guc/igt@i915_pm_rc6_residency@rc6-idle@vcs0.html

  * igt@i915_pm_rc6_residency@rc6-idle@vecs0:
    - fi-hsw-g3258:       NOTRUN -> [WARN][25] ([i915#1804])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-hsw-g3258/igt@i915_pm_rc6_residency@rc6-idle@vecs0.html

  * igt@i915_selftest@live@hangcheck:
    - fi-ivb-3770:        [PASS][26] -> [INCOMPLETE][27] ([i915#3303] / [i915#7122])
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7013/fi-ivb-3770/igt@i915_selftest@live@hangcheck.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-ivb-3770/igt@i915_selftest@live@hangcheck.html

  * igt@kms_chamelium@dp-crc-fast:
    - fi-hsw-4770:        NOTRUN -> [SKIP][28] ([fdo#109271] / [fdo#111827]) +8 similar issues
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-hsw-4770/igt@kms_chamelium@dp-crc-fast.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-icl-u2:          NOTRUN -> [SKIP][29] ([fdo#111827]) +8 similar issues
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-icl-u2/igt@kms_chamelium@hdmi-hpd-fast.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor:
    - fi-icl-u2:          NOTRUN -> [SKIP][30] ([i915#4103])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-icl-u2/igt@kms_cursor_legacy@basic-busy-flip-before-cursor.html

  * igt@kms_force_connector_basic@force-load-detect:
    - fi-icl-u2:          NOTRUN -> [SKIP][31] ([fdo#109285])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-icl-u2/igt@kms_force_connector_basic@force-load-detect.html

  * igt@kms_pipe_crc_basic@suspend-read-crc@pipe-b-hdmi-a-2:
    - fi-icl-u2:          NOTRUN -> [DMESG-WARN][32] ([i915#2867])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-icl-u2/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-b-hdmi-a-2.html

  * igt@kms_psr@sprite_plane_onoff:
    - fi-hsw-4770:        NOTRUN -> [SKIP][33] ([fdo#109271] / [i915#1072]) +3 similar issues
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-hsw-4770/igt@kms_psr@sprite_plane_onoff.html

  * igt@kms_setmode@basic-clone-single-crtc:
    - fi-icl-u2:          NOTRUN -> [SKIP][34] ([i915#3555])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-icl-u2/igt@kms_setmode@basic-clone-single-crtc.html

  * igt@prime_vgem@basic-userptr:
    - fi-icl-u2:          NOTRUN -> [SKIP][35] ([fdo#109295] / [i915#3301])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-icl-u2/igt@prime_vgem@basic-userptr.html

  * igt@runner@aborted:
    - fi-ivb-3770:        NOTRUN -> [FAIL][36] ([fdo#109271] / [i915#4312])
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-ivb-3770/igt@runner@aborted.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s0@smem:
    - {bat-rpls-2}:       [DMESG-WARN][37] ([i915#6434]) -> [PASS][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7013/bat-rpls-2/igt@gem_exec_suspend@basic-s0@smem.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/bat-rpls-2/igt@gem_exec_suspend@basic-s0@smem.html

  * igt@gem_huc_copy@huc-copy:
    - {bat-dg2-9}:        [FAIL][39] ([i915#7029]) -> [PASS][40]
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7013/bat-dg2-9/igt@gem_huc_copy@huc-copy.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/bat-dg2-9/igt@gem_huc_copy@huc-copy.html

  * igt@i915_module_load@load:
    - {bat-dg2-9}:        [DMESG-WARN][41] ([i915#7031]) -> [PASS][42]
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7013/bat-dg2-9/igt@i915_module_load@load.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/bat-dg2-9/igt@i915_module_load@load.html

  * igt@i915_pm_rpm@basic-rte:
    - {bat-rplp-1}:       [DMESG-WARN][43] ([i915#7077]) -> [PASS][44]
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7013/bat-rplp-1/igt@i915_pm_rpm@basic-rte.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/bat-rplp-1/igt@i915_pm_rpm@basic-rte.html

  * igt@i915_pm_rpm@module-reload:
    - fi-cfl-8109u:       [DMESG-FAIL][45] ([i915#62]) -> [PASS][46]
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7013/fi-cfl-8109u/igt@i915_pm_rpm@module-reload.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-cfl-8109u/igt@i915_pm_rpm@module-reload.html

  * igt@i915_selftest@live@guc_multi_lrc:
    - fi-cfl-8109u:       [DMESG-WARN][47] ([i915#5904] / [i915#7174]) -> [PASS][48] +2 similar issues
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7013/fi-cfl-8109u/igt@i915_selftest@live@guc_multi_lrc.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-cfl-8109u/igt@i915_selftest@live@guc_multi_lrc.html

  * igt@i915_selftest@live@late_gt_pm:
    - fi-cfl-8109u:       [DMESG-WARN][49] ([i915#5904]) -> [PASS][50] +27 similar issues
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7013/fi-cfl-8109u/igt@i915_selftest@live@late_gt_pm.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-cfl-8109u/igt@i915_selftest@live@late_gt_pm.html

  * igt@i915_suspend@basic-s2idle-without-i915:
    - fi-cfl-8109u:       [DMESG-WARN][51] ([i915#5904] / [i915#62]) -> [PASS][52]
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7013/fi-cfl-8109u/igt@i915_suspend@basic-s2idle-without-i915.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-cfl-8109u/igt@i915_suspend@basic-s2idle-without-i915.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-cfl-8109u:       [DMESG-WARN][53] ([i915#62]) -> [PASS][54] +14 similar issues
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7013/fi-cfl-8109u/igt@kms_frontbuffer_tracking@basic.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-cfl-8109u/igt@kms_frontbuffer_tracking@basic.html

  
#### Warnings ####

  * igt@i915_suspend@basic-s3-without-i915:
    - fi-rkl-11600:       [INCOMPLETE][55] ([i915#5982]) -> [FAIL][56] ([fdo#103375])
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7013/fi-rkl-11600/igt@i915_suspend@basic-s3-without-i915.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/fi-rkl-11600/igt@i915_suspend@basic-s3-without-i915.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1804]: https://gitlab.freedesktop.org/drm/intel/issues/1804
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681
  [i915#2684]: https://gitlab.freedesktop.org/drm/intel/issues/2684
  [i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
  [i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
  [i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
  [i915#3303]: https://gitlab.freedesktop.org/drm/intel/issues/3303
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#5904]: https://gitlab.freedesktop.org/drm/intel/issues/5904
  [i915#5982]: https://gitlab.freedesktop.org/drm/intel/issues/5982
  [i915#6179]: https://gitlab.freedesktop.org/drm/intel/issues/6179
  [i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
  [i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
  [i915#6434]: https://gitlab.freedesktop.org/drm/intel/issues/6434
  [i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
  [i915#6816]: https://gitlab.freedesktop.org/drm/intel/issues/6816
  [i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
  [i915#7029]: https://gitlab.freedesktop.org/drm/intel/issues/7029
  [i915#7031]: https://gitlab.freedesktop.org/drm/intel/issues/7031
  [i915#7077]: https://gitlab.freedesktop.org/drm/intel/issues/7077
  [i915#7122]: https://gitlab.freedesktop.org/drm/intel/issues/7122
  [i915#7174]: https://gitlab.freedesktop.org/drm/intel/issues/7174


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7013 -> IGTPW_7958

  CI-20190529: 20190529
  CI_DRM_12242: 075a81b1efd29300194bdf7877e08b6dbe3079d9 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_7958: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/index.html
  IGT_7013: 8d33b6114d95565a71f12810eca4eff15efbc6a3 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7958/index.html

[-- Attachment #2: Type: text/html, Size: 17766 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/8] lib/igt_hwmon: Introduce library igt_hwmon
  2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_hwmon: Introduce library igt_hwmon Ashutosh Dixit
@ 2022-10-14  7:23   ` Petri Latvala
  2022-10-14 14:03     ` Dixit, Ashutosh
  0 siblings, 1 reply; 12+ messages in thread
From: Petri Latvala @ 2022-10-14  7:23 UTC (permalink / raw)
  To: Ashutosh Dixit; +Cc: igt-dev

On Thu, Oct 13, 2022 at 08:13:53AM -0700, Ashutosh Dixit wrote:
> From: Riana Tauro <riana.tauro@intel.com>
> 
> igt_hwmon exposes methods to open hwmon directories identified by name
> 
> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
> Signed-off-by: Riana Tauro <riana.tauro@intel.com>
> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> ---
>  lib/igt_hwmon.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++
>  lib/igt_hwmon.h | 12 ++++++++
>  lib/meson.build |  1 +
>  3 files changed, 86 insertions(+)
>  create mode 100644 lib/igt_hwmon.c
>  create mode 100644 lib/igt_hwmon.h
> 
> diff --git a/lib/igt_hwmon.c b/lib/igt_hwmon.c
> new file mode 100644
> index 0000000000..1e4dab1bb2
> --- /dev/null
> +++ b/lib/igt_hwmon.c
> @@ -0,0 +1,73 @@
> +/*
> + * Copyright © 2022 Intel Corporation
> + */

License is missing.


-- 
Petri Latvala



> +#include <sys/stat.h>
> +#include <sys/sysmacros.h>
> +#include <dirent.h>
> +#include <fcntl.h>
> +#include <inttypes.h>
> +#include <unistd.h>
> +
> +#include "drmtest.h"
> +#include "igt_core.h"
> +#include "igt_hwmon.h"
> +#include "igt_sysfs.h"
> +
> +static char *igt_hwmon_path(int device, char *path, const char *name)
> +{
> +	char buf[80];
> +	int path_offset;
> +	struct dirent *entry;
> +	struct stat st;
> +	DIR *dir;
> +
> +	if (igt_debug_on(device < 0))
> +		return NULL;
> +
> +	if (igt_debug_on(fstat(device, &st)) || igt_debug_on(!S_ISCHR(st.st_mode)))
> +		return NULL;
> +
> +	path_offset = snprintf(path, PATH_MAX, "/sys/dev/char/%d:%d/device/hwmon",
> +			       major(st.st_rdev), minor(st.st_rdev));
> +
> +	dir = opendir(path);
> +	if (!dir)
> +		return NULL;
> +
> +	while ((entry = readdir(dir))) {
> +		if (entry->d_name[0] == '.')
> +			continue;
> +
> +		snprintf(path + path_offset, PATH_MAX - path_offset, "/%s/name", entry->d_name);
> +		igt_sysfs_scanf(dirfd(dir), path, "%s", buf);
> +
> +		if (strncmp(buf, name, strlen(name)) == 0) {
> +			snprintf(path + path_offset, PATH_MAX - path_offset, "/%s", entry->d_name);
> +			closedir(dir);
> +			return path;
> +		}
> +	}
> +
> +	closedir(dir);
> +	return NULL;
> +}
> +
> +/**
> + * igt_hwmon_open:
> + * @device: fd of the device
> + *
> + * Opens the hwmon directory corresponding to device
> + *
> + * Returns:
> + * The directory fd, or -1 on failure.
> + */
> +int igt_hwmon_open(int device)
> +{
> +	char path[PATH_MAX];
> +
> +	if (!is_i915_device(device) || !igt_hwmon_path(device, path, "i915"))
> +		return -1;
> +
> +	return open(path, O_RDONLY);
> +}
> +
> diff --git a/lib/igt_hwmon.h b/lib/igt_hwmon.h
> new file mode 100644
> index 0000000000..aa418fdcb0
> --- /dev/null
> +++ b/lib/igt_hwmon.h
> @@ -0,0 +1,12 @@
> +/*
> + * Copyright © 2022 Intel Corporation
> + */
> +
> +#ifndef IGT_HWMON_H
> +#define IGT_HWMON_H
> +
> +#include <stdbool.h>
> +
> +int igt_hwmon_open(int device);
> +
> +#endif /* IGT_HWMON_H */
> diff --git a/lib/meson.build b/lib/meson.build
> index c665bd2507..b1b8e80cbf 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -24,6 +24,7 @@ lib_sources = [
>  	'igt_aux.c',
>  	'igt_gt.c',
>  	'igt_halffloat.c',
> +	'igt_hwmon.c',
>  	'igt_io.c',
>  	'igt_matrix.c',
>  	'igt_os.c',
> -- 
> 2.38.0
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 1/8] lib/igt_hwmon: Introduce library igt_hwmon
  2022-10-14  7:23   ` Petri Latvala
@ 2022-10-14 14:03     ` Dixit, Ashutosh
  0 siblings, 0 replies; 12+ messages in thread
From: Dixit, Ashutosh @ 2022-10-14 14:03 UTC (permalink / raw)
  To: Petri Latvala, Riana Tauro; +Cc: igt-dev

On Fri, 14 Oct 2022 00:23:51 -0700, Petri Latvala wrote:
>
> On Thu, Oct 13, 2022 at 08:13:53AM -0700, Ashutosh Dixit wrote:
> > From: Riana Tauro <riana.tauro@intel.com>
> >
> > igt_hwmon exposes methods to open hwmon directories identified by name
> >
> > Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > Signed-off-by: Riana Tauro <riana.tauro@intel.com>
> > Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > ---
> >  lib/igt_hwmon.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++
> >  lib/igt_hwmon.h | 12 ++++++++
> >  lib/meson.build |  1 +
> >  3 files changed, 86 insertions(+)
> >  create mode 100644 lib/igt_hwmon.c
> >  create mode 100644 lib/igt_hwmon.h
> >
> > diff --git a/lib/igt_hwmon.c b/lib/igt_hwmon.c
> > new file mode 100644
> > index 0000000000..1e4dab1bb2
> > --- /dev/null
> > +++ b/lib/igt_hwmon.c
> > @@ -0,0 +1,73 @@
> > +/*
> > + * Copyright © 2022 Intel Corporation
> > + */
>
> License is missing.

Hi Riana,

Could you please fix up the license and repost this series. We should add
SPDX license headers to any new .c or .h files, the license headers for .c
and .h files are different.

See lib/intel_ctx.c and lib/intel_ctx.h for the .c and .h license headers.

Thanks.
--
Ashutosh

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-10-14 14:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-13 15:13 [igt-dev] [PATCH i-g-t 0/8] Add hwmon energy support for dgfx Ashutosh Dixit
2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_hwmon: Introduce library igt_hwmon Ashutosh Dixit
2022-10-14  7:23   ` Petri Latvala
2022-10-14 14:03     ` Dixit, Ashutosh
2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 2/8] lib/igt_power: Rename lib igt_rapl with igt_power Ashutosh Dixit
2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 3/8] lib/igt_power: Add hwmon interface to igt_power Ashutosh Dixit
2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 4/8] i915/i915_pm_rc6_residency: Add energy support for dgfx Ashutosh Dixit
2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 5/8] i915/gem_exec_schedule: " Ashutosh Dixit
2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 6/8] i915/gem_exec_whisper: " Ashutosh Dixit
2022-10-13 15:13 ` [igt-dev] [PATCH i-g-t 7/8] lib/igt_power: clean-up igt_power library Ashutosh Dixit
2022-10-13 15:14 ` [igt-dev] [PATCH i-g-t 8/8] HAX: run i915_pm_rc6_residency tests in BAT Ashutosh Dixit
2022-10-13 16:09 ` [igt-dev] ✗ Fi.CI.BAT: failure for Add hwmon energy support for dgfx (rev4) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.