From patchwork Wed Sep 27 18:37:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Anholt X-Patchwork-Id: 9974567 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 11D2B60375 for ; Wed, 27 Sep 2017 18:38:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A260292B5 for ; Wed, 27 Sep 2017 18:38:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F330C292BA; Wed, 27 Sep 2017 18:38:11 +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 B25A1292C3 for ; Wed, 27 Sep 2017 18:38:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF7AB6E7C0; Wed, 27 Sep 2017 18:37:41 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from anholt.net (anholt.net [50.246.234.109]) by gabe.freedesktop.org (Postfix) with ESMTP id B894D6E041 for ; Wed, 27 Sep 2017 18:37:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id 99C1F10A122F; Wed, 27 Sep 2017 11:37:38 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at anholt.net Received: from anholt.net ([127.0.0.1]) by localhost (kingsolver.anholt.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3j7HIx0-XlH9; Wed, 27 Sep 2017 11:37:37 -0700 (PDT) Received: from eliezer.anholt.net (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id 1059A10A12DE; Wed, 27 Sep 2017 11:37:36 -0700 (PDT) Received: by eliezer.anholt.net (Postfix, from userid 1000) id 29B772FE21E1; Wed, 27 Sep 2017 11:37:35 -0700 (PDT) From: Eric Anholt To: intel-gfx@lists.freedesktop.org Date: Wed, 27 Sep 2017 11:37:34 -0700 Message-Id: <20170927183735.14824-2-eric@anholt.net> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170927183735.14824-1-eric@anholt.net> References: <20170927183735.14824-1-eric@anholt.net> Subject: [Intel-gfx] [PATCH i-g-t 2/3] meson: Fix build of igt_x86-using tests on non-x86 platforms. 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 Just stub out the features return value, and return an empty string. Signed-off-by: Eric Anholt --- lib/igt_x86.h | 12 ++++++++++++ lib/meson.build | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/igt_x86.h b/lib/igt_x86.h index 589d224bec62..d6dcfa108331 100644 --- a/lib/igt_x86.h +++ b/lib/igt_x86.h @@ -40,7 +40,19 @@ #define AVX 0x80 #define AVX2 0x100 +#if defined(__x86_64__) unsigned igt_x86_features(void); char *igt_x86_features_to_string(unsigned features, char *line); +#else +static inline unsigned igt_x86_features(void) +{ + return 0; +} +static inline char *igt_x86_features_to_string(unsigned features, char *line) +{ + line[0] = 0; + return line; +} +#endif #endif /* IGT_X86_H */ diff --git a/lib/meson.build b/lib/meson.build index 203be520fd3f..df1dc465e310 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -54,7 +54,6 @@ lib_sources = [ 'igt_rand.c', 'igt_stats.c', 'igt_sysfs.c', - 'igt_x86.c', 'igt_vgem.c', 'instdone.c', 'intel_batchbuffer.c', @@ -88,6 +87,10 @@ lib_sources = [ 'igt_kmod.c', ] +if ['x86', 'x86_64'].contains(host_machine.cpu_family()) + lib_sources += 'igt_x86.c' +endif + lib_deps = [ cairo, glib,