From patchwork Tue Oct 10 20:02:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Ekstrand X-Patchwork-Id: 9997411 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 79682601AE for ; Tue, 10 Oct 2017 20:02:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BB9828746 for ; Tue, 10 Oct 2017 20:02:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6061628755; Tue, 10 Oct 2017 20:02:32 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 DCCF628746 for ; Tue, 10 Oct 2017 20:02:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E9030898ED; Tue, 10 Oct 2017 20:02:30 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id F2DCE898ED for ; Tue, 10 Oct 2017 20:02:29 +0000 (UTC) Received: by mail-pf0-x243.google.com with SMTP id z11so20658352pfk.3 for ; Tue, 10 Oct 2017 13:02:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jlekstrand-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=eQqSyjIvCVxr3T/3lMXp5yGcV1Po05o1nTSHQjQsvcs=; b=NtZock+XVtQLx94DMjqzEsVKNVSR7N5defNxXhU+bCdeQi3Hw1Vj1sWovJJhbIDaKg bTGkGv2hfstEFqpctO1DKmb1Q7S1ziN8oWabC3NTIglEK0OkWambc7V8LV4R5IWQP0vr l1WmO6ZGnlFhWmDrDd1af1rZu0cwLmJuoTDrMaXMH8m/v37rdUizBriE0V+McGgrgeb4 Tu7z1WX94RHMzI4SiHh5kFKLMz+ifa8wQ098MgMEYRQYNAm/NobC8rcba8tEALHyupWA 2r5uij8M258S+a8Qkl7JzjL+eLCBRFlxfvNzWCpZM8ZDsVt8NqXRfJgkaXFIuRbF3XLe CEOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=eQqSyjIvCVxr3T/3lMXp5yGcV1Po05o1nTSHQjQsvcs=; b=h047fCWJf1We9yMn+s6Km0JdDgNmYjuuDkhHauiR8nK+qao8lMdrzDyS5sntPnjayh vL4j4OY3SfusKu3zKwrjJBFwfdvRzUObl5lMRrtqpRn4Y5drllTF/TvPCIcj3olB/UKP BDfZqdASEar5jFjLvokw+Ra+d6JVgUmfdcdLJUpmHDojo18BTxb5d1M867svMSu8JVAT hnRvyckjVXnQraz3Syc5GMsHdVqeIvXzjy3P8f1ThDulinUbAqt+U7wbjpL+xJU92jQo j3W0DYfkwz2hgCIEdmPIC9dWo0d9hZKTDi1lBecXUYNGhfiCZPrFB0SSgVysKPbKcJ7c cjHQ== X-Gm-Message-State: AMCzsaWlICxn5Fy4Dh5xPD0gJVpoNjgiZvHlm8HdKwbm+s24bbz9N9C3 asyOexmwkhCBbupZH4kSnJ+Wr7xhDqE= X-Google-Smtp-Source: AOwi7QCfkoI+66V7mUQ9ermxpnjBS37EwDVAPDzh6ZdnuAtP/gafIn4n9TtcF7yEvxDtEetRFcPtNw== X-Received: by 10.99.114.92 with SMTP id c28mr13415714pgn.342.1507665748857; Tue, 10 Oct 2017 13:02:28 -0700 (PDT) Received: from omlet.jf.intel.com ([192.55.55.41]) by smtp.gmail.com with ESMTPSA id b27sm17539247pfc.110.2017.10.10.13.02.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2017 13:02:27 -0700 (PDT) From: Jason Ekstrand X-Google-Original-From: Jason Ekstrand To: intel-gfx@lists.freedesktop.org Date: Tue, 10 Oct 2017 13:02:20 -0700 Message-Id: <1507665740-6703-1-git-send-email-jason.ekstrand@intel.com> X-Mailer: git-send-email 2.5.0.400.gff86faf Cc: Jason Ekstrand Subject: [Intel-gfx] [PATCH i-g-t] igt/syncobj_wait: Don't close the timeline early in wait_snapshot 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 Closing the sw_sync timeline now signals any remaining fences upon it; but test_wait_snapshot requires the fence to continue to be busy so that the __syncobj_wait() will return with -ETIME. Reviewed-by: Chris Wilson Tested-by: Chris Wilson --- tests/syncobj_wait.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/syncobj_wait.c b/tests/syncobj_wait.c index 385d8cd..1842f9c 100644 --- a/tests/syncobj_wait.c +++ b/tests/syncobj_wait.c @@ -525,7 +525,7 @@ test_wait_snapshot(int fd, uint32_t test_flags) { struct wait_thread_data wait = { 0 }; uint32_t syncobjs[2]; - int timelines[2] = { -1, -1 }; + int timelines[3] = { -1, -1, -1 }; pthread_t thread; syncobjs[0] = syncobj_create(fd, 0); @@ -570,8 +570,7 @@ test_wait_snapshot(int fd, uint32_t test_flags) * the kernel picks up on the new fence (it shouldn't), we'll get a * timeout. */ - close(timelines[0]); - timelines[0] = syncobj_attach_sw_sync(fd, syncobjs[0]); + timelines[2] = syncobj_attach_sw_sync(fd, syncobjs[0]); sleep_nsec(SHORT_TIME_NSEC / 5); @@ -589,6 +588,7 @@ test_wait_snapshot(int fd, uint32_t test_flags) close(timelines[0]); close(timelines[1]); + close(timelines[2]); syncobj_destroy(fd, syncobjs[0]); syncobj_destroy(fd, syncobjs[1]); }