From patchwork Fri Jun 9 17:02:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Argenziano X-Patchwork-Id: 9778931 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 82A9E60318 for ; Fri, 9 Jun 2017 17:03:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7421E2868D for ; Fri, 9 Jun 2017 17:03:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68DFC28692; Fri, 9 Jun 2017 17:03:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D1F3C2868D for ; Fri, 9 Jun 2017 17:03:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1941A6E6AF; Fri, 9 Jun 2017 17:03:14 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4BF6B6E6AF for ; Fri, 9 Jun 2017 17:03:12 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jun 2017 10:03:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,317,1493708400"; d="scan'208";a="866320611" Received: from relo-linux-2.fm.intel.com ([10.1.27.122]) by FMSMGA003.fm.intel.com with ESMTP; 09 Jun 2017 10:03:11 -0700 From: Antonio Argenziano To: intel-gfx@lists.freedesktop.org Date: Fri, 9 Jun 2017 10:02:58 -0700 Message-Id: <20170609170258.28201-1-antonio.argenziano@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [Intel-gfx] [i-g-t] igt/gem_reset_stats: Fix pending batches status expectation X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Test expects pending batches to be discarded after a reset. That is no longer the case. Fixed to expect a normal execution. Cc: Michel Thierry Signed-off-by: Antonio Argenziano Reviewed-by: Michel Thierry --- tests/gem_reset_stats.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c index c4ce4ac2..73afeeb2 100644 --- a/tests/gem_reset_stats.c +++ b/tests/gem_reset_stats.c @@ -239,7 +239,7 @@ static void test_rs(const struct intel_execution_engine *e, if (i == hang_index) assert_reset_status(i, fd[i], 0, RS_BATCH_ACTIVE); if (i > hang_index) - assert_reset_status(i, fd[i], 0, RS_BATCH_PENDING); + assert_reset_status(i, fd[i], 0, RS_NO_ERROR); } igt_assert(igt_seconds_elapsed(&ts_injected) <= 30); @@ -312,10 +312,10 @@ static void test_rs_ctx(const struct intel_execution_engine *e, RS_BATCH_ACTIVE); if (i == hang_index && j > hang_context) assert_reset_status(i, fd[i], ctx[i][j], - RS_BATCH_PENDING); + RS_NO_ERROR); if (i > hang_index) assert_reset_status(i, fd[i], ctx[i][j], - RS_BATCH_PENDING); + RS_NO_ERROR); } } @@ -330,7 +330,7 @@ static void test_ban(const struct intel_execution_engine *e) struct local_drm_i915_reset_stats rs_bad, rs_good; int fd_bad, fd_good; int ban, retry = 10; - int active_count = 0, pending_count = 0; + int active_count = 0; fd_bad = drm_open_driver(DRIVER_INTEL); fd_good = drm_open_driver(DRIVER_INTEL); @@ -350,9 +350,6 @@ static void test_ban(const struct intel_execution_engine *e) noop(fd_good, 0, e); noop(fd_good, 0, e); - /* The second hang will count as pending and be discarded */ - active_count--; - pending_count += 1; /* inject hang does 1 real exec + 1 dummy */ while (retry--) { inject_hang(fd_bad, 0, e, BAN); active_count++; @@ -373,12 +370,10 @@ static void test_ban(const struct intel_execution_engine *e) assert_reset_status(fd_bad, fd_bad, 0, RS_BATCH_ACTIVE); igt_assert_eq(gem_reset_stats(fd_bad, 0, &rs_bad), 0); igt_assert_eq(rs_bad.batch_active, active_count); - igt_assert_eq(rs_bad.batch_pending, pending_count); - assert_reset_status(fd_good, fd_good, 0, RS_BATCH_PENDING); + assert_reset_status(fd_good, fd_good, 0, RS_NO_ERROR); igt_assert_eq(gem_reset_stats(fd_good, 0, &rs_good), 0); igt_assert_eq(rs_good.batch_active, 0); - igt_assert_eq(rs_good.batch_pending, 2); close(fd_bad); close(fd_good); @@ -389,7 +384,7 @@ static void test_ban_ctx(const struct intel_execution_engine *e) struct local_drm_i915_reset_stats rs_bad, rs_good; int fd, ban, retry = 10; uint32_t ctx_good, ctx_bad; - int active_count = 0, pending_count = 0; + int active_count = 0; fd = drm_open_driver(DRIVER_INTEL); @@ -414,9 +409,6 @@ static void test_ban_ctx(const struct intel_execution_engine *e) noop(fd, ctx_good, e); noop(fd, ctx_good, e); - /* This second hang will count as pending and be discarded */ - active_count--; - pending_count++; while (retry--) { inject_hang(fd, ctx_bad, e, BAN); active_count++; @@ -437,12 +429,10 @@ static void test_ban_ctx(const struct intel_execution_engine *e) assert_reset_status(fd, fd, ctx_bad, RS_BATCH_ACTIVE); igt_assert_eq(gem_reset_stats(fd, ctx_bad, &rs_bad), 0); igt_assert_eq(rs_bad.batch_active, active_count); - igt_assert_eq(rs_bad.batch_pending, pending_count); - assert_reset_status(fd, fd, ctx_good, RS_BATCH_PENDING); + assert_reset_status(fd, fd, ctx_good, RS_NO_ERROR); igt_assert_eq(gem_reset_stats(fd, ctx_good, &rs_good), 0); igt_assert_eq(rs_good.batch_active, 0); - igt_assert_eq(rs_good.batch_pending, 2); close(fd); }