All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH igt 6/9] igt/kms_pipe_crc_basic: Replace stop_rings with igt_hang_ring
Date: Sat, 12 Dec 2015 20:02:52 +0000	[thread overview]
Message-ID: <1449950575-21012-6-git-send-email-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <1449950575-21012-1-git-send-email-chris@chris-wilson.co.uk>

We can inject a real GPU hang for greater effect!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/kms_pipe_crc_basic.c | 55 ++++------------------------------------------
 1 file changed, 4 insertions(+), 51 deletions(-)

diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index a3292c2..f33ca41 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -43,55 +43,6 @@ static struct {
 	{ .r = 0.0, .g = 1.0, .b = 1.0 },
 };
 
-static uint64_t submit_batch(int fd, unsigned ring_id)
-{
-	const uint32_t batch[] = { MI_NOOP,
-				   MI_BATCH_BUFFER_END };
-	struct drm_i915_gem_execbuffer2 execbuf;
-	struct drm_i915_gem_exec_object2 exec;
-	uint64_t presumed_offset;
-
-	gem_require_ring(fd, ring_id);
-
-	exec.handle = gem_create(fd, 4096);
-	gem_write(fd, exec.handle, 0, batch, sizeof(batch));
-	exec.relocation_count = 0;
-	exec.relocs_ptr = 0;
-	exec.alignment = 0;
-	exec.offset = 0;
-	exec.flags = 0;
-	exec.rsvd1 = 0;
-	exec.rsvd2 = 0;
-
-	execbuf.buffers_ptr = (uintptr_t)&exec;
-	execbuf.buffer_count = 1;
-	execbuf.batch_start_offset = 0;
-	execbuf.batch_len = sizeof(batch);
-	execbuf.cliprects_ptr = 0;
-	execbuf.num_cliprects = 0;
-	execbuf.DR1 = 0;
-	execbuf.DR4 = 0;
-	execbuf.flags = ring_id;
-	i915_execbuffer2_set_context_id(execbuf, 0);
-	execbuf.rsvd2 = 0;
-
-	gem_execbuf(fd, &execbuf);
-	gem_sync(fd, exec.handle);
-	presumed_offset = exec.offset;
-
-	igt_set_stop_rings(igt_to_stop_ring_flag(ring_id));
-
-	gem_execbuf(fd, &execbuf);
-	gem_sync(fd, exec.handle);
-
-	igt_assert(igt_get_stop_rings() == STOP_RING_NONE);
-	igt_assert(presumed_offset == exec.offset);
-
-	gem_close(fd, exec.handle);
-
-	return exec.offset;
-}
-
 static void test_bad_command(data_t *data, const char *cmd)
 {
 	FILE *ctl;
@@ -253,8 +204,10 @@ igt_main
 		}
 
 		igt_subtest_f("hang-read-crc-pipe-%c", 'A'+i) {
-			submit_batch(data.drm_fd, I915_EXEC_RENDER);
-
+			igt_hang_ring_t hang =
+				igt_hang_ring(data.drm_fd, I915_EXEC_RENDER);
+			test_read_crc(&data, i, 0);
+			igt_post_hang_ring(data.drm_fd, hang);
 			test_read_crc(&data, i, 0);
 		}
 	}
-- 
2.6.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-12-12 20:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-12 20:02 [PATCH igt 1/9] lib: Always double check igt_require_hang_ring() on use Chris Wilson
2015-12-12 20:02 ` [PATCH igt 2/9] lib: Expand igt_hang_ring() to select target context and various options Chris Wilson
2015-12-12 20:02 ` [PATCH igt 3/9] igt/drv_hangman: Inject a true hang Chris Wilson
2015-12-16  9:02   ` Daniel Vetter
2015-12-16 10:37     ` Chris Wilson
2015-12-16 13:12       ` Ville Syrjälä
2015-12-16 13:51         ` Chris Wilson
2015-12-16 14:03           ` Chris Wilson
2015-12-12 20:02 ` [PATCH igt 4/9] igt/gem_ctx_exec: Convert from stop-rings to a real GPU hang/reset Chris Wilson
2015-12-12 20:02 ` [PATCH igt 5/9] igt/gem_reset_stats: Convert from stop-rings to real hang injection Chris Wilson
2015-12-12 20:02 ` Chris Wilson [this message]
2015-12-12 20:02 ` [PATCH igt 7/9] igt/kms_flip: Convert over " Chris Wilson
2015-12-12 20:02 ` [PATCH igt 8/9] igt/gem_workarounds: Convert to real GPU " Chris Wilson
2015-12-12 20:02 ` [PATCH igt 9/9] igt/pm_rps: Trigger a real GPU reset Chris Wilson

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=1449950575-21012-6-git-send-email-chris@chris-wilson.co.uk \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.