From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] i915/gem_workarounds: Verify regs directly
Date: Sat, 25 May 2019 08:05:25 +0100 [thread overview]
Message-ID: <20190525070525.22770-1-chris@chris-wilson.co.uk> (raw)
---
tests/i915/gem_workarounds.c | 45 +++++++++++++++++++++++++++++-------
1 file changed, 37 insertions(+), 8 deletions(-)
diff --git a/tests/i915/gem_workarounds.c b/tests/i915/gem_workarounds.c
index 44e3dce8a..bf8b4f630 100644
--- a/tests/i915/gem_workarounds.c
+++ b/tests/i915/gem_workarounds.c
@@ -82,6 +82,7 @@ static bool write_only(const uint32_t addr)
#define MI_STORE_REGISTER_MEM (0x24 << 23)
+#if 0
static int workaround_fail_count(int fd, uint32_t ctx)
{
struct drm_i915_gem_exec_object2 obj[2];
@@ -162,17 +163,45 @@ static int workaround_fail_count(int fd, uint32_t ctx)
return fail_count;
}
-
-static int reopen(int fd)
+#else
+static int workaround_fail_count(int i915, uint32_t ctx)
{
- char path[256];
+ igt_spin_t *spin;
+ int fail = 0;
+
+ intel_mmio_use_pci_bar(intel_get_pci_device());
+
+ spin = igt_spin_new(i915, .ctx = ctx, .flags = IGT_SPIN_POLL_RUN);
+ igt_spin_busywait_until_started(spin);
+
+ for (int i = 0; i < num_wa_regs; i++) {
+ uint32_t value =
+ *(uint32_t *)(igt_global_mmio + wa_regs[i].addr);
+ const bool ok =
+ (wa_regs[i].value & wa_regs[i].mask) ==
+ (value & wa_regs[i].mask);
+ char buf[80];
+
+ snprintf(buf, sizeof(buf),
+ "0x%05X\t0x%08X\t0x%08X\t0x%08X",
+ wa_regs[i].addr, wa_regs[i].value, wa_regs[i].mask,
+ value);
+
+ if (ok) {
+ igt_debug("%s\tOK\n", buf);
+ } else if (write_only(wa_regs[i].addr)) {
+ igt_debug("%s\tIGNORED (w/o)\n", buf);
+ } else {
+ igt_warn("%s\tFAIL\n", buf);
+ fail++;
+ }
+ }
- snprintf(path, sizeof(path), "/proc/self/fd/%d", fd);
- fd = open(path, O_RDWR);
- igt_assert_lte(0, fd);
+ igt_spin_free(i915, spin);
- return fd;
+ return fail;
}
+#endif
#define CONTEXT 0x1
#define FD 0x2
@@ -181,7 +210,7 @@ static void check_workarounds(int fd, enum operation op, unsigned int flags)
uint32_t ctx = 0;
if (flags & FD)
- fd = reopen(fd);
+ fd = gem_reopen_driver(fd);
if (flags & CONTEXT) {
gem_require_contexts(fd);
--
2.20.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next reply other threads:[~2019-05-25 7:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-25 7:05 Chris Wilson [this message]
2019-05-26 11:14 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/gem_workarounds: Verify regs directly Patchwork
2019-05-26 16:40 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-05-29 9:51 ` [igt-dev] [PATCH i-g-t] " Matthew Auld
-- strict thread matches above, loose matches on Subject: below --
2019-05-29 9:58 Chris Wilson
2019-05-29 10:15 ` Mika Kuoppala
2019-05-29 10:24 ` 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=20190525070525.22770-1-chris@chris-wilson.co.uk \
--to=chris@chris-wilson.co.uk \
--cc=igt-dev@lists.freedesktop.org \
--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