Initial import
[renesas/gralloc-kms.git] / external / drm / 0003-kms-Allow-compiling-libkms-without-Intel-support.patch
1 From ee82d3e79496926270663f155ca1e4217a025358 Mon Sep 17 00:00:00 2001
2 From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
3 Date: Thu, 1 Nov 2012 10:41:29 +0100
4 Subject: [PATCH 3/4] kms: Allow compiling libkms without Intel support
5
6 Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7 ---
8  libkms/Makefile.am | 5 ++++-
9  libkms/linux.c     | 6 +++++-
10  2 files changed, 9 insertions(+), 2 deletions(-)
11
12 diff --git a/libkms/Makefile.am b/libkms/Makefile.am
13 index 215450a..518021f 100644
14 --- a/libkms/Makefile.am
15 +++ b/libkms/Makefile.am
16 @@ -15,10 +15,13 @@ libkms_la_LIBADD = ../libdrm.la
17  libkms_la_SOURCES = \
18         internal.h \
19         linux.c \
20 -       intel.c \
21         dumb.c \
22         api.c
23  
24 +if HAVE_INTEL
25 +libkms_la_SOURCES += intel.c
26 +endif
27 +
28  if HAVE_VMWGFX
29  libkms_la_SOURCES += vmwgfx.c
30  endif
31 diff --git a/libkms/linux.c b/libkms/linux.c
32 index eec0162..d160bc8 100644
33 --- a/libkms/linux.c
34 +++ b/libkms/linux.c
35 @@ -101,8 +101,12 @@ linux_from_sysfs(int fd, struct kms_driver **out)
36         if (ret)
37                 return ret;
38  
39 -       if (!strcmp(name, "intel"))
40 +       if (0)
41 +               {}
42 +#ifdef HAVE_INTEL
43 +       else if (!strcmp(name, "intel"))
44                 ret = intel_create(fd, out);
45 +#endif
46  #ifdef HAVE_VMWGFX
47         else if (!strcmp(name, "vmwgfx"))
48                 ret = vmwgfx_create(fd, out);
49 -- 
50 1.7.12.4
51