All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.william.auld@gmail.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] i915/gem_workarounds: Verify regs directly
Date: Wed, 29 May 2019 10:51:04 +0100	[thread overview]
Message-ID: <CAM0jSHO6Fja_BQDG0593acmyP2st90E_dO4W5HWV5KtdFAUFgw@mail.gmail.com> (raw)
In-Reply-To: <20190525070525.22770-1-chris@chris-wilson.co.uk>

On Sat, 25 May 2019 at 08:05, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
> ---

Reviewed-by: Matthew Auld <matthew.auld@intel.com>

>  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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Matthew Auld <matthew.william.auld@gmail.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] i915/gem_workarounds: Verify regs directly
Date: Wed, 29 May 2019 10:51:04 +0100	[thread overview]
Message-ID: <CAM0jSHO6Fja_BQDG0593acmyP2st90E_dO4W5HWV5KtdFAUFgw@mail.gmail.com> (raw)
In-Reply-To: <20190525070525.22770-1-chris@chris-wilson.co.uk>

On Sat, 25 May 2019 at 08:05, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
> ---

Reviewed-by: Matthew Auld <matthew.auld@intel.com>

>  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
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-05-29  9:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-25  7:05 [PATCH i-g-t] i915/gem_workarounds: Verify regs directly Chris Wilson
2019-05-25  7:05 ` [igt-dev] " Chris Wilson
2019-05-26 11:14 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-05-26 16:40 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-05-29  9:51 ` Matthew Auld [this message]
2019-05-29  9:51   ` [igt-dev] [PATCH i-g-t] " Matthew Auld
2019-05-29  9:58 Chris Wilson
2019-05-29 10:15 ` Mika Kuoppala
2019-05-29 10:15   ` Mika Kuoppala
2019-05-29 10:24   ` Chris Wilson
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=CAM0jSHO6Fja_BQDG0593acmyP2st90E_dO4W5HWV5KtdFAUFgw@mail.gmail.com \
    --to=matthew.william.auld@gmail.com \
    --cc=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 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.