From patchwork Wed Jun 28 18:37:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Thierry X-Patchwork-Id: 9815025 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 5358060365 for ; Wed, 28 Jun 2017 18:37:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BD1228417 for ; Wed, 28 Jun 2017 18:37:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 405EC28488; Wed, 28 Jun 2017 18:37:36 +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 E4B6828417 for ; Wed, 28 Jun 2017 18:37:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7969889F4A; Wed, 28 Jun 2017 18:37:35 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 360B289F4A for ; Wed, 28 Jun 2017 18:37:34 +0000 (UTC) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2017 11:37:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,276,1496127600"; d="scan'208";a="118527135" Received: from relo-linux-11.sc.intel.com ([10.3.160.214]) by orsmga005.jf.intel.com with ESMTP; 28 Jun 2017 11:37:33 -0700 From: Michel Thierry To: intel-gfx@lists.freedesktop.org Date: Wed, 28 Jun 2017 11:37:33 -0700 Message-Id: <20170628183733.30055-1-michel.thierry@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170620182502.28553-3-michel.thierry@intel.com> References: <20170620182502.28553-3-michel.thierry@intel.com> Subject: [Intel-gfx] [PATCH i-g-t v2 2/2] tests/gem_reset_stats: Enforce full chip reset mode before run 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 Platforms with per-engine reset enabled (i915.reset=2) are unlikely to perform a full chip reset, keeping the reset_count unmodified. In order to keep the expectations of this test, enforce that full GPU reset is enabled (i915.reset=1). Later on, we can expand the reset_stats ioctl to also return the number of per-engine resets and use reset_count + reset_engine_count when checking for the updated reset count. v2: Rebase, don't use gem_gpu_reset_type directly, since we now have additional helpers. Cc: Arkadiusz Hiler Signed-off-by: Michel Thierry --- tests/gem_reset_stats.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c index 73afeeb2..9ac08aab 100644 --- a/tests/gem_reset_stats.c +++ b/tests/gem_reset_stats.c @@ -27,6 +27,8 @@ #define _GNU_SOURCE #include "igt.h" +#include "igt_sysfs.h" +#include #include #include #include @@ -777,15 +779,24 @@ igt_main int fd; bool has_reset_stats; + bool using_full_reset; fd = drm_open_driver(DRIVER_INTEL); devid = intel_get_drm_devid(fd); has_reset_stats = gem_has_reset_stats(fd); + igt_assert(igt_sysfs_set_parameter + (fd, "reset", "%d", 1 /* only global reset */)); + + using_full_reset = !gem_engine_reset_enabled(fd) && + gem_gpu_reset_enabled(fd); + close(fd); igt_require_f(has_reset_stats, "No reset stats ioctl support. Too old kernel?\n"); + igt_require_f(using_full_reset, + "Full GPU reset is not enabled. Is enable_hangcheck set?\n"); } igt_subtest("params") @@ -831,4 +842,13 @@ igt_main igt_subtest_f("defer-hangcheck-%s", e->name) RUN_TEST(defer_hangcheck(e)); } + + igt_fixture { + int fd; + + fd = drm_open_driver(DRIVER_INTEL); + igt_assert(igt_sysfs_set_parameter + (fd, "reset", "%d", INT_MAX /* any reset method */)); + close(fd); + } }