From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Daniel Vetter <daniel@ffwll.ch>,
intel-gfx@lists.freedesktop.org,
Daniel Vetter <daniel.vetter@ffwll.ch>,
Tim Gore <tim.gore@intel.com>, Tomas Elf <tomas.elf@intel.com>
Subject: Re: [PATCH] drm/i915: Report to userspace if we have a (presumed) working GPU reset
Date: Mon, 15 Jun 2015 17:01:24 +0200 [thread overview]
Message-ID: <20150615150124.GZ8341@phenom.ffwll.local> (raw)
In-Reply-To: <20150615135817.GB28462@nuc-i3427.alporthouse.com>
On Mon, Jun 15, 2015 at 02:58:17PM +0100, Chris Wilson wrote:
> On Mon, Jun 15, 2015 at 02:53:41PM +0100, Chris Wilson wrote:
> > On Mon, Jun 15, 2015 at 03:45:38PM +0200, Daniel Vetter wrote:
> > > On Mon, Jun 15, 2015 at 12:23:48PM +0100, Chris Wilson wrote:
> > > > In igt, we want to test handling of GPU hangs, both for recovery
> > > > purposes and for reporting. However, we don't want to inject a genuine
> > > > GPU hang onto a machine that cannot recover and so be permenantly
> > > > wedged. Rather than embed heuristics into igt, have the kernel report
> > > > exactly when it expects the GPU reset to work.
> > > >
> > > > This can also be usefully extended in future to indicate different
> > > > levels of fine-grained resets.
> > > >
> > > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > > > Cc: Tim Gore <tim.gore@intel.com>
> > > > Cc: Tomas Elf <tomas.elf@intel.com>
> > >
> > > Yeah makes sense. Will merge as soon as someone smashes a t-b with a few
> > > igt patches using this on top.
> >
> > diff --git a/lib/igt_gt.c b/lib/igt_gt.c
> > index deb5560..8a1ffb2 100644
> > --- a/lib/igt_gt.c
> > +++ b/lib/igt_gt.c
> > @@ -26,6 +26,7 @@
> > #include <errno.h>
> > #include <sys/types.h>
> > #include <sys/stat.h>
> > +#include <sys/ioctl.h>
> > #include <fcntl.h>
> >
> > #include "drmtest.h"
> > @@ -47,6 +48,21 @@
> > * engines.
> > */
> >
> > +static bool has_gpu_reset(int fd)
> > +{
> > + struct drm_i915_getparam gp;
> > + int val = 0;
> > +
> > + memset(&gp, 0, sizeof(gp));
> > + gp.param = 35; /* HAS_GPU_RESET */
> > + gp.value = &val;
> > +
> > + if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp)))
> > + return intel_gen(intel_get_drm_devid(fd)) >= 5;
> > +
> > + return val > 0;
> > +}
> >
> > /**
> > * igt_require_hang_ring:
> > @@ -60,7 +76,7 @@
> > void igt_require_hang_ring(int fd, int ring)
> > {
> > gem_context_require_ban_period(fd);
> > - igt_require(intel_gen(intel_get_drm_devid(fd)) >= 5);
> > + igt_require(has_gpu_reset(fd));
> > }
Count me convinced, patch applied ;-)
> Speaking of which, do we want
> igt_require(getenv("IGT_DISABLE_HANG") == NULL);
> here?
Well igt_require(!igt_check_boolean_env_var(IGT_DISABLE_HANG, false)); but
tbh I'm not sure of that. Filtering testcases with piglit using -x hang
should amount to the same really.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2015-06-15 14:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-15 11:23 [PATCH] drm/i915: Report to userspace if we have a (presumed) working GPU reset Chris Wilson
2015-06-15 13:45 ` Daniel Vetter
2015-06-15 13:53 ` Chris Wilson
2015-06-15 13:58 ` Chris Wilson
2015-06-15 15:01 ` Daniel Vetter [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=20150615150124.GZ8341@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tim.gore@intel.com \
--cc=tomas.elf@intel.com \
/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