From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH igt 2/2] igt/perf_pmu: Replace hard-coded sleep before rc6 with a probe
Date: Tue, 5 Dec 2017 12:05:14 +0000 [thread overview]
Message-ID: <7964512f-06d9-40cf-6a19-5ca56d364623@linux.intel.com> (raw)
In-Reply-To: <20171205105602.16135-2-chris@chris-wilson.co.uk>
On 05/12/2017 10:56, Chris Wilson wrote:
> Instead of trying to sleep for 2 evaluations intervals and then assuming
> that rc6 is working, poll the rc6 residency instead.
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=103929
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> tests/perf_pmu.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> index e872f4e55..65bc734da 100644
> --- a/tests/perf_pmu.c
> +++ b/tests/perf_pmu.c
> @@ -1008,6 +1008,20 @@ static unsigned long rc6_enable_us(void)
> return 2 * 160 * 1000;
> }
>
> +static bool wait_for_rc6(int fd)
> +{
> + struct timespec tv = {};
> + uint64_t start, now;
> +
> + start = pmu_read_single(fd);
> + do {
> + usleep(50);
Not needlessly fast?
> + now = pmu_read_single(fd);
> + } while (start == now && !igt_seconds_elapsed(&tv));
So up to one second wait.
> +
> + return start != now;
> +}
> +
> static void
> test_rc6(int gem_fd)
> {
> @@ -1019,7 +1033,7 @@ test_rc6(int gem_fd)
> fd = open_pmu(I915_PMU_RC6_RESIDENCY);
>
> gem_quiescent_gpu(gem_fd);
> - usleep(rc6_enable_us()); /* wait for the rc6 cycle counter to kick in */
> + igt_require(wait_for_rc6(fd));
Eliminate now unused rc6_enable_us() ?
>
> /* Go idle and check full RC6. */
> prev = pmu_read_single(fd);
>
With dead-code removed:
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-12-05 12:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-05 10:56 [PATCH igt 1/2] igt/pm_rc6_residency: Replace hard-coded sleep before rc6 with a probe Chris Wilson
2017-12-05 10:56 ` [PATCH igt 2/2] igt/perf_pmu: " Chris Wilson
2017-12-05 12:05 ` Tvrtko Ursulin [this message]
2017-12-05 12:16 ` Chris Wilson
2017-12-05 11:51 ` ✓ Fi.CI.BAT: success for series starting with [1/2] igt/pm_rc6_residency: " Patchwork
2017-12-05 12:12 ` [PATCH igt 1/2] " Tvrtko Ursulin
2017-12-05 12:53 ` ✗ Fi.CI.IGT: warning for series starting with [1/2] " Patchwork
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=7964512f-06d9-40cf-6a19-5ca56d364623@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@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