From patchwork Thu Apr 13 10:02:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 9679077 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 12633601C3 for ; Thu, 13 Apr 2017 10:03:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03C4F2860E for ; Thu, 13 Apr 2017 10:03:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAC1A28652; Thu, 13 Apr 2017 10:03:44 +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 804ED2860E for ; Thu, 13 Apr 2017 10:03:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 923BB6E84D; Thu, 13 Apr 2017 10:03:43 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 48E3D6E84D for ; Thu, 13 Apr 2017 10:03:42 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Apr 2017 03:03:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.37,194,1488873600"; d="scan'208"; a="1155305481" Received: from rosetta.fi.intel.com ([10.237.72.186]) by fmsmga002.fm.intel.com with ESMTP; 13 Apr 2017 03:03:40 -0700 Received: by rosetta.fi.intel.com (Postfix, from userid 1000) id 1FA0B84194B; Thu, 13 Apr 2017 13:02:38 +0300 (EEST) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Thu, 13 Apr 2017 13:02:37 +0300 Message-Id: <1492077757-15264-1-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [Intel-gfx] [PATCH igt] tests/gem_spin_batch: Add multiengine test 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 Parallel spin on all engines. Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson --- tests/gem_spin_batch.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/tests/gem_spin_batch.c b/tests/gem_spin_batch.c index baf796a..a22da32 100644 --- a/tests/gem_spin_batch.c +++ b/tests/gem_spin_batch.c @@ -32,7 +32,7 @@ "'%s' != '%s' (%lld not within %d%% tolerance of %lld)\n",\ #x, #ref, (long long)x, tolerance, (long long)ref) -static void basic(int fd, unsigned int engine, unsigned int timeout_sec) +static void spin(int fd, unsigned int engine, unsigned int timeout_sec) { const uint64_t timeout_100ms = 100000000LL; unsigned long loops = 0; @@ -63,6 +63,30 @@ static void basic(int fd, unsigned int engine, unsigned int timeout_sec) igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); } +static void spin_exit_handler(int sig) +{ + igt_fixture { + igt_terminate_spin_batches(); + } +} + +static void spin_on_all_engines(int fd, unsigned int timeout_sec) +{ + unsigned engine; + + for_each_engine(fd, engine) { + if (engine == 0) + continue; + + igt_fork(child, 1) { + igt_install_exit_handler(spin_exit_handler); + spin(fd, engine, timeout_sec); + } + } + + igt_waitchildren(); +} + igt_main { const struct intel_execution_engine *e; @@ -82,9 +106,12 @@ igt_main continue; igt_subtest_f("basic-%s", e->name) - basic(fd, e->exec_id, 3); + spin(fd, e->exec_id, 3); } + igt_subtest("multiengine") + spin_on_all_engines(fd, 3); + igt_fixture { igt_stop_hang_detector(); close(fd);