From patchwork Fri Sep 29 10:51:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Petri Latvala X-Patchwork-Id: 9977507 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 7951C60329 for ; Fri, 29 Sep 2017 10:52:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D95F29783 for ; Fri, 29 Sep 2017 10:52:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7295329822; Fri, 29 Sep 2017 10:52:34 +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 E2FBC29783 for ; Fri, 29 Sep 2017 10:52:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 61D2B6EA9C; Fri, 29 Sep 2017 10:52:33 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from johanna4.inet.fi (mta-out1.inet.fi [62.71.2.233]) by gabe.freedesktop.org (Postfix) with ESMTP id 71BC86EA9C for ; Fri, 29 Sep 2017 10:52:32 +0000 (UTC) RazorGate-KAS: Status: not_detected RazorGate-KAS: Rate: 0 RazorGate-KAS: Envelope from: RazorGate-KAS: Version: 5.5.3 RazorGate-KAS: LuaCore: 215 2015-05-29_17-31-22 60ae4a1b4d01d14f868b20a55aced8d7df7b2e28 RazorGate-KAS: Lua profiles 78662 [Jun 02 2015] RazorGate-KAS: Method: none Received: from hufflepuff.adrinael.net (84.248.197.237) by johanna4.inet.fi (9.0.002.03-2-gbe5d057) id 59BF88C7010997A6; Fri, 29 Sep 2017 13:52:32 +0300 Received: from adrinael by hufflepuff.adrinael.net with local (Exim 4.84_2) (envelope-from ) id 1dxsuG-0004EH-UF; Fri, 29 Sep 2017 13:52:32 +0300 From: Petri Latvala To: intel-gfx@lists.freedesktop.org Date: Fri, 29 Sep 2017 13:51:59 +0300 Message-Id: <1506682319-16165-4-git-send-email-petri.latvala@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1506682319-16165-1-git-send-email-petri.latvala@intel.com> References: <1506682319-16165-1-git-send-email-petri.latvala@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 3/3] lib: Reduce dependency on glib 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP In commit ebd6eb69f57b ("Make igtrc configuration common, with configurable suspend/resume delay") .igtrc handling was moved to igt_core from igt_chamelium. That made everything in IGT depend on GLIB by accident. In short, igt_core.h declared a variable of type GKeyFile*, requiring glib.h. Everything that tried to #include igt_core.h required glib.h to be available, by use of GLIB_CFLAGS. This "worked" so far because CAIRO_CFLAGS contained GLIB_CFLAGS. As the variable is only used by other stuff in lib/, stuff it in its own header file to leave igt_core.h without a dependency to glib.h. Also add a couple of missing #ifdef HAVE_GLIBs around. Reported-by: Felipe De Jesus Ruiz Garcia Signed-off-by: Petri Latvala Reviewed-by: Arkadiusz Hiler --- lib/Makefile.sources | 1 + lib/igt_chamelium.c | 1 + lib/igt_core.c | 3 +++ lib/igt_core.h | 2 -- lib/igt_rc.h | 34 ++++++++++++++++++++++++++++++++++ lib/meson.build | 1 + 6 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 lib/igt_rc.h diff --git a/lib/Makefile.sources b/lib/Makefile.sources index 53fdb54c..e851f62b 100644 --- a/lib/Makefile.sources +++ b/lib/Makefile.sources @@ -20,6 +20,7 @@ lib_source_list = \ igt_primes.h \ igt_rand.c \ igt_rand.h \ + igt_rc.h \ igt_stats.c \ igt_stats.h \ igt_sysfs.c \ diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c index fb250366..b25855a4 100644 --- a/lib/igt_chamelium.c +++ b/lib/igt_chamelium.c @@ -40,6 +40,7 @@ #include "igt_aux.h" #include "igt_kms.h" #include "igt_frame.h" +#include "igt_rc.h" /** * SECTION:igt_chamelium diff --git a/lib/igt_core.c b/lib/igt_core.c index 47b4682d..950ea9b0 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -55,7 +55,9 @@ #include #include #include +#ifdef HAVE_GLIB #include +#endif #include "drmtest.h" #include "intel_chipset.h" @@ -67,6 +69,7 @@ #include "igt_core.h" #include "igt_aux.h" #include "igt_sysfs.h" +#include "igt_rc.h" #ifdef HAVE_LIBGEN_H #include /* for basename() on Solaris */ diff --git a/lib/igt_core.h b/lib/igt_core.h index c90ae2de..f8543d65 100644 --- a/lib/igt_core.h +++ b/lib/igt_core.h @@ -40,7 +40,6 @@ #include #include #include -#include #ifndef IGT_LOG_DOMAIN #define IGT_LOG_DOMAIN (NULL) @@ -49,7 +48,6 @@ extern const char* __igt_test_description __attribute__((weak)); extern bool __igt_plain_output; -extern GKeyFile *igt_key_file; extern char *igt_frame_dump_path; /** diff --git a/lib/igt_rc.h b/lib/igt_rc.h new file mode 100644 index 00000000..d7a314c5 --- /dev/null +++ b/lib/igt_rc.h @@ -0,0 +1,34 @@ +/* + * Copyright © 2017 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + + +#ifndef IGT_RC_H +#define IGT_RC_H + +#ifdef HAVE_GLIB +#include + +extern GKeyFile *igt_key_file; + +#endif /* HAVE_GLIB */ +#endif /* IGT_RC_H */ diff --git a/lib/meson.build b/lib/meson.build index 203be520..54ff4f9b 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -13,6 +13,7 @@ lib_headers = [ 'igt_gvt.h', 'igt_primes.h', 'igt_rand.h', + 'igt_rc.h', 'igt_stats.h', 'igt_sysfs.h', 'igt_x86.h',