From patchwork Sun Sep 7 21:30:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 4859391 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DF3DD9F666 for ; Sun, 7 Sep 2014 21:31:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45C3020138 for ; Sun, 7 Sep 2014 21:31:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3B99A20127 for ; Sun, 7 Sep 2014 21:31:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 543FE6E148; Sun, 7 Sep 2014 14:31:31 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F1F76E152 for ; Sun, 7 Sep 2014 14:31:29 -0700 (PDT) Received: by mail-we0-f177.google.com with SMTP id u57so1009076wes.8 for ; Sun, 07 Sep 2014 14:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IzlDtxD1ZVESbB9sNJ9ezom/0L5lpI+v47c85O+QtH8=; b=EZ5c8cKPMH0/mSHHMnPhi1HT5pbvMeOgI1nZSEAUwIIDIlKDa9W84YjdUuVHZw+wYV fA/lpZl2sIxz+8Bzfj6o8NUisKIaE2DJpbxi257NYEuJdOMspoyGuWU8AxYKU45jkB+R eX0gKvptKwDofBeClzfFjORLnISP9rsezJC6lA0YC7u62Fnhdn4c2blzKqvPPk9HIPDO MLlomahq6nF+I2OR695HO2UxSHP/v+093XvgXJkJrwrbzGRYaNr5nSmO03jPewMgQRyw jyiuZGO0mQVmyjyADKz6nWz0ET1SqciQLmI1fm04S8qUExPh6KhQxUsOdPFy9lsYDUVG 8Pdw== X-Received: by 10.180.212.110 with SMTP id nj14mr17989848wic.51.1410125488750; Sun, 07 Sep 2014 14:31:28 -0700 (PDT) Received: from localhost.localdomain (cpc20-stap10-2-0-cust563.12-2.cable.virginm.net. [82.20.130.52]) by mx.google.com with ESMTPSA id ub19sm9644662wib.9.2014.09.07.14.31.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Sep 2014 14:31:28 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 05/18] libkms: build the intel backend only when needed Date: Sun, 7 Sep 2014 22:30:00 +0100 Message-Id: <1410125413-19465-6-git-send-email-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1410125413-19465-1-git-send-email-emil.l.velikov@gmail.com> References: <1410125413-19465-1-git-send-email-emil.l.velikov@gmail.com> Cc: emil.l.velikov@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Emil Velikov Reviewed-by: Jakob Bornecrantz --- configure.ac | 3 +++ libkms/Makefile.am | 5 ++++- libkms/linux.c | 16 +++++++++++----- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 484084f..f1d3451 100644 --- a/configure.ac +++ b/configure.ac @@ -270,6 +270,9 @@ fi AM_CONDITIONAL(HAVE_LIBKMS, [test "x$LIBKMS" = xyes]) AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes]) +if test "x$INTEL" = xyes; then + AC_DEFINE(HAVE_INTEL, 1, [Have intel support]) +fi AM_CONDITIONAL(HAVE_VMWGFX, [test "x$VMWGFX" = xyes]) if test "x$VMWGFX" = xyes; then diff --git a/libkms/Makefile.am b/libkms/Makefile.am index 449a73b..dae44e9 100644 --- a/libkms/Makefile.am +++ b/libkms/Makefile.am @@ -15,7 +15,6 @@ libkms_la_LIBADD = ../libdrm.la libkms_la_SOURCES = \ internal.h \ linux.c \ - intel.c \ dumb.c \ api.c @@ -23,6 +22,10 @@ if HAVE_VMWGFX libkms_la_SOURCES += vmwgfx.c endif +if HAVE_INTEL +libkms_la_SOURCES += intel.c +endif + if HAVE_NOUVEAU libkms_la_SOURCES += nouveau.c endif diff --git a/libkms/linux.c b/libkms/linux.c index 17e1d58..77a0bbe 100644 --- a/libkms/linux.c +++ b/libkms/linux.c @@ -103,25 +103,31 @@ linux_from_sysfs(int fd, struct kms_driver **out) if (ret) return ret; +#ifdef HAVE_INTEL if (!strcmp(name, "intel")) ret = intel_create(fd, out); + else +#endif #ifdef HAVE_VMWGFX - else if (!strcmp(name, "vmwgfx")) + if (!strcmp(name, "vmwgfx")) ret = vmwgfx_create(fd, out); + else #endif #ifdef HAVE_NOUVEAU - else if (!strcmp(name, "nouveau")) + if (!strcmp(name, "nouveau")) ret = nouveau_create(fd, out); + else #endif #ifdef HAVE_RADEON - else if (!strcmp(name, "radeon")) + if (!strcmp(name, "radeon")) ret = radeon_create(fd, out); + else #endif #ifdef HAVE_EXYNOS - else if (!strcmp(name, "exynos")) + if (!strcmp(name, "exynos")) ret = exynos_create(fd, out); -#endif else +#endif ret = -ENOSYS; free(name);