public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] i915/perf_pmu: Check that while parked, we report min freq or below
@ 2019-11-29 11:45 Chris Wilson
  2019-11-29 11:56 ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Chris Wilson @ 2019-11-29 11:45 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Tvrtko Ursulin

While the HW is parked, the GPU should be turned off and clocks stop
(i.e. running at 0Hz). We should report either the last frequency we
program (which should be the minimum legal value) or a more truthful 0.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/perf_pmu.c | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 54842784c..a1520d2c4 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -1477,6 +1477,44 @@ test_frequency(int gem_fd)
 	__assert_within_epsilon(max[0], max_freq, tolerance, 0.15f);
 }
 
+static void
+test_frequency_idle(int gem_fd)
+{
+	uint32_t min_freq;
+	uint64_t val[2], start[2], slept;
+	double idle[2];
+	int fd, sysfs;
+
+	sysfs = igt_sysfs_open(gem_fd);
+	igt_require(sysfs >= 0);
+
+	min_freq = igt_sysfs_get_u32(sysfs, "gt_RPn_freq_mhz");
+	close(sysfs);
+
+	/* While parked, our convention is to report the GPU at 0Hz */
+
+	fd = open_group(I915_PMU_REQUESTED_FREQUENCY, -1);
+	open_group(I915_PMU_ACTUAL_FREQUENCY, fd);
+
+	gem_quiescent_gpu(gem_fd); /* Be idle! */
+	measured_usleep(2000); /* Wait for timers to cease */
+
+	slept = pmu_read_multi(fd, 2, start);
+	measured_usleep(batch_duration_ns / 1000);
+	slept = pmu_read_multi(fd, 2, val) - slept;
+
+	idle[0] = 1e9*(val[0] - start[0]) / slept;
+	idle[1] = 1e9*(val[1] - start[1]) / slept;
+
+	igt_info("Idle frequency: requested %.1f, actual %.1f; HW min %u\n",
+		 idle[0], idle[1], min_freq);
+
+	igt_assert_f(idle[0] <= min_freq,
+		     "Request frequency should be 0 while parked!\n");
+	igt_assert_f(idle[1] <= min_freq,
+		     "Actual frequency should be 0 while parked!\n");
+}
+
 static bool wait_for_rc6(int fd)
 {
 	struct timespec tv = {};
@@ -1967,6 +2005,8 @@ igt_main
 	 */
 	igt_subtest("frequency")
 		test_frequency(fd);
+	igt_subtest("frequency-idle")
+		test_frequency_idle(fd);
 
 	/**
 	 * Test interrupt count reporting.
-- 
2.24.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [Intel-gfx] [PATCH i-g-t] i915/perf_pmu: Check that while parked, we report min freq or below
  2019-11-29 11:45 [igt-dev] [PATCH i-g-t] i915/perf_pmu: Check that while parked, we report min freq or below Chris Wilson
@ 2019-11-29 11:56 ` Tvrtko Ursulin
  2019-11-29 11:57 ` Tvrtko Ursulin
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Tvrtko Ursulin @ 2019-11-29 11:56 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 29/11/2019 11:45, Chris Wilson wrote:
> While the HW is parked, the GPU should be turned off and clocks stop
> (i.e. running at 0Hz). We should report either the last frequency we
> program (which should be the minimum legal value) or a more truthful 0.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tests/perf_pmu.c | 40 ++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 40 insertions(+)
> 
> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> index 54842784c..a1520d2c4 100644
> --- a/tests/perf_pmu.c
> +++ b/tests/perf_pmu.c
> @@ -1477,6 +1477,44 @@ test_frequency(int gem_fd)
>   	__assert_within_epsilon(max[0], max_freq, tolerance, 0.15f);
>   }
>   
> +static void
> +test_frequency_idle(int gem_fd)
> +{
> +	uint32_t min_freq;
> +	uint64_t val[2], start[2], slept;
> +	double idle[2];
> +	int fd, sysfs;
> +
> +	sysfs = igt_sysfs_open(gem_fd);
> +	igt_require(sysfs >= 0);
> +
> +	min_freq = igt_sysfs_get_u32(sysfs, "gt_RPn_freq_mhz");
> +	close(sysfs);
> +
> +	/* While parked, our convention is to report the GPU at 0Hz */
> +
> +	fd = open_group(I915_PMU_REQUESTED_FREQUENCY, -1);
> +	open_group(I915_PMU_ACTUAL_FREQUENCY, fd);
> +
> +	gem_quiescent_gpu(gem_fd); /* Be idle! */
> +	measured_usleep(2000); /* Wait for timers to cease */
> +
> +	slept = pmu_read_multi(fd, 2, start);
> +	measured_usleep(batch_duration_ns / 1000);
> +	slept = pmu_read_multi(fd, 2, val) - slept;
> +
> +	idle[0] = 1e9*(val[0] - start[0]) / slept;
> +	idle[1] = 1e9*(val[1] - start[1]) / slept;
> +
> +	igt_info("Idle frequency: requested %.1f, actual %.1f; HW min %u\n",
> +		 idle[0], idle[1], min_freq);
> +
> +	igt_assert_f(idle[0] <= min_freq,
> +		     "Request frequency should be 0 while parked!\n");
> +	igt_assert_f(idle[1] <= min_freq,
> +		     "Actual frequency should be 0 while parked!\n");
> +}
> +
>   static bool wait_for_rc6(int fd)
>   {
>   	struct timespec tv = {};
> @@ -1967,6 +2005,8 @@ igt_main
>   	 */
>   	igt_subtest("frequency")
>   		test_frequency(fd);
> +	igt_subtest("frequency-idle")
> +		test_frequency_idle(fd);
>   
>   	/**
>   	 * Test interrupt count reporting.
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

So we are going with it and leaving sysfs as is?

Regards,

Tvrtko
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [Intel-gfx] [PATCH i-g-t] i915/perf_pmu: Check that while parked, we report min freq or below
  2019-11-29 11:45 [igt-dev] [PATCH i-g-t] i915/perf_pmu: Check that while parked, we report min freq or below Chris Wilson
  2019-11-29 11:56 ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin
@ 2019-11-29 11:57 ` Tvrtko Ursulin
  2019-11-29 12:42 ` [igt-dev] ✗ GitLab.Pipeline: failure for " Patchwork
  2019-11-29 12:55 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
  3 siblings, 0 replies; 5+ messages in thread
From: Tvrtko Ursulin @ 2019-11-29 11:57 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 29/11/2019 11:45, Chris Wilson wrote:
> While the HW is parked, the GPU should be turned off and clocks stop
> (i.e. running at 0Hz). We should report either the last frequency we
> program (which should be the minimum legal value) or a more truthful 0.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tests/perf_pmu.c | 40 ++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 40 insertions(+)
> 
> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> index 54842784c..a1520d2c4 100644
> --- a/tests/perf_pmu.c
> +++ b/tests/perf_pmu.c
> @@ -1477,6 +1477,44 @@ test_frequency(int gem_fd)
>   	__assert_within_epsilon(max[0], max_freq, tolerance, 0.15f);
>   }
>   
> +static void
> +test_frequency_idle(int gem_fd)
> +{
> +	uint32_t min_freq;
> +	uint64_t val[2], start[2], slept;
> +	double idle[2];
> +	int fd, sysfs;
> +
> +	sysfs = igt_sysfs_open(gem_fd);
> +	igt_require(sysfs >= 0);
> +
> +	min_freq = igt_sysfs_get_u32(sysfs, "gt_RPn_freq_mhz");
> +	close(sysfs);
> +
> +	/* While parked, our convention is to report the GPU at 0Hz */
> +
> +	fd = open_group(I915_PMU_REQUESTED_FREQUENCY, -1);
> +	open_group(I915_PMU_ACTUAL_FREQUENCY, fd);
> +
> +	gem_quiescent_gpu(gem_fd); /* Be idle! */
> +	measured_usleep(2000); /* Wait for timers to cease */
> +
> +	slept = pmu_read_multi(fd, 2, start);
> +	measured_usleep(batch_duration_ns / 1000);
> +	slept = pmu_read_multi(fd, 2, val) - slept;
> +

close(fd);

Regards,

Tvrtko

> +	idle[0] = 1e9*(val[0] - start[0]) / slept;
> +	idle[1] = 1e9*(val[1] - start[1]) / slept;
> +
> +	igt_info("Idle frequency: requested %.1f, actual %.1f; HW min %u\n",
> +		 idle[0], idle[1], min_freq);
> +
> +	igt_assert_f(idle[0] <= min_freq,
> +		     "Request frequency should be 0 while parked!\n");
> +	igt_assert_f(idle[1] <= min_freq,
> +		     "Actual frequency should be 0 while parked!\n");
> +}
> +
>   static bool wait_for_rc6(int fd)
>   {
>   	struct timespec tv = {};
> @@ -1967,6 +2005,8 @@ igt_main
>   	 */
>   	igt_subtest("frequency")
>   		test_frequency(fd);
> +	igt_subtest("frequency-idle")
> +		test_frequency_idle(fd);
>   
>   	/**
>   	 * Test interrupt count reporting.
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ GitLab.Pipeline: failure for i915/perf_pmu: Check that while parked, we report min freq or below
  2019-11-29 11:45 [igt-dev] [PATCH i-g-t] i915/perf_pmu: Check that while parked, we report min freq or below Chris Wilson
  2019-11-29 11:56 ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin
  2019-11-29 11:57 ` Tvrtko Ursulin
@ 2019-11-29 12:42 ` Patchwork
  2019-11-29 12:55 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
  3 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2019-11-29 12:42 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: i915/perf_pmu: Check that while parked, we report min freq or below
URL   : https://patchwork.freedesktop.org/series/70205/
State : failure

== Summary ==

ERROR! This series introduces new undocumented tests:

perf_pmu@frequency-idle

Can you document them as per the requirement in the [CONTRIBUTING.md]?

[Documentation] has more details on how to do this.

Here are few examples:
https://gitlab.freedesktop.org/drm/igt-gpu-tools/commit/0316695d03aa46108296b27f3982ec93200c7a6e
https://gitlab.freedesktop.org/drm/igt-gpu-tools/commit/443cc658e1e6b492ee17bf4f4d891029eb7a205d

Thanks in advance!

[CONTRIBUTING.md]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/blob/master/CONTRIBUTING.md#L19
[Documentation]: https://drm.pages.freedesktop.org/igt-gpu-tools/igt-gpu-tools-Core.html#igt-describe

Other than that, pipeline status: SUCCESS.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/84023 for the overview.

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/84023
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for i915/perf_pmu: Check that while parked, we report min freq or below
  2019-11-29 11:45 [igt-dev] [PATCH i-g-t] i915/perf_pmu: Check that while parked, we report min freq or below Chris Wilson
                   ` (2 preceding siblings ...)
  2019-11-29 12:42 ` [igt-dev] ✗ GitLab.Pipeline: failure for " Patchwork
@ 2019-11-29 12:55 ` Patchwork
  3 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2019-11-29 12:55 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: i915/perf_pmu: Check that while parked, we report min freq or below
URL   : https://patchwork.freedesktop.org/series/70205/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_7441 -> IGTPW_3785
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_module_load@reload-no-display:
    - fi-skl-lmem:        [PASS][1] -> [DMESG-WARN][2] ([fdo#112261])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7441/fi-skl-lmem/igt@i915_module_load@reload-no-display.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3785/fi-skl-lmem/igt@i915_module_load@reload-no-display.html

  * igt@kms_busy@basic-flip-pipe-a:
    - fi-icl-u2:          [PASS][3] -> [INCOMPLETE][4] ([fdo#107713])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7441/fi-icl-u2/igt@kms_busy@basic-flip-pipe-a.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3785/fi-icl-u2/igt@kms_busy@basic-flip-pipe-a.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       [PASS][5] -> [FAIL][6] ([fdo#111407])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7441/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3785/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html

  
#### Possible fixes ####

  * igt@gem_ctx_create@basic-files:
    - {fi-tgl-u}:         [INCOMPLETE][7] ([fdo#111735]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7441/fi-tgl-u/igt@gem_ctx_create@basic-files.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3785/fi-tgl-u/igt@gem_ctx_create@basic-files.html

  * igt@i915_selftest@live_blt:
    - fi-skl-6770hq:      [INCOMPLETE][9] -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7441/fi-skl-6770hq/igt@i915_selftest@live_blt.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3785/fi-skl-6770hq/igt@i915_selftest@live_blt.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-tgl-y:           [FAIL][11] ([fdo# 112163] / [fdo#103167]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7441/fi-tgl-y/igt@kms_frontbuffer_tracking@basic.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3785/fi-tgl-y/igt@kms_frontbuffer_tracking@basic.html

  
#### Warnings ####

  * igt@kms_busy@basic-flip-pipe-b:
    - fi-kbl-x1275:       [DMESG-WARN][13] ([fdo#103558] / [fdo#105602] / [fdo#105763]) -> [DMESG-WARN][14] ([fdo#103558] / [fdo#105602]) +7 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7441/fi-kbl-x1275/igt@kms_busy@basic-flip-pipe-b.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3785/fi-kbl-x1275/igt@kms_busy@basic-flip-pipe-b.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-b:
    - fi-kbl-x1275:       [DMESG-WARN][15] ([fdo#103558] / [fdo#105602]) -> [DMESG-WARN][16] ([fdo#103558] / [fdo#105602] / [fdo#105763]) +2 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7441/fi-kbl-x1275/igt@kms_pipe_crc_basic@read-crc-pipe-b.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3785/fi-kbl-x1275/igt@kms_pipe_crc_basic@read-crc-pipe-b.html

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

  [fdo# 112163]: https://bugs.freedesktop.org/show_bug.cgi?id= 112163
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
  [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
  [fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
  [fdo#111735]: https://bugs.freedesktop.org/show_bug.cgi?id=111735
  [fdo#112261]: https://bugs.freedesktop.org/show_bug.cgi?id=112261


Participating hosts (52 -> 46)
------------------------------

  Missing    (6): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5316 -> IGTPW_3785

  CI-20190529: 20190529
  CI_DRM_7441: 73955c66d6bc96026dfc64afe2e11b8d98609dbd @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3785: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3785/index.html
  IGT_5316: f38b398103fea0423b7bf133bbe5868fde99623c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@perf_pmu@frequency-idle

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3785/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-11-29 12:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-29 11:45 [igt-dev] [PATCH i-g-t] i915/perf_pmu: Check that while parked, we report min freq or below Chris Wilson
2019-11-29 11:56 ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin
2019-11-29 11:57 ` Tvrtko Ursulin
2019-11-29 12:42 ` [igt-dev] ✗ GitLab.Pipeline: failure for " Patchwork
2019-11-29 12:55 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox