[PATCH i-g-t] tools/intel_gpu_top: Fix intel_gpu_top for pre-snb

Ville Syrjala ville.syrjala at linux.intel.com
Tue Oct 8 21:49:44 UTC 2024


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

__I915_PMU_REQUESTED_FREQUENCY is not available on pre-snb (*)
so checking for it breaks intel_gpu_top completely for those
machines. Check __I915_PMU_INTERRUPTS instead, which I believe
is available on everything. Another option would be
__I915_PMU_SOFTWARE_GT_AWAKE_TIME.

* we do have frequency information on ilk, but we've not
  reverse engineered the hw unit<->Hz conversion factor so
  exposing it as is might be a bit confusing...

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 tools/intel_gpu_top.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 9b65ae4eb941..a608b894d3de 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -563,7 +563,7 @@ static int get_num_gts(uint64_t type)
 
 	errno = 0;
 	for (cnt = 0; cnt < MAX_GTS; cnt++) {
-		fd = igt_perf_open(type, __I915_PMU_REQUESTED_FREQUENCY(cnt));
+		fd = igt_perf_open(type, __I915_PMU_INTERRUPTS(cnt));
 		if (fd < 0)
 			break;
 
-- 
2.45.2



More information about the igt-dev mailing list