[Intel-gfx] [PATCH igt] lib/gt: Always eat the unwanted error state
Chris Wilson
chris at chris-wilson.co.uk
Fri Oct 20 14:20:22 UTC 2017
We only suppress the error state from the context, iff we triggering the
GPU reset by hangcheck (igt_hang_ring). If we trigger an immediate reset
via igt_force_gpu_reset(), we will populate the error-state but not free
it because we thought we have it suppressed by the context parameter.
Always eat the error after we expect a GPU reset, and have not specified
that we want to keep it.
The side-effect of keeping the error-state around after we deliberately
created it is that subsequent GPU hangs are not prominently recorded, as
the kernel believes they are secondary hangs (and we only announce the
first).
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
lib/igt_gt.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index f6cc20b0..89727d22 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -194,17 +194,18 @@ igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags)
void igt_disallow_hang(int fd, igt_hang_t arg)
{
- struct local_i915_gem_context_param param;
context_set_ban(fd, arg.ctx, arg.ban);
if ((arg.flags & HANG_ALLOW_CAPTURE) == 0) {
- param.context = arg.ctx;
- param.size = 0;
- param.param = LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE;
- param.value = 0;
- if (__gem_context_set_param(fd, ¶m))
- eat_error_state(fd);
+ struct local_i915_gem_context_param param = {
+ .context = arg.ctx,
+ .param = LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE,
+ .value = 0,
+ };
+ __gem_context_set_param(fd, ¶m);
+
+ eat_error_state(fd);
}
}
@@ -360,8 +361,6 @@ igt_hang_t igt_hang_ring(int fd, int ring)
*/
void igt_post_hang_ring(int fd, igt_hang_t arg)
{
- struct local_i915_gem_context_param param;
-
if (arg.handle == 0)
return;
@@ -372,12 +371,14 @@ void igt_post_hang_ring(int fd, igt_hang_t arg)
context_set_ban(fd, arg.ctx, arg.ban);
if ((arg.flags & HANG_ALLOW_CAPTURE) == 0) {
- param.context = arg.ctx;
- param.size = 0;
- param.param = LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE;
- param.value = 0;
- if (__gem_context_set_param(fd, ¶m))
- eat_error_state(fd);
+ struct local_i915_gem_context_param param = {
+ .context = arg.ctx,
+ .param = LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE,
+ .value = 0,
+ };
+ __gem_context_set_param(fd, ¶m);
+
+ eat_error_state(fd);
}
}
--
2.15.0.rc1
More information about the Intel-gfx
mailing list