From patchwork Wed Nov 20 14:58:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 3213371 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C90A5C045B for ; Wed, 20 Nov 2013 14:58:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3912C2076A for ; Wed, 20 Nov 2013 14:58:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 37C5220767 for ; Wed, 20 Nov 2013 14:58:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4195710684F; Wed, 20 Nov 2013 06:58:31 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id AF4D7105F41 for ; Wed, 20 Nov 2013 06:58:29 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 20 Nov 2013 06:58:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,737,1378882800"; d="scan'208";a="436679263" Received: from rosetta.fi.intel.com (HELO rosetta) ([10.237.72.60]) by fmsmga002.fm.intel.com with ESMTP; 20 Nov 2013 06:58:27 -0800 Received: by rosetta (Postfix, from userid 1000) id 0E0688006F; Wed, 20 Nov 2013 16:58:31 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Wed, 20 Nov 2013 16:58:15 +0200 Message-Id: <1384959497-25533-1-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.7.9.5 Subject: [Intel-gfx] [PATCH 1/3] tests/gem_reset_stats: add support for BDW+ X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 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 For BDW+, there BATCH_BUFFER_START is 3 * 32bits in length and length needs to be encoded into the opcode. Suggested-by: Damien Lespiau Signed-off-by: Mika Kuoppala --- tests/gem_reset_stats.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c index 07dfac4..a7497f3 100644 --- a/tests/gem_reset_stats.c +++ b/tests/gem_reset_stats.c @@ -202,9 +202,13 @@ static int inject_hang(int fd, int ctx) uint64_t gtt_off; uint32_t *buf; int roff, i; + unsigned cmd_len = 2; srandom(time(NULL)); + if (intel_gen(intel_get_drm_devid(fd)) >= 8) + cmd_len = 3; + buf = malloc(BUFSIZE); igt_assert(buf != NULL); @@ -240,9 +244,11 @@ static int inject_hang(int fd, int ctx) for (i = 0; i < ITEMS; i++) buf[i] = MI_NOOP; - roff = random() % (ITEMS - 2); - buf[roff] = MI_BATCH_BUFFER_START; - buf[roff + 1] = gtt_off + (roff << 2); + roff = random() % (ITEMS - cmd_len); + buf[roff] = MI_BATCH_BUFFER_START | (cmd_len - 2); + buf[roff + 1] = (gtt_off & 0xfffffffc) + (roff << 2); + if (cmd_len == 3) + buf[roff + 2] = gtt_off & 0xffffffff00000000ull; #ifdef VERBOSE printf("loop injected at 0x%lx (off 0x%x, bo_start 0x%lx, bo_end 0x%lx)\n",