From patchwork Thu Sep 13 13:24:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10599571 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E04CD14DB for ; Thu, 13 Sep 2018 13:24:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF91320174 for ; Thu, 13 Sep 2018 13:24:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3A88271CB; Thu, 13 Sep 2018 13:24:44 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 7F74B20174 for ; Thu, 13 Sep 2018 13:24:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E14826E6A3; Thu, 13 Sep 2018 13:24:42 +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 D4AEE6E6A1; Thu, 13 Sep 2018 13:24:39 +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 13757035-1500050 for multiple; Thu, 13 Sep 2018 14:24:29 +0100 From: Chris Wilson To: igt-dev@lists.freedesktop.org Date: Thu, 13 Sep 2018 14:24:32 +0100 Message-Id: <20180913132432.4105-2-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913132432.4105-1-chris@chris-wilson.co.uk> References: <20180913132432.4105-1-chris@chris-wilson.co.uk> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 2/2] lib: Skip drmModeReources() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP An alternative to requiring the display is to mark the attached display as empty (no available CRTC, no outputs) and let the tests skip if they required any output. This allows the binary to open the display once in its global fixture, even if it doesn't use the display in every subtest and so avoid skipping the subtests that didn't require the display. Signed-off-by: Chris Wilson --- lib/igt_kms.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 0e6f91475..b38d64415 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1857,7 +1857,8 @@ void igt_display_init(igt_display_t *display, int drm_fd) display->drm_fd = drm_fd; resources = drmModeGetResources(display->drm_fd); - igt_require(resources); + if (!resources) + goto out; /* * We cache the number of pipes, that number is a physical limit of the @@ -2005,6 +2006,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) igt_display_reset(display); igt_kms_disallow_hotplug(drm_fd); +out: LOG_UNINDENT(display); }