From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH igt] igt/prime_busy: Declare the hang tests expect to cause GPU hangs
Date: Thu, 14 Sep 2017 13:58:41 +0300 [thread overview]
Message-ID: <87zi9x1r8e.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170913114340.8531-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Pull the two subtests together into the same subtest group as the
> fixtures were repeated for both and so we can consolidate down to one.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
> tests/prime_busy.c | 81 ++++++++++++++++++++++--------------------------------
> 1 file changed, 33 insertions(+), 48 deletions(-)
>
> diff --git a/tests/prime_busy.c b/tests/prime_busy.c
> index cbc91545..a516ab86 100644
> --- a/tests/prime_busy.c
> +++ b/tests/prime_busy.c
> @@ -52,6 +52,8 @@ static void busy(int fd, unsigned ring, unsigned flags)
> uint32_t *batch, *bbe;
> int i, count, timeout;
>
> + gem_quiescent_gpu(fd);
> +
> memset(&execbuf, 0, sizeof(execbuf));
> execbuf.buffers_ptr = (uintptr_t)obj;
> execbuf.buffer_count = 2;
> @@ -172,53 +174,39 @@ static void busy(int fd, unsigned ring, unsigned flags)
> close(pfd[SCRATCH].fd);
> }
>
> -static void run_busy(int fd,
> - const struct intel_execution_engine *e,
> - const char *name, unsigned flags)
> -{
> - igt_fixture {
> - gem_require_ring(fd, e->exec_id | e->flags);
> - igt_require(gem_can_store_dword(fd, e->exec_id | e->flags));
> - gem_quiescent_gpu(fd);
> -
> - if ((flags & HANG) == 0)
> - igt_fork_hang_detector(fd);
> - }
> -
> - igt_subtest_f("%s%s-%s",
> - !e->exec_id && !(flags & HANG) ? "basic-" : "",
> - name, e->name)
> - busy(fd, e->exec_id | e->flags, flags);
> -
> - igt_fixture {
> - if ((flags & HANG) == 0)
> - igt_stop_hang_detector();
> - gem_quiescent_gpu(fd);
> - }
> -}
> -
> -static void run_poll(int fd,
> - const struct intel_execution_engine *e,
> - const char *name, unsigned flags)
> +static void test_engine_mode(int fd,
> + const struct intel_execution_engine *e,
> + const char *name, unsigned int flags)
> {
> - igt_fixture {
> - gem_require_ring(fd, e->exec_id | e->flags);
> - igt_require(gem_can_store_dword(fd, e->exec_id | e->flags));
> -
> - gem_quiescent_gpu(fd);
> - if ((flags & HANG) == 0)
> - igt_fork_hang_detector(fd);
> - }
> + igt_hang_t hang = {};
>
> - igt_subtest_f("%swait-%s-%s",
> - !e->exec_id && !(flags & HANG) ? "basic-" : "",
> - name, e->name)
> - busy(fd, e->exec_id | e->flags, flags | POLL);
> + igt_subtest_group {
> + igt_fixture {
> + gem_require_ring(fd, e->exec_id | e->flags);
> + igt_require(gem_can_store_dword(fd, e->exec_id | e->flags));
> +
> + if ((flags & HANG) == 0)
> + igt_fork_hang_detector(fd);
> + else
> + hang = igt_allow_hang(fd, 0, 0);
> + }
>
> - igt_fixture {
> - if ((flags & HANG) == 0)
> - igt_stop_hang_detector();
> - gem_quiescent_gpu(fd);
> + igt_subtest_f("%s%s-%s",
> + !e->exec_id && !(flags & HANG) ? "basic-" : "",
> + name, e->name)
> + busy(fd, e->exec_id | e->flags, flags);
> +
> + igt_subtest_f("%swait-%s-%s",
> + !e->exec_id && !(flags & HANG) ? "basic-" : "",
> + name, e->name)
> + busy(fd, e->exec_id | e->flags, flags | POLL);
> +
> + igt_fixture {
> + if ((flags & HANG) == 0)
> + igt_stop_hang_detector();
> + else
> + igt_disallow_hang(fd, hang);
> + }
> }
> }
>
> @@ -250,10 +238,7 @@ igt_main
>
> for (e = intel_execution_engines; e->name; e++) {
> for (const struct mode *m = modes; m->name; m++)
> - igt_subtest_group {
> - run_busy(fd, e, m->name, m->flags);
> - run_poll(fd, e, m->name, m->flags);
> - }
> + test_engine_mode(fd, e, m->name, m->flags);
> }
> }
>
> --
> 2.14.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2017-09-14 11:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-13 11:43 [PATCH igt] igt/prime_busy: Declare the hang tests expect to cause GPU hangs Chris Wilson
2017-09-13 15:12 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-09-14 2:46 ` ✓ Fi.CI.IGT: " Patchwork
2017-09-14 10:58 ` Mika Kuoppala [this message]
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=87zi9x1r8e.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@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