summaryrefslogtreecommitdiff
path: root/lib/igt_gt.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-10-20 15:16:39 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-10-25 10:01:47 +0100
commite2598d4ec8358388d2fc2d65171665d0eb5329ec (patch)
treebf6c8a1200e0884aed69e9d452cd9a8edc50c5ac /lib/igt_gt.c
parent45a253e34b063426d18cdf02319eb6f6bc238e6b (diff)
lib/gt: Always eat the unwanted error state
We only suppress the error state from the context, iff we trigger 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@chris-wilson.co.uk> Reviewed-by: MichaƂ Winiarski <michal.winiarski@intel.com>
Diffstat (limited to 'lib/igt_gt.c')
-rw-r--r--lib/igt_gt.c31
1 files 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, &param))
- 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, &param);
+
+ 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, &param))
- 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, &param);
+
+ eat_error_state(fd);
}
}