From patchwork Mon Nov 14 20:51:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Bragg X-Patchwork-Id: 9428357 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 8FE3F6047D for ; Mon, 14 Nov 2016 20:51:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8172128ADC for ; Mon, 14 Nov 2016 20:51:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7697B28AE3; Mon, 14 Nov 2016 20:51:54 +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 1846228ADC for ; Mon, 14 Nov 2016 20:51:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 62CE26E510; Mon, 14 Nov 2016 20:51:53 +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 967736E511 for ; Mon, 14 Nov 2016 20:51:51 +0000 (UTC) Received: by mail-pf0-x243.google.com with SMTP id i88so6654293pfk.2 for ; Mon, 14 Nov 2016 12:51:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=SIVz3TTxKB5kBA6hyDpVmqUvWveINU/mvkMHFeV0PRo=; b=rpMdLcWoG5qLE70ju9e+CFTRhLs9T+6m4hxDvtIxlZjuBjQpmly/LE7eV1pMYHivlL Aj0CSSAcSAqUAY2JREYB0qb3oKifbaIPdurMNwaXDDvY5DQCxxcoxQ6DjYsnnciMrJ8p G4wi59qorkSNQMT7tl1JfQVSVQwtcmwOkrmbkdmwmXiqzHofP9GOo7X7sAGxLi/87Cgr 7OFc3oGjo1NXwONffldn9aI9ANvJ8Dp6RIg9Ch1DFTOrCG93DmsOBJyzgtz80RBf+C0b 4IcbCiI4yfzWT/W4RGzFxAYG/q57M+wkfgCdMwqDVl6QAWF6CqhE8NMU3mYO1qbWu7jR aVtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=SIVz3TTxKB5kBA6hyDpVmqUvWveINU/mvkMHFeV0PRo=; b=QLtuYKNKRQOdlM37yIT4nmh74ujWm6MMMbeZ1GQq/VQFe1WrC7VzJvbkf8/kkfw0m1 /mHhLqX9Yoc08M6AL6bsNEasrbwf8dCQGGqwYe0zEl/Zs9Cl7hDRJ7LU5Ak2dOSWq8xz 0uUtEn7UxcWHjAkKGVKxaxKgRcQDBCyf6Oj56Ndde1bYbKiipt5gDJhgsvrTyevBoL1x UmBiT5BCmrVunqGezECa3xhNvI8vXWzkvQI+ICXpibxyf3d+IL1wqDTh6Bex7+zKZZ52 n7uVw9NyO5wmxwEOojVpdLN/hJ7TZ/Soyp3zIBN5OABt01cUyAC20y7Tmy//9fupTXJC XNHg== X-Gm-Message-State: ABUngvfKvG7ffHnVVRKcsAMo5erlOH84QfsrZn4dJxFy9i2hJ9OMhPJWxoh4HrEoSINflg== X-Received: by 10.99.0.194 with SMTP id 185mr40386812pga.111.1479156710964; Mon, 14 Nov 2016 12:51:50 -0800 (PST) Received: from sixbynine.org (cpc26-heme10-2-0-cust305.9-1.cable.virginm.net. [86.3.57.50]) by smtp.gmail.com with ESMTPSA id bc9sm37343841pad.34.2016.11.14.12.51.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Nov 2016 12:51:50 -0800 (PST) From: Robert Bragg To: intel-gfx@lists.freedesktop.org Date: Mon, 14 Nov 2016 20:51:15 +0000 Message-Id: <20161114205122.10742-7-robert@sixbynine.org> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161114205122.10742-1-robert@sixbynine.org> References: <20161114205122.10742-1-robert@sixbynine.org> Subject: [Intel-gfx] [PATCH igt v4 06/13] igt/gem_exec_parse: init global parser_version in fixture 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 This adds a static global int parser_version that can be referenced by all subtests without needing multiple GETPARAM requests. Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- tests/gem_exec_parse.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index ebcd092..9e57ff5 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -51,6 +51,7 @@ #define PIPE_CONTROL_QW_WRITE (1<<14) #define PIPE_CONTROL_LRI_POST_OP (1<<23) +static int parser_version; static int command_parser_version(int fd) { @@ -341,7 +342,7 @@ static void hsw_load_register_reg(void) fd = drm_open_driver(DRIVER_INTEL); igt_require(IS_HASWELL(intel_get_drm_devid(fd))); - igt_require(command_parser_version(fd) >= 7); + igt_require(parser_version >= 7); handle = gem_create(fd, 4096); @@ -381,16 +382,10 @@ igt_main int fd; igt_fixture { - int parser_version = 0; - drm_i915_getparam_t gp; - int rc; - fd = drm_open_driver(DRIVER_INTEL); - gp.param = I915_PARAM_CMD_PARSER_VERSION; - gp.value = &parser_version; - rc = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); - igt_require(!rc && parser_version > 0); + parser_version = command_parser_version(fd); + igt_require(parser_version != -1); igt_require(gem_uses_ppgtt(fd));