• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#############################################################################
2#
3# Copyright (C) 2019 Collabora Ltd
4#
5# Permission is hereby granted, free of charge, to any person obtaining a
6# copy of this software and associated documentation files (the "Software"),
7# to deal in the Software without restriction, including without limitation
8# the rights to use, copy, modify, merge, publish, distribute, sublicense,
9# and/or sell copies of the Software, and to permit persons to whom the
10# Software is furnished to do so, subject to the following conditions:
11#
12# The above copyright notice and this permission notice shall be included
13# in all copies or substantial portions of the Software.
14#
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21# OTHER DEALINGS IN THE SOFTWARE.
22#
23
24subdir('mesa')
25subdir('gallium')
26
27virgl_sources = [
28   'iov.c',
29   'virgl_context.c',
30   'virgl_context.h',
31   'virgl_hw.h',
32   'virgl_protocol.h',
33   'virgl_resource.c',
34   'virgl_resource.h',
35   'virgl_util.c',
36   'virgl_util.h',
37]
38
39vrend_sources = [
40   'vrend_blitter.c',
41   'vrend_blitter.h',
42   'vrend_debug.c',
43   'vrend_debug.h',
44   'vrend_decode.c',
45   'vrend_formats.c',
46   'vrend_iov.h',
47   'vrend_object.c',
48   'vrend_object.h',
49   'vrend_renderer.c',
50   'vrend_renderer.h',
51   'vrend_shader.c',
52   'vrend_shader.h',
53   'vrend_strbuf.h',
54   'vrend_tweaks.c',
55   'vrend_tweaks.h',
56   'vrend_winsys.c',
57   'vrend_winsys.h',
58]
59
60virglrenderer_sources = [
61   'virglrenderer.c',
62   'virglrenderer.h',
63   'virglrenderer_hw.h',
64]
65
66vrend_winsys_egl_sources = [
67   'vrend_winsys_gbm.c',
68   'vrend_winsys_gbm.h',
69   'vrend_winsys_egl.c',
70   'vrend_winsys_egl.h',
71]
72
73vrend_winsys_glx_sources = [
74   'vrend_winsys_glx.c',
75   'vrend_winsys_glx.h',
76]
77
78venus_sources = [
79   'venus_hw.h',
80   'venus/venus-protocol/vn_protocol_renderer.h',
81   'venus/vkr_allocator.c',
82   'venus/vkr_allocator.h',
83   'venus/vkr_buffer.c',
84   'venus/vkr_buffer.h',
85   'venus/vkr_command_buffer.c',
86   'venus/vkr_command_buffer.h',
87   'venus/vkr_common.c',
88   'venus/vkr_common.h',
89   'venus/vkr_context.c',
90   'venus/vkr_context.h',
91   'venus/vkr_cs.c',
92   'venus/vkr_cs.h',
93   'venus/vkr_descriptor_set.c',
94   'venus/vkr_descriptor_set.h',
95   'venus/vkr_device.c',
96   'venus/vkr_device.h',
97   'venus/vkr_device_memory.c',
98   'venus/vkr_device_memory.h',
99   'venus/vkr_image.c',
100   'venus/vkr_image.h',
101   'venus/vkr_instance.c',
102   'venus/vkr_instance.h',
103   'venus/vkr_physical_device.c',
104   'venus/vkr_physical_device.h',
105   'venus/vkr_pipeline.c',
106   'venus/vkr_pipeline.h',
107   'venus/vkr_query_pool.c',
108   'venus/vkr_query_pool.h',
109   'venus/vkr_queue.c',
110   'venus/vkr_queue.h',
111   'venus/vkr_render_pass.c',
112   'venus/vkr_render_pass.h',
113   'venus/vkr_renderer.c',
114   'venus/vkr_renderer.h',
115   'venus/vkr_ring.c',
116   'venus/vkr_ring.h',
117   'venus/vkr_transport.c',
118   'venus/vkr_transport.h',
119]
120
121venus_codegen = custom_target(
122   'venus_codegen',
123   input : ['venus/vkr_device_object.py', 'venus/vkr_device_object.json'],
124   output : [
125      'vkr_buffer_gen.h',
126      'vkr_command_buffer_gen.h',
127      'vkr_descriptor_set_gen.h',
128      'vkr_device_memory_gen.h',
129      'vkr_image_gen.h',
130      'vkr_pipeline_gen.h',
131      'vkr_query_pool_gen.h',
132      'vkr_queue_gen.h',
133      'vkr_render_pass_gen.h',
134   ],
135   command : [prog_python, '@INPUT0@', '-o', '@OUTDIR@', '@INPUT1@'],
136)
137
138drm_sources = [
139   'drm/drm_fence.c',
140   'drm/drm_fence.h',
141   'drm/drm_renderer.c',
142   'drm/drm_renderer.h',
143   'drm/drm_util.c',
144   'drm/drm_util.h',
145]
146
147drm_msm_sources = [
148   'drm/drm-uapi/msm_drm.h',
149   'drm/msm/msm_proto.h',
150   'drm/msm/msm_renderer.c',
151   'drm/msm/msm_renderer.h',
152]
153
154proxy_sources = [
155   'proxy/proxy_client.c',
156   'proxy/proxy_common.c',
157   'proxy/proxy_context.c',
158   'proxy/proxy_renderer.c',
159   'proxy/proxy_server.c',
160   'proxy/proxy_socket.c',
161]
162
163video_sources = [
164   'virgl_video_hw.h',
165   'virgl_video.c',
166   'virgl_video.h',
167   'vrend_video.c',
168   'vrend_video.h',
169]
170
171virgl_depends = [
172   gallium_dep,
173   epoxy_dep,
174   libdrm_dep,
175   thread_dep,
176   m_dep,
177]
178
179if with_tracing == 'perfetto'
180   virgl_depends += [vperfetto_min_dep]
181endif
182
183if with_tracing == 'percetto'
184   virgl_depends += [percetto_dep]
185endif
186
187virgl_sources += vrend_sources
188
189if have_egl
190   virgl_sources += vrend_winsys_egl_sources
191   virgl_depends += [gbm_dep]
192endif
193
194if have_glx
195   virgl_sources += vrend_winsys_glx_sources
196   virgl_depends += [glx_dep]
197endif
198
199if with_venus
200   virgl_sources += venus_sources
201   virgl_sources += venus_codegen
202   virgl_depends += [venus_dep]
203endif
204
205if with_drm
206   virgl_sources += drm_sources
207endif
208
209if with_drm_msm
210   virgl_sources += drm_msm_sources
211endif
212
213if with_render_server
214   virgl_sources += proxy_sources
215endif
216
217if with_video
218  virgl_sources += video_sources
219  virgl_depends += [libva_dep, libvadrm_dep]
220endif
221
222libvirgl = static_library(
223   'virgl',
224   virgl_sources,
225   include_directories: [inc_gallium, inc_configuration, 'venus', 'drm', 'drm/drm-uapi'],
226   dependencies : virgl_depends,
227)
228
229libvirgl_inc = [
230   inc_gallium,
231   inc_configuration,
232   include_directories(['.', 'venus', 'drm'])
233]
234
235libvirgl_dep = declare_dependency(
236   link_with: libvirgl,
237   include_directories: libvirgl_inc
238)
239
240libvirglrenderer = library(
241   'virglrenderer',
242   virglrenderer_sources,
243   include_directories: [inc_gallium, inc_configuration],
244   dependencies : [virgl_depends, libvirgl_dep],
245   version : binary_age.to_string() + '.'
246             + interface_age.to_string() + '.'
247             + revision.to_string(),
248   install : true
249)
250
251pkg = import('pkgconfig')
252pkg.generate(libvirglrenderer,
253   description: 'virgl GL renderer',
254   subdirs: 'virgl'
255)
256
257libvirglrenderer_dep = declare_dependency(
258   link_with: libvirglrenderer,
259   include_directories: libvirgl_inc,
260   dependencies : [libvirgl_dep, gallium_dep]
261)
262
263install_headers('virglrenderer.h', subdir : 'virgl')
264