From patchwork Thu Dec 14 22:01:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Argenziano X-Patchwork-Id: 10113361 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 9584260352 for ; Thu, 14 Dec 2017 22:01:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88374298A0 for ; Thu, 14 Dec 2017 22:01:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CF9E29B4E; Thu, 14 Dec 2017 22:01:37 +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 174F3298A0 for ; Thu, 14 Dec 2017 22:01:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C6B776E734; Thu, 14 Dec 2017 22:01:36 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 09ED46E734 for ; Thu, 14 Dec 2017 22:01:34 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Dec 2017 14:01:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,401,1508828400"; d="scan'208";a="2799064" Received: from relo-linux-2.fm.intel.com ([10.1.27.122]) by orsmga007.jf.intel.com with ESMTP; 14 Dec 2017 14:01:34 -0800 From: Antonio Argenziano To: intel-gfx@lists.freedesktop.org Date: Thu, 14 Dec 2017 14:01:31 -0800 Message-Id: <20171214220131.11884-1-antonio.argenziano@intel.com> X-Mailer: git-send-email 2.14.2 Subject: [Intel-gfx] [PATCH i-g-t] tests/gem_eio: Fix usage of gem_quiescent_gpu 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 After change "lib: Ask the kernel to quiesce the GPU" was merged, gem_quiescent_gpu() would not submit noop batches to all engines therefore the test should submit the workload and use the library function to wait for the workload to complete. Cc: Chris Wilson Cc: Mika Kuoppala Cc: Joonas Lahtinen Signed-off-by: Antonio Argenziano --- tests/gem_eio.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tests/gem_eio.c b/tests/gem_eio.c index 2ac9f0a9..868f2236 100644 --- a/tests/gem_eio.c +++ b/tests/gem_eio.c @@ -60,13 +60,41 @@ static bool i915_reset_control(bool enable) return ret; } +static void noop(int fd, unsigned flags) +{ + const uint32_t bbe = MI_BATCH_BUFFER_END; + struct drm_i915_gem_execbuffer2 eb; + struct drm_i915_gem_exec_object2 exec; + + memset(&exec, 0, sizeof(exec)); + exec.handle = gem_create(fd, 4096); + igt_assert((int)exec.handle > 0); + gem_write(fd, exec.handle, 0, &bbe, sizeof(bbe)); + + memset(&eb, 0, sizeof(eb)); + eb.buffers_ptr = to_user_pointer(&exec); + eb.buffer_count = 1; + eb.flags = flags; + + gem_execbuf(fd, &eb); +} + +static void noop_all_engines(int fd) +{ + unsigned engine; + for_each_engine(fd, engine) + noop(fd, engine); + + gem_quiescent_gpu(fd); +} + static void trigger_reset(int fd) { igt_force_gpu_reset(fd); /* And just check the gpu is indeed running again */ igt_debug("Checking that the GPU recovered\n"); - gem_quiescent_gpu(fd); + noop_all_engines(fd); } static void wedge_gpu(int fd)