aboutsummaryrefslogtreecommitdiffstats
path: root/libkms
diff options
context:
space:
mode:
authorJohn Stultz2018-04-13 18:31:33 -0500
committerJohn Stultz2018-04-13 18:31:33 -0500
commit84f838d71a75125b14d361f0ed7d23a0ac521edf (patch)
treea7694dfdab2ca2b1d32e25071589c7ea0a992bd6 /libkms
parent2f9aea0661550a43c3d2ac33a5bc286870edd34e (diff)
parent35affe89d5f617a972b1cfee00c51cbe9e7c64a2 (diff)
downloadexternal-libdrm-84f838d71a75125b14d361f0ed7d23a0ac521edf.tar.gz
external-libdrm-84f838d71a75125b14d361f0ed7d23a0ac521edf.tar.xz
external-libdrm-84f838d71a75125b14d361f0ed7d23a0ac521edf.zip
Merge remote-tracking branch 'freedesktop/master' into aosp/master
This merges the freedesktop/master branch into aosp/master Change-Id: I3104d45924f67d37808154d04c15518394204478 Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'libkms')
-rw-r--r--libkms/api.c4
-rw-r--r--libkms/dumb.c4
-rw-r--r--libkms/exynos.c26
-rw-r--r--libkms/intel.c4
-rw-r--r--libkms/internal.h4
-rwxr-xr-xlibkms/kms-symbol-check2
-rw-r--r--libkms/linux.c14
-rw-r--r--libkms/meson.build75
-rw-r--r--libkms/nouveau.c4
-rw-r--r--libkms/radeon.c4
-rw-r--r--libkms/vmwgfx.c4
11 files changed, 99 insertions, 46 deletions
diff --git a/libkms/api.c b/libkms/api.c
index 354d8a2e..22dd32d7 100644
--- a/libkms/api.c
+++ b/libkms/api.c
@@ -26,10 +26,6 @@
26 **************************************************************************/ 26 **************************************************************************/
27 27
28 28
29#ifdef HAVE_CONFIG_H
30#include "config.h"
31#endif
32
33#include <errno.h> 29#include <errno.h>
34#include <stdlib.h> 30#include <stdlib.h>
35#include <string.h> 31#include <string.h>
diff --git a/libkms/dumb.c b/libkms/dumb.c
index b95a072c..17efc10a 100644
--- a/libkms/dumb.c
+++ b/libkms/dumb.c
@@ -26,10 +26,6 @@
26 **************************************************************************/ 26 **************************************************************************/
27 27
28 28
29#ifdef HAVE_CONFIG_H
30#include "config.h"
31#endif
32
33#include <errno.h> 29#include <errno.h>
34#include <stdio.h> 30#include <stdio.h>
35#include <stdlib.h> 31#include <stdlib.h>
diff --git a/libkms/exynos.c b/libkms/exynos.c
index 0e97fb51..ef64a668 100644
--- a/libkms/exynos.c
+++ b/libkms/exynos.c
@@ -5,16 +5,26 @@
5 * SooChan Lim <sc1.lim@samsung.com> 5 * SooChan Lim <sc1.lim@samsung.com>
6 * Sangjin LEE <lsj119@samsung.com> 6 * Sangjin LEE <lsj119@samsung.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * under the terms of the GNU General Public License as published by the 9 * copy of this software and associated documentation files (the "Software"),
10 * Free Software Foundation; either version 2 of the License, or (at your 10 * to deal in the Software without restriction, including without limitation
11 * option) any later version. 11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
12 */ 26 */
13 27
14#ifdef HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <errno.h> 28#include <errno.h>
19#include <stdio.h> 29#include <stdio.h>
20#include <stdlib.h> 30#include <stdlib.h>
diff --git a/libkms/intel.c b/libkms/intel.c
index 3d8ca055..859e7a0f 100644
--- a/libkms/intel.c
+++ b/libkms/intel.c
@@ -26,10 +26,6 @@
26 **************************************************************************/ 26 **************************************************************************/
27 27
28 28
29#ifdef HAVE_CONFIG_H
30#include "config.h"
31#endif
32
33#include <errno.h> 29#include <errno.h>
34#include <stdio.h> 30#include <stdio.h>
35#include <stdlib.h> 31#include <stdlib.h>
diff --git a/libkms/internal.h b/libkms/internal.h
index 905f5b17..8b386db6 100644
--- a/libkms/internal.h
+++ b/libkms/internal.h
@@ -29,10 +29,6 @@
29#ifndef INTERNAL_H_ 29#ifndef INTERNAL_H_
30#define INTERNAL_H_ 30#define INTERNAL_H_
31 31
32#ifdef HAVE_CONFIG_H
33#include "config.h"
34#endif
35
36#include "libdrm_macros.h" 32#include "libdrm_macros.h"
37#include "libkms.h" 33#include "libkms.h"
38 34
diff --git a/libkms/kms-symbol-check b/libkms/kms-symbol-check
index 658b2692..a5c2120d 100755
--- a/libkms/kms-symbol-check
+++ b/libkms/kms-symbol-check
@@ -3,7 +3,7 @@
3# The following symbols (past the first five) are taken from the public headers. 3# The following symbols (past the first five) are taken from the public headers.
4# A list of the latter should be available Makefile.sources/LIBKMS_H_FILES 4# A list of the latter should be available Makefile.sources/LIBKMS_H_FILES
5 5
6FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libkms.so} | awk '{print $3}'| while read func; do 6FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libkms.so} | awk '{print $3}'| while read func; do
7( grep -q "^$func$" || echo $func ) <<EOF 7( grep -q "^$func$" || echo $func ) <<EOF
8__bss_start 8__bss_start
9_edata 9_edata
diff --git a/libkms/linux.c b/libkms/linux.c
index 0b50777e..56205054 100644
--- a/libkms/linux.c
+++ b/libkms/linux.c
@@ -29,10 +29,6 @@
29 * going from fd to pci id via fstat and udev. 29 * going from fd to pci id via fstat and udev.
30 */ 30 */
31 31
32
33#ifdef HAVE_CONFIG_H
34#include "config.h"
35#endif
36#include <errno.h> 32#include <errno.h>
37#include <stdio.h> 33#include <stdio.h>
38#include <stdlib.h> 34#include <stdlib.h>
@@ -110,27 +106,27 @@ linux_from_sysfs(int fd, struct kms_driver **out)
110 if (ret) 106 if (ret)
111 return ret; 107 return ret;
112 108
113#ifdef HAVE_INTEL 109#if HAVE_INTEL
114 if (!strcmp(name, "intel")) 110 if (!strcmp(name, "intel"))
115 ret = intel_create(fd, out); 111 ret = intel_create(fd, out);
116 else 112 else
117#endif 113#endif
118#ifdef HAVE_VMWGFX 114#if HAVE_VMWGFX
119 if (!strcmp(name, "vmwgfx")) 115 if (!strcmp(name, "vmwgfx"))
120 ret = vmwgfx_create(fd, out); 116 ret = vmwgfx_create(fd, out);
121 else 117 else
122#endif 118#endif
123#ifdef HAVE_NOUVEAU 119#if HAVE_NOUVEAU
124 if (!strcmp(name, "nouveau")) 120 if (!strcmp(name, "nouveau"))
125 ret = nouveau_create(fd, out); 121 ret = nouveau_create(fd, out);
126 else 122 else
127#endif 123#endif
128#ifdef HAVE_RADEON 124#if HAVE_RADEON
129 if (!strcmp(name, "radeon")) 125 if (!strcmp(name, "radeon"))
130 ret = radeon_create(fd, out); 126 ret = radeon_create(fd, out);
131 else 127 else
132#endif 128#endif
133#ifdef HAVE_EXYNOS 129#if HAVE_EXYNOS
134 if (!strcmp(name, "exynos")) 130 if (!strcmp(name, "exynos"))
135 ret = exynos_create(fd, out); 131 ret = exynos_create(fd, out);
136 else 132 else
diff --git a/libkms/meson.build b/libkms/meson.build
new file mode 100644
index 00000000..86d1a4ee
--- /dev/null
+++ b/libkms/meson.build
@@ -0,0 +1,75 @@
1# Copyright © 2017-2018 Intel Corporation
2
3# Permission is hereby granted, free of charge, to any person obtaining a copy
4# of this software and associated documentation files (the "Software"), to deal
5# in the Software without restriction, including without limitation the rights
6# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7# copies of the Software, and to permit persons to whom the Software is
8# furnished to do so, subject to the following conditions:
9
10# The above copyright notice and this permission notice shall be included in
11# all copies or substantial portions of the Software.
12
13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19# SOFTWARE.
20
21libkms_include = [inc_root, inc_drm]
22files_libkms = files(
23 'linux.c',
24 'dumb.c',
25 'api.c',
26)
27if with_vmwgfx
28 files_libkms += files('vmwgfx.c')
29endif
30if with_intel
31 files_libkms += files('intel.c')
32endif
33if with_nouveau
34 files_libkms += files('nouveau.c')
35endif
36if with_radeon
37 files_libkms += files('radeon.c')
38endif
39if with_exynos
40 files_libkms += files('exynos.c')
41 libkms_include += include_directories('../exynos')
42endif
43
44libkms = shared_library(
45 'kms',
46 [files_libkms, config_file],
47 c_args : warn_c_args,
48 include_directories : libkms_include,
49 link_with : libdrm,
50 version : '1.0.0',
51 install : true,
52)
53
54ext_libkms = declare_dependency(
55 link_with : [libdrm, libkms],
56 include_directories : [libkms_include],
57)
58
59install_headers('libkms.h', subdir : 'libkms')
60
61pkg.generate(
62 name : 'libkms',
63 libraries : libkms,
64 subdirs : ['libkms'],
65 version : '1.0.0',
66 requires_private : 'libdrm',
67 description : 'Library that abstracts away the different mm interfaces for kernel drivers',
68)
69
70test(
71 'kms-symbol-check',
72 prog_bash,
73 env : env_test,
74 args : [files('kms-symbol-check'), libkms]
75)
diff --git a/libkms/nouveau.c b/libkms/nouveau.c
index d10e0fdb..7fe23db3 100644
--- a/libkms/nouveau.c
+++ b/libkms/nouveau.c
@@ -26,10 +26,6 @@
26 **************************************************************************/ 26 **************************************************************************/
27 27
28 28
29#ifdef HAVE_CONFIG_H
30#include "config.h"
31#endif
32
33#include <errno.h> 29#include <errno.h>
34#include <stdio.h> 30#include <stdio.h>
35#include <stdlib.h> 31#include <stdlib.h>
diff --git a/libkms/radeon.c b/libkms/radeon.c
index aaeeaf31..2cb2b11f 100644
--- a/libkms/radeon.c
+++ b/libkms/radeon.c
@@ -26,10 +26,6 @@
26 **************************************************************************/ 26 **************************************************************************/
27 27
28 28
29#ifdef HAVE_CONFIG_H
30#include "config.h"
31#endif
32
33#include <errno.h> 29#include <errno.h>
34#include <stdio.h> 30#include <stdio.h>
35#include <stdlib.h> 31#include <stdlib.h>
diff --git a/libkms/vmwgfx.c b/libkms/vmwgfx.c
index 6a24fd4d..f0e40be7 100644
--- a/libkms/vmwgfx.c
+++ b/libkms/vmwgfx.c
@@ -26,10 +26,6 @@
26 **************************************************************************/ 26 **************************************************************************/
27 27
28 28
29#ifdef HAVE_CONFIG_H
30#include "config.h"
31#endif
32
33#include <errno.h> 29#include <errno.h>
34#include <stdlib.h> 30#include <stdlib.h>
35#include <string.h> 31#include <string.h>