as some tests, like drv_hangman, sets the flags with script and then expects them to stick. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78322 Signed-off-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxx> --- lib/drmtest.c | 17 +++++++++-------- lib/igt_core.h | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index bd72e49..de710eb 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -88,15 +88,16 @@ is_intel(int fd) return IS_INTEL(devid); } -static void check_stop_rings(void) +static void check_stop_rings(const bool at_exit) { enum stop_ring_flags flags; flags = igt_get_stop_rings(); igt_warn_on_f(flags != 0, - "i915_ring_stop flags on exit 0x%x, can't quiescent gpu cleanly\n", - flags); + "i915_ring_stop flags 0x%x on test %s, %s\n", + flags, at_exit ? "exit" : "start", + at_exit ? "can't quiescent gpu cleanly" : "ignoring"); - if (flags) + if (at_exit && flags) igt_set_stop_rings(STOP_RING_NONE); } @@ -120,8 +121,6 @@ void gem_quiescent_gpu(int fd) struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 gem_exec[1]; - check_stop_rings(); - handle = gem_create(fd, 4096); gem_write(fd, handle, 0, batch, sizeof(batch)); @@ -266,7 +265,7 @@ static void quiescent_gpu_at_exit(int sig) if (at_exit_drm_fd < 0) return; - check_stop_rings(); + check_stop_rings(true); gem_quiescent_gpu(at_exit_drm_fd); close(at_exit_drm_fd); at_exit_drm_fd = -1; @@ -277,7 +276,7 @@ static void quiescent_gpu_at_exit_render(int sig) if (at_exit_drm_render_fd < 0) return; - check_stop_rings(); + check_stop_rings(true); gem_quiescent_gpu(at_exit_drm_render_fd); close(at_exit_drm_render_fd); at_exit_drm_render_fd = -1; @@ -301,6 +300,7 @@ int drm_open_any(void) if (__sync_fetch_and_add(&open_count, 1)) return fd; + check_stop_rings(false); gem_quiescent_gpu(fd); at_exit_drm_fd = __drm_open_any(); igt_install_exit_handler(quiescent_gpu_at_exit); @@ -329,6 +329,7 @@ int drm_open_any_render(void) return fd; at_exit_drm_render_fd = __drm_open_any(); + check_stop_rings(false); gem_quiescent_gpu(fd); igt_install_exit_handler(quiescent_gpu_at_exit_render); diff --git a/lib/igt_core.h b/lib/igt_core.h index f7f7015..3220381 100644 --- a/lib/igt_core.h +++ b/lib/igt_core.h @@ -458,7 +458,7 @@ extern enum igt_log_level igt_log_level; */ #define igt_warn_on(condition) do {\ if (condition) \ - igt_warn("Warning on condition %s in fucntion %s, file %s:%i\n", \ + igt_warn("Warning on condition %s in function %s, file %s:%i\n", \ #condition, __func__, __FILE__, __LINE__); \ } while (0) -- 1.7.9.5 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx