From patchwork Mon Aug 14 20:18:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9900059 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 15B0E602CA for ; Mon, 14 Aug 2017 20:19:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2ACB2832B for ; Mon, 14 Aug 2017 20:19:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7D34283C9; Mon, 14 Aug 2017 20:19:24 +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 6D4F82832B for ; Mon, 14 Aug 2017 20:19:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 819056E239; Mon, 14 Aug 2017 20:19:22 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id 391C76E239 for ; Mon, 14 Aug 2017 20:19:21 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 8258371-1500050 for multiple; Mon, 14 Aug 2017 21:19:14 +0100 Received: by haswell.alporthouse.com (sSMTP sendmail emulation); Mon, 14 Aug 2017 21:19:15 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Mon, 14 Aug 2017 21:18:36 +0100 Message-Id: <20170814201848.28216-12-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170814201848.28216-1-chris@chris-wilson.co.uk> References: <20170814201848.28216-1-chris@chris-wilson.co.uk> X-Originating-IP: 78.156.65.138 X-Country: code=GB country="United Kingdom" ip=78.156.65.138 Subject: [Intel-gfx] [PATCH igt 12/24] igt/gem_ringfill: Prime execbuf before measuring ring size 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 Make sure that our buffers are ready and loaded to reduce the initial stall. Reviewed-by: MichaƂ Winiarski --- tests/gem_ringfill.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c index b52996a4..01cbd0a9 100644 --- a/tests/gem_ringfill.c +++ b/tests/gem_ringfill.c @@ -288,10 +288,15 @@ static unsigned int measure_ring_size(int fd) obj[1].handle = gem_create(fd, 4096); gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe)); + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = to_user_pointer(obj + 1); + execbuf.buffer_count = 1; + gem_execbuf(fd, &execbuf); + gem_sync(fd, obj[1].handle); + plug(fd, &c); obj[0].handle = c.handle; - memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(obj); execbuf.buffer_count = 2; @@ -302,7 +307,8 @@ static unsigned int measure_ring_size(int fd) itv.it_value.tv_usec = 1000; setitimer(ITIMER_REAL, &itv, NULL); - last = count = 0; + last = -1; + count = 0; do { if (__execbuf(fd, &execbuf) == 0) { count++;