diff mbox series

[v10,4/4] drm/i915/selftests: skip comparison of power for discrete graphics

Message ID 20230405071432.3582592-5-riana.tauro@intel.com (mailing list archive)
State New, archived
Headers show
Series Add hwmon support for dgfx selftests | expand

Commit Message

Riana Tauro April 5, 2023, 7:14 a.m. UTC
Hwmon reads the energy/power consumed by discrete soc,
i.e. energy/power includes the power drawn from non-gfx discrete
components

This test uses the power consumed by GT to validate RC6
power consumption.
Skip comparison of power for discrete graphics

TODO : measure power of GT in discrete graphics and modify the
condition

v2: update commit message (Anshuman)

Signed-off-by: Riana Tauro <riana.tauro@intel.com>
Reviewed-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 drivers/gpu/drm/i915/gt/selftest_rc6.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/selftest_rc6.c b/drivers/gpu/drm/i915/gt/selftest_rc6.c
index 682f2fe67b3a..7040dac7acca 100644
--- a/drivers/gpu/drm/i915/gt/selftest_rc6.c
+++ b/drivers/gpu/drm/i915/gt/selftest_rc6.c
@@ -107,7 +107,15 @@  int live_rc6_manual(void *arg)
 				      ktime_to_ns(dt));
 		pr_info("GPU consumed %llduW in RC0 and %llduW in RC6\n",
 			rc0_power, rc6_power);
-		if (2 * rc6_power > rc0_power) {
+
+		/*
+		 * Condition valid for integrated graphics
+		 * On discrete graphics, hwmon reads the energy/power from
+		 * discrete soc that includes non-gfx components.
+		 * TODO : Measure power of GT for discrete graphics and
+		 * modify the condition
+		 */
+		if (!IS_DGFX(gt->i915) && (2 * rc6_power > rc0_power)) {
 			pr_err("GPU leaked energy while in RC6!\n");
 			err = -EINVAL;
 			goto out_unlock;