[Intel-gfx] [PATCH i-g-t v3] igt/gem_workarounds: Test all types of workarounds
Chris Wilson
chris at chris-wilson.co.uk
Sun Oct 15 20:59:22 UTC 2017
Quoting Oscar Mateo (2017-10-13 21:55:59)
> @@ -134,20 +147,20 @@ static int workaround_fail_count(int fd, uint32_t ctx)
> igt_debug("Address val mask read result\n");
>
> out = gem_mmap__cpu(fd, obj[0].handle, 0, result_sz, PROT_READ);
> - for (int i = 0; i < num_wa_regs; i++) {
> + for (int i = 0; i < num_ctx_wa_regs; i++) {
> const bool ok =
> - (wa_regs[i].value & wa_regs[i].mask) ==
> - (out[i] & wa_regs[i].mask);
> + (ctx_wa_regs[i].value & ctx_wa_regs[i].mask) ==
> + (out[i] & ctx_wa_regs[i].mask);
> char buf[80];
>
> snprintf(buf, sizeof(buf),
> "0x%05X 0x%08X 0x%08X 0x%08X",
> - wa_regs[i].addr, wa_regs[i].value, wa_regs[i].mask,
> + ctx_wa_regs[i].addr, ctx_wa_regs[i].value, ctx_wa_regs[i].mask,
> out[i]);
>
> if (ok) {
> igt_debug("%s OK\n", buf);
> - } else if (write_only(wa_regs[i].addr)) {
> + } else if (write_only(ctx_wa_regs[i].addr)) {
> igt_debug("%s IGNORED (w/o)\n", buf);
> } else {
> igt_warn("%s FAIL\n", buf);
> @@ -163,6 +176,58 @@ static int workaround_fail_count(int fd, uint32_t ctx)
> return fail_count;
> }
>
> +static int mmio_workarounds_fail_count(struct intel_wa_reg *wa_regs, int num_wa_regs)
> +{
> + int i, fail_count = 0;
> +
> + if (!num_wa_regs)
> + return 0;
> +
> + igt_debug("Address val mask read result\n");
> +
> + for (i = 0; i < num_wa_regs; ++i) {
> + const uint32_t val = intel_register_read(wa_regs[i].addr);
> + const bool ok = (wa_regs[i].value & wa_regs[i].mask) ==
> + (val & wa_regs[i].mask);
> +
> + igt_debug("0x%05X 0x%08X 0x%08X 0x%08X %s\n",
> + wa_regs[i].addr, wa_regs[i].value,
> + wa_regs[i].mask, val, ok ? "OK" : "FAIL");
> +
> + if (write_only(wa_regs[i].addr))
> + continue;
> +
> + if (!ok) {
> + igt_warn("0x%05X 0x%08X 0x%08X 0x%08X %s\n",
> + wa_regs[i].addr, wa_regs[i].value,
> + wa_regs[i].mask, val, ok ? "OK" : "FAIL");
> + fail_count++;
Ugh, not the debug then duplicate warn again (and not telling us about
the ignored). My vote is that we feed the result into a single pretty
printer (based on the current ctx w/a checker) for all loops and
remember to include the type (whether ctx, gt, display etc).
-Chris
More information about the Intel-gfx
mailing list