From patchwork Fri Jun 26 11:52:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonas Lahtinen X-Patchwork-Id: 6680431 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4B3BB9F39B for ; Fri, 26 Jun 2015 11:52:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 547E0204EC for ; Fri, 26 Jun 2015 11:52:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2042F204E4 for ; Fri, 26 Jun 2015 11:52:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7D93B4A0A8; Fri, 26 Jun 2015 04:52:55 -0700 (PDT) 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 ESMTP id 2B8D94A0A8 for ; Fri, 26 Jun 2015 04:52:54 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 26 Jun 2015 04:52:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,684,1427785200"; d="scan'208";a="514622315" Received: from specio-mobl1.ger.corp.intel.com (HELO [10.252.19.36]) ([10.252.19.36]) by FMSMGA003.fm.intel.com with ESMTP; 26 Jun 2015 04:52:35 -0700 Message-ID: <1435319554.31369.0.camel@jlahtine-mobl1> From: Joonas Lahtinen To: intel-gfx Date: Fri, 26 Jun 2015 14:52:34 +0300 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t v3] tests/gem_ringfill: Add {render, blitter}-forked-1 subtests. 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add forking subtests to gem_ringfill. Tests cause consistent GPU hangs on SKL. v2: Removed noop parts. v3: - Allow executing the tests in order too (Chris Wilson). - Rename the tests to -forked-1 Cc: Mika Kuoppala Cc: Chris Wilson Signed-off-by: Joonas Lahtinen Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89959 --- tests/gem_ringfill.c | 91 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 57 insertions(+), 34 deletions(-) diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c index 85b01ea..06da1c2 100644 --- a/tests/gem_ringfill.c +++ b/tests/gem_ringfill.c @@ -55,6 +55,7 @@ struct bo { }; static const int width = 512, height = 512; +int fd; static void create_bo(drm_intel_bufmgr *bufmgr, struct bo *b, @@ -193,9 +194,52 @@ static void blt_copy(struct intel_batchbuffer *batch, intel_batchbuffer_flush(batch); } -drm_intel_bufmgr *bufmgr; -struct intel_batchbuffer *batch; -int fd; +static void run_test(int ring, bool interruptible, int nchild) { + drm_intel_bufmgr *bufmgr; + struct intel_batchbuffer *batch; + igt_render_copyfunc_t copy; + const char* ring_name; + + bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); + igt_require(bufmgr); + drm_intel_bufmgr_gem_enable_reuse(bufmgr); + + batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); + igt_require(batch); + + if (ring == I915_EXEC_RENDER) { + copy = igt_get_render_copyfunc(batch->devid); + ring_name = "render"; + } else if (ring == I915_EXEC_BLT) { + copy = blt_copy; + ring_name = "blt"; + } else { + igt_fail_on_f(true, "Unsupported ring."); + } + + /* Not all platforms have dedicated render ring. */ + igt_require(copy); + + if (interruptible) { + igt_fork_signal_helper(); + } + + if (nchild) { + igt_fork(child, nchild) { + check_ring(bufmgr, batch, ring_name, copy); + } + igt_waitchildren(); + } else { + check_ring(bufmgr, batch, ring_name, copy); + } + + if (interruptible) { + igt_stop_signal_helper(); + } + + intel_batchbuffer_free(batch); + drm_intel_bufmgr_destroy(bufmgr); +} igt_main { @@ -203,48 +247,27 @@ igt_main igt_fixture { fd = drm_open_any(); - - bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); - drm_intel_bufmgr_gem_enable_reuse(bufmgr); - batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); } igt_subtest("blitter") - check_ring(bufmgr, batch, "blt", blt_copy); + run_test(I915_EXEC_BLT, false, 0); - /* Strictly only required on architectures with a separate BLT ring, - * but lets stress everybody. - */ - igt_subtest("render") { - igt_render_copyfunc_t copy; - - copy = igt_get_render_copyfunc(batch->devid); - igt_require(copy); + igt_subtest("render") + run_test(I915_EXEC_RENDER, false, 0); - check_ring(bufmgr, batch, "render", copy); - } - - igt_fork_signal_helper(); igt_subtest("blitter-interruptible") - check_ring(bufmgr, batch, "blt", blt_copy); + run_test(I915_EXEC_BLT, true, 0); - /* Strictly only required on architectures with a separate BLT ring, - * but lets stress everybody. - */ - igt_subtest("render-interruptible") { - igt_render_copyfunc_t copy; + igt_subtest("render-interruptible") + run_test(I915_EXEC_RENDER, true, 0); - copy = igt_get_render_copyfunc(batch->devid); - igt_require(copy); + igt_subtest("blitter-forked-1") + run_test(I915_EXEC_BLT, false, 1); - check_ring(bufmgr, batch, "render", copy); - } - igt_stop_signal_helper(); + igt_subtest("render-forked-1") + run_test(I915_EXEC_RENDER, false, 1); igt_fixture { - intel_batchbuffer_free(batch); - drm_intel_bufmgr_destroy(bufmgr); - close(fd); } }