Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ashutosh Dixit <ashutosh.dixit@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] i915/i915_power: Also show requested and actual freq's
Date: Mon, 20 Mar 2023 18:18:00 -0700	[thread overview]
Message-ID: <20230321011800.3025307-1-ashutosh.dixit@intel.com> (raw)

When power limits are in effect, in addition to measured power it is also
important to see the requested and actual freq's and see how they change
with set power limits. Add this to the test output.

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 tests/i915/i915_power.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tests/i915/i915_power.c b/tests/i915/i915_power.c
index f2fd228698a..f0f10fc4d14 100644
--- a/tests/i915/i915_power.c
+++ b/tests/i915/i915_power.c
@@ -5,6 +5,7 @@
 
 #include "igt.h"
 #include "i915/gem.h"
+#include "igt_sysfs.h"
 #include "igt_power.h"
 
 IGT_TEST_DESCRIPTION("i915 power measurement tests");
@@ -27,9 +28,13 @@ static void sanity(int i915)
 	double idle, busy;
 	igt_spin_t *spin;
 	uint64_t ahnd;
+	int dir, req, act;
 
 #define DURATION_SEC 2
 
+	dir = igt_sysfs_gt_open(i915, 0);
+	igt_assert_lt(0, dir);
+
 	/* Idle power */
 	igt_require(!igt_power_open(i915, &pwr, "gpu"));
 	gem_quiescent_gpu(i915);
@@ -44,12 +49,16 @@ static void sanity(int i915)
 	/* Wait till at least one spinner starts */
 	igt_spin_busywait_until_started(spin);
 	busy = measure_power(&pwr, DURATION_SEC);
+	req = igt_sysfs_get_u32(dir, "rps_cur_freq_mhz");
+	act = igt_sysfs_get_u32(dir, "rps_act_freq_mhz");
 	igt_free_spins(i915);
 	put_ahnd(ahnd);
 	intel_ctx_destroy(i915, ctx);
 	igt_power_close(&pwr);
+	close(dir);
 
-	igt_info("Measured power: idle: %g mW, busy: %g mW\n", idle, busy);
+	igt_info("Measured power: idle: %g mW, busy: %g mW, req MHz: %d, act MHz: %d\n",
+		 idle, busy, req, act);
 	igt_assert(idle >= 0 && busy > 0 && busy > idle);
 }
 
-- 
2.38.0

             reply	other threads:[~2023-03-21  1:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21  1:18 Ashutosh Dixit [this message]
2023-03-21  1:55 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/i915_power: Also show requested and actual freq's Patchwork
2023-03-21  4:46 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-03-21  7:57 ` [igt-dev] [PATCH i-g-t] " Riana Tauro
2023-03-22 17:09   ` Kamil Konieczny
2023-03-22 23:08     ` Dixit, Ashutosh
2023-03-22 23:13       ` Dixit, Ashutosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230321011800.3025307-1-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox