diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2020-01-09 10:29:51 +0100 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2020-01-09 11:39:57 -0300 |
commit | 967a9715b36b7170c28ce9a40be979c3d4b5f221 (patch) | |
tree | 6aa7d340d55857eb59a263a3cf5163dd04e8480d /recipes-graphics/drm | |
parent | 8b51ea3dafe9c5ac667a918911fb8f1050fc8897 (diff) | |
download | meta-freescale-967a9715b36b7170c28ce9a40be979c3d4b5f221.tar.gz |
libdrm imx: fix building libdrm-vivante
The recipe updates pulled in from upstream now builds with meson but
the libdrm imx fork does not provide meson build information. Patch the
imx fork to get the ability to build with meson.
Change the recipe to actually configure libdrm-vivante and to deploy
it into its own package.
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'recipes-graphics/drm')
-rw-r--r-- | recipes-graphics/drm/libdrm/0001-meson-add-libdrm-vivante-to-the-meson-meta-data.patch | 140 | ||||
-rw-r--r-- | recipes-graphics/drm/libdrm_2.4.99.imx.bb | 7 |
2 files changed, 145 insertions, 2 deletions
diff --git a/recipes-graphics/drm/libdrm/0001-meson-add-libdrm-vivante-to-the-meson-meta-data.patch b/recipes-graphics/drm/libdrm/0001-meson-add-libdrm-vivante-to-the-meson-meta-data.patch new file mode 100644 index 00000000..ae6b0ab7 --- /dev/null +++ b/recipes-graphics/drm/libdrm/0001-meson-add-libdrm-vivante-to-the-meson-meta-data.patch | |||
@@ -0,0 +1,140 @@ | |||
1 | From 45f48f8a5de59c04b0510c23853772bc970f411e Mon Sep 17 00:00:00 2001 | ||
2 | From: Max Krummenacher <max.krummenacher@toradex.com> | ||
3 | Date: Thu, 9 Jan 2020 01:01:35 +0000 | ||
4 | Subject: [PATCH] meson: add libdrm-vivante to the meson meta data | ||
5 | |||
6 | Upstream libdrm added the option to use meason as the buildsystem. | ||
7 | Integrate Vivante into the relevant meson build information. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> | ||
12 | --- | ||
13 | meson.build | 14 +++++++++++++ | ||
14 | meson_options.txt | 7 +++++++ | ||
15 | vivante/meson.build | 50 +++++++++++++++++++++++++++++++++++++++++++++ | ||
16 | 3 files changed, 71 insertions(+) | ||
17 | create mode 100644 vivante/meson.build | ||
18 | |||
19 | diff --git a/meson.build b/meson.build | ||
20 | index e292554a..f4740634 100644 | ||
21 | --- a/meson.build | ||
22 | +++ b/meson.build | ||
23 | @@ -157,6 +157,15 @@ if _vc4 != 'false' | ||
24 | with_vc4 = _vc4 == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family()) | ||
25 | endif | ||
26 | |||
27 | +with_vivante = false | ||
28 | +_vivante = get_option('vivante') | ||
29 | +if _vivante == 'true' | ||
30 | + if not with_atomics | ||
31 | + error('libdrm_vivante requires atomics.') | ||
32 | + endif | ||
33 | + with_vivante = true | ||
34 | +endif | ||
35 | + | ||
36 | # XXX: Apparently only freebsd and dragonfly bsd actually need this (and | ||
37 | # gnu/kfreebsd), not openbsd and netbsd | ||
38 | with_libkms = false | ||
39 | @@ -312,6 +321,7 @@ install_headers( | ||
40 | 'include/drm/savage_drm.h', 'include/drm/sis_drm.h', | ||
41 | 'include/drm/tegra_drm.h', 'include/drm/vc4_drm.h', | ||
42 | 'include/drm/via_drm.h', 'include/drm/virtgpu_drm.h', | ||
43 | + 'include/drm/vivante_drm.h', | ||
44 | subdir : 'libdrm', | ||
45 | ) | ||
46 | if with_vmwgfx | ||
47 | @@ -362,6 +372,9 @@ endif | ||
48 | if with_etnaviv | ||
49 | subdir('etnaviv') | ||
50 | endif | ||
51 | +if with_vivante | ||
52 | + subdir('vivante') | ||
53 | +endif | ||
54 | if with_man_pages | ||
55 | subdir('man') | ||
56 | endif | ||
57 | @@ -382,5 +395,6 @@ message(' EXYNOS API @0@'.format(with_exynos)) | ||
58 | message(' Freedreno API @0@ (kgsl: @1@)'.format(with_freedreno, with_freedreno_kgsl)) | ||
59 | message(' Tegra API @0@'.format(with_tegra)) | ||
60 | message(' VC4 API @0@'.format(with_vc4)) | ||
61 | +message(' Vivante API @0@'.format(with_etnaviv)) | ||
62 | message(' Etnaviv API @0@'.format(with_etnaviv)) | ||
63 | message('') | ||
64 | diff --git a/meson_options.txt b/meson_options.txt | ||
65 | index 8af33f1c..dc69563d 100644 | ||
66 | --- a/meson_options.txt | ||
67 | +++ b/meson_options.txt | ||
68 | @@ -95,6 +95,13 @@ option( | ||
69 | choices : ['true', 'false', 'auto'], | ||
70 | description : '''Enable support for vc4's KMS API.''', | ||
71 | ) | ||
72 | +option( | ||
73 | + 'vivante', | ||
74 | + type : 'combo', | ||
75 | + value : 'false', | ||
76 | + choices : ['true', 'false', 'auto'], | ||
77 | + description : '''Enable support for vivante's propriatary experimental KMS API.''', | ||
78 | +) | ||
79 | option( | ||
80 | 'etnaviv', | ||
81 | type : 'combo', | ||
82 | diff --git a/vivante/meson.build b/vivante/meson.build | ||
83 | new file mode 100644 | ||
84 | index 00000000..f6adb598 | ||
85 | --- /dev/null | ||
86 | +++ b/vivante/meson.build | ||
87 | @@ -0,0 +1,50 @@ | ||
88 | +# Copyright © 2017-2018 Intel Corporation | ||
89 | + | ||
90 | +# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
91 | +# of this software and associated documentation files (the "Software"), to deal | ||
92 | +# in the Software without restriction, including without limitation the rights | ||
93 | +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
94 | +# copies of the Software, and to permit persons to whom the Software is | ||
95 | +# furnished to do so, subject to the following conditions: | ||
96 | + | ||
97 | +# The above copyright notice and this permission notice shall be included in | ||
98 | +# all copies or substantial portions of the Software. | ||
99 | + | ||
100 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
101 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
102 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
103 | +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
104 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
105 | +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
106 | +# SOFTWARE. | ||
107 | + | ||
108 | + | ||
109 | +libdrm_vivante = shared_library( | ||
110 | + 'drm_vivante', | ||
111 | + [ | ||
112 | + files( | ||
113 | + 'vivante_bo.c', | ||
114 | + ), | ||
115 | + config_file | ||
116 | + ], | ||
117 | + include_directories : [inc_root, inc_drm], | ||
118 | + link_with : libdrm, | ||
119 | + c_args : libdrm_c_args, | ||
120 | + dependencies : [dep_pthread_stubs, dep_rt, dep_atomic_ops], | ||
121 | + version : '1.0.0', | ||
122 | + install : true, | ||
123 | +) | ||
124 | + | ||
125 | +pkg.generate( | ||
126 | + name : 'libdrm_vivante', | ||
127 | + libraries : libdrm_vivante, | ||
128 | + subdirs : ['.', 'libdrm'], | ||
129 | + version : meson.project_version(), | ||
130 | + requires_private : 'libdrm', | ||
131 | + description : 'Userspace interface to Vivante kernel DRM services', | ||
132 | +) | ||
133 | + | ||
134 | +ext_libdrm_vivante = declare_dependency( | ||
135 | + link_with : [libdrm, libdrm_vivante], | ||
136 | + include_directories : [inc_drm, include_directories('.')], | ||
137 | +) | ||
138 | -- | ||
139 | 2.20.1 | ||
140 | |||
diff --git a/recipes-graphics/drm/libdrm_2.4.99.imx.bb b/recipes-graphics/drm/libdrm_2.4.99.imx.bb index fb0d235b..18c1ce5f 100644 --- a/recipes-graphics/drm/libdrm_2.4.99.imx.bb +++ b/recipes-graphics/drm/libdrm_2.4.99.imx.bb | |||
@@ -13,7 +13,8 @@ DEPENDS = "libpthread-stubs" | |||
13 | IMX_LIBDRM_SRC ?= "git://source.codeaurora.org/external/imx/libdrm-imx.git;protocol=https;nobranch=1" | 13 | IMX_LIBDRM_SRC ?= "git://source.codeaurora.org/external/imx/libdrm-imx.git;protocol=https;nobranch=1" |
14 | IMX_LIBDRM_BRANCH ?= "libdrm-imx-2.4.99" | 14 | IMX_LIBDRM_BRANCH ?= "libdrm-imx-2.4.99" |
15 | SRC_URI = "${IMX_LIBDRM_SRC};branch=${IMX_LIBDRM_BRANCH} \ | 15 | SRC_URI = "${IMX_LIBDRM_SRC};branch=${IMX_LIBDRM_BRANCH} \ |
16 | file://musl-ioctl.patch" | 16 | file://musl-ioctl.patch \ |
17 | file://0001-meson-add-libdrm-vivante-to-the-meson-meta-data.patch " | ||
17 | SRCREV = "5748c8ff40f1ae87487c01e580f145a43542cbda" | 18 | SRCREV = "5748c8ff40f1ae87487c01e580f145a43542cbda" |
18 | S = "${WORKDIR}/git" | 19 | S = "${WORKDIR}/git" |
19 | 20 | ||
@@ -63,8 +64,10 @@ FILES_${PN}-etnaviv = "${libdir}/libdrm_etnaviv.so.*" | |||
63 | 64 | ||
64 | BBCLASSEXTEND = "native nativesdk" | 65 | BBCLASSEXTEND = "native nativesdk" |
65 | 66 | ||
66 | PACKAGES_append_imxgpu = " ${PN}-vivante" | 67 | PACKAGES_prepend_imxgpu = "${PN}-vivante " |
67 | RRECOMMENDS_${PN}-drivers_append_imxgpu = " ${PN}-vivante" | 68 | RRECOMMENDS_${PN}-drivers_append_imxgpu = " ${PN}-vivante" |
68 | FILES_${PN}-vivante = "${libdir}/libdrm_vivante.so.*" | 69 | FILES_${PN}-vivante = "${libdir}/libdrm_vivante.so.*" |
70 | PACKAGECONFIG_append_imxgpu = " vivante" | ||
71 | PACKAGECONFIG[vivante] = "-Dvivante=true,-Dvivante=false" | ||
69 | 72 | ||
70 | PACKAGE_ARCH = "${MACHINE_SOCARCH}" | 73 | PACKAGE_ARCH = "${MACHINE_SOCARCH}" |