From: Daniel Vetter <daniel@ffwll.ch>
To: Imre Deak <imre.deak@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [i-g-t PATCH] tests/gem_wait_render_timeout: make sure the GPU is idle before exiting
Date: Tue, 28 May 2013 11:31:30 +0200 [thread overview]
Message-ID: <20130528093130.GW15743@phenom.ffwll.local> (raw)
In-Reply-To: <1369669362-21300-1-git-send-email-imre.deak@intel.com>
On Mon, May 27, 2013 at 06:42:42PM +0300, Imre Deak wrote:
> Leaving the GPU running after we exit can mess up timing dependent tests
> we run afterwards.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64270
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
I've flailed around in this area since forever, see gem_quiescent_gpu in
drmtest.c. I wonder whether we shouldn't just install an atexit handler
with this and maybe for full paranoia run it in drm_open_any, too?
One ugly bug with that function is that it doesn't quiescent all rings on
gen6+ though. So I guess that needs fixing.
-Daniel
> ---
> tests/gem_wait_render_timeout.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/tests/gem_wait_render_timeout.c b/tests/gem_wait_render_timeout.c
> index 14482e3..9ec4e49 100644
> --- a/tests/gem_wait_render_timeout.c
> +++ b/tests/gem_wait_render_timeout.c
> @@ -216,6 +216,11 @@ int main(int argc, char **argv)
> assert(gem_bo_wait_timeout(fd, dst2->handle, &timeout) == -ETIME);
> assert(timeout == 0);
>
> + /* Make sure we exit only after the GPU is idle. Apply some fuzz
> + * to the timeout since the calibrated iteration count can be
> + * twice the amount the GPU can execute in a second. */
> + timeout = 5 * ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC;
> + assert(gem_bo_wait_timeout(fd, dst2->handle, &timeout) == 0);
>
> if (do_signals)
> drmtest_stop_signal_helper();
> --
> 1.8.1.2
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2013-05-28 9:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-27 15:42 [i-g-t PATCH] tests/gem_wait_render_timeout: make sure the GPU is idle before exiting Imre Deak
2013-05-28 9:31 ` Daniel Vetter [this message]
2013-05-28 14:22 ` [i-g-t PATCH v2 1/2] lib: make sure all rings are idle in gpu_quiescent_gpu() Imre Deak
2013-05-28 14:22 ` [i-g-t PATCH v2 2/2] tests/lib: make sure the GPU is idle at test start and exit Imre Deak
2013-05-28 14:35 ` [i-g-t PATCH v3 " Imre Deak
2013-05-28 16:33 ` Daniel Vetter
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=20130528093130.GW15743@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=imre.deak@intel.com \
--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