[Mesa-dev] [PATCH v2 14/21] meson: build radeonsi
Dylan Baker
dylan at pnwbakers.com
Thu Oct 12 17:38:41 UTC 2017
This builds the radeonsi (and radeon) window system bits and gallium
driver bits.
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
meson.build | 18 ++++--
src/gallium/{ => drivers/radeon}/meson.build | 43 +++++++++++---
src/gallium/drivers/radeonsi/meson.build | 78 +++++++++++++++++++++++++
src/gallium/meson.build | 38 ++++++++++++
src/gallium/{ => winsys/amdgpu/drm}/meson.build | 26 +++++----
src/gallium/{ => winsys/radeon/drm}/meson.build | 20 +++----
6 files changed, 189 insertions(+), 34 deletions(-)
copy src/gallium/{ => drivers/radeon}/meson.build (58%)
create mode 100644 src/gallium/drivers/radeonsi/meson.build
copy src/gallium/{ => winsys/amdgpu/drm}/meson.build (70%)
copy src/gallium/{ => winsys/radeon/drm}/meson.build (72%)
diff --git a/meson.build b/meson.build
index 161b69ec060..0639f741bdb 100644
--- a/meson.build
+++ b/meson.build
@@ -537,7 +537,15 @@ dep_expat = dependency('expat')
# this only exists on linux so either this is linux and it will be found, or
# its not linux and and wont
dep_m = cc.find_library('m', required : false)
-dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.82', required : with_amd_vk)
+
+dep_libdrm_amdgpu = []
+dep_libdrm_radeon = []
+if with_amd_vk or with_gallium_radeonsi
+ dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.82')
+endif
+if with_gallium_radeonsi # older radeon too
+ dep_libdrm_radeon = dependency('libdrm_radeon', version : '>= 2.4.82')
+endif
llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
if with_amd_vk
@@ -560,12 +568,12 @@ if with_llvm
'-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch),
]
else
- if with_amd_vk
- error('The following drivers requires LLVM: Radv. One of these is enabled, but LLVM was not found.')
+ if with_amd_vk or with_gallium_radeonsi
+ error('The following drivers requires LLVM: Radv, RadeonSI. One of these is enabled, but LLVM was not found.')
endif
endif
-elif with_amd_vk
- error('The following drivers requires LLVM: Radv. One of these is enabled, but LLVM is disabled.')
+elif with_amd_vk or with_gallium_radeonsi
+ error('The following drivers requires LLVM: Radv, RadeonSI. One of these is enabled, but LLVM is disabled.')
endif
dep_glvnd = []
diff --git a/src/gallium/meson.build b/src/gallium/drivers/radeon/meson.build
similarity index 58%
copy from src/gallium/meson.build
copy to src/gallium/drivers/radeon/meson.build
index 47dbcd84414..b4d2832d016 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/drivers/radeon/meson.build
@@ -18,13 +18,38 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-inc_gallium = include_directories('include')
-inc_gallium_winsys = include_directories('winsys')
+files_libradeon = files(
+ 'r600_buffer_common.c',
+ 'r600_cs.h',
+ 'r600_gpu_load.c',
+ 'r600_perfcounter.c',
+ 'r600_pipe_common.c',
+ 'r600_pipe_common.h',
+ 'r600_query.c',
+ 'r600_query.h',
+ 'r600_test_dma.c',
+ 'r600_texture.c',
+ 'radeon_uvd.c',
+ 'radeon_uvd.h',
+ 'radeon_vcn_dec.c',
+ 'radeon_vcn_dec.h',
+ 'radeon_vce_40_2_2.c',
+ 'radeon_vce_50.c',
+ 'radeon_vce_52.c',
+ 'radeon_vce.c',
+ 'radeon_vce.h',
+ 'radeon_video.c',
+ 'radeon_video.h',
+ 'radeon_winsys.h',
+)
-subdir('auxiliary')
-subdir('auxiliary/pipe-loader')
-subdir('drivers/ddebug')
-subdir('drivers/noop')
-subdir('drivers/trace')
-subdir('drivers/rbug')
-subdir('state_trackers/dri')
+libradeon = static_library(
+ 'radeon',
+ files_libradeon,
+ c_args : ['-Wstrict-overflow=0', c_vis_args],
+ dependencies : [dep_llvm, dep_clock],
+ include_directories : [
+ inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_drivers,
+ ],
+ build_by_default : false,
+)
diff --git a/src/gallium/drivers/radeonsi/meson.build b/src/gallium/drivers/radeonsi/meson.build
new file mode 100644
index 00000000000..08e855d75b5
--- /dev/null
+++ b/src/gallium/drivers/radeonsi/meson.build
@@ -0,0 +1,78 @@
+# Copyright © 2017 Dylan Baker
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_libradeonsi = files(
+ 'cik_sdma.c',
+ 'driinfo_radeonsi.h',
+ 'si_blit.c',
+ 'si_compute.c',
+ 'si_compute.h',
+ 'si_cp_dma.c',
+ 'si_debug.c',
+ 'si_descriptors.c',
+ 'si_dma.c',
+ 'si_hw_context.c',
+ 'si_pipe.c',
+ 'si_pipe.h',
+ 'si_pm4.c',
+ 'si_pm4.h',
+ 'si_perfcounter.c',
+ 'si_public.h',
+ 'si_shader.c',
+ 'si_shader.h',
+ 'si_shader_internal.h',
+ 'si_shader_nir.c',
+ 'si_shader_tgsi_alu.c',
+ 'si_shader_tgsi_mem.c',
+ 'si_shader_tgsi_setup.c',
+ 'si_state.c',
+ 'si_state_binning.c',
+ 'si_state_draw.c',
+ 'si_state_msaa.c',
+ 'si_state_shaders.c',
+ 'si_state_streamout.c',
+ 'si_state_viewport.c',
+ 'si_state.h',
+ 'si_uvd.c',
+)
+
+si_driinfo_h = custom_target(
+ 'si_driinfo.h',
+ input : files(
+ '../../../util/merge_driinfo.py',
+ '../../auxiliary/pipe-loader/driinfo_gallium.h', 'driinfo_radeonsi.h'
+ ),
+ output : 'si_driinfo.h',
+ command : [prog_python2, '@INPUT@'],
+ capture : true,
+)
+
+libradeonsi = static_library(
+ 'radeonsi',
+ [files_libradeonsi, si_driinfo_h, nir_opcodes_h],
+ include_directories : [
+ inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_amd_common,
+ inc_gallium_drivers,
+ ],
+ c_args : [c_vis_args],
+ cpp_args : [cpp_vis_args],
+ dependencies : dep_llvm,
+ build_by_default : false,
+)
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 47dbcd84414..0a808d3cfda 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -19,6 +19,7 @@
# SOFTWARE.
inc_gallium = include_directories('include')
+inc_gallium_drivers = include_directories('drivers')
inc_gallium_winsys = include_directories('winsys')
subdir('auxiliary')
@@ -27,4 +28,41 @@ subdir('drivers/ddebug')
subdir('drivers/noop')
subdir('drivers/trace')
subdir('drivers/rbug')
+subdir('drivers/radeon')
+subdir('drivers/radeonsi')
+subdir('winsys/radeon/drm')
+subdir('winsys/amdgpu/drm')
subdir('state_trackers/dri')
+# TODO: freedreno
+# TODO: i915
+# TODO: nouveau
+# TODO: SVGA
+# TODO: r300
+# TODO: r600
+# TODO: etnaviv
+# TODO: IMX
+# TODO: PL111
+# TODO: softpipe
+# TODO: llvmpipe
+# TODO: SWR
+# TODO: vc4
+# TODO: virgl
+# TODO: winsys/sw/null
+# TODO: winsys/sw/xlib
+# TODO: winsys/sw/dri
+# TODO: winsys/sw/kms-dri
+# TODO: winsys/sw/wrapper
+# TODO: clover
+if with_dri
+ #subdir('targets/dri')
+endif
+# TODO: dricommon
+# TODO: xlib-glx
+# TODO: OMX
+# TODO: osmesa
+# TODO: VA
+# TODO: vdpau
+# TODO: xa
+# TODO: xvmc
+# TODO: nine
+# TODO: tests
diff --git a/src/gallium/meson.build b/src/gallium/winsys/amdgpu/drm/meson.build
similarity index 70%
copy from src/gallium/meson.build
copy to src/gallium/winsys/amdgpu/drm/meson.build
index 47dbcd84414..a81750e842a 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/winsys/amdgpu/drm/meson.build
@@ -18,13 +18,19 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-inc_gallium = include_directories('include')
-inc_gallium_winsys = include_directories('winsys')
-
-subdir('auxiliary')
-subdir('auxiliary/pipe-loader')
-subdir('drivers/ddebug')
-subdir('drivers/noop')
-subdir('drivers/trace')
-subdir('drivers/rbug')
-subdir('state_trackers/dri')
+libamdgpuwinsys = static_library(
+ 'amdgpuwinsys',
+ files(
+ 'amdgpu_bo.c', 'amdgpu_bo.h', 'amdgpu_cs.c', 'amdgpu_cs.h',
+ 'amdgpu_public.h', 'amdgpu_surface.c', 'amdgpu_winsys.c',
+ 'amdgpu_winsys.h',
+ ),
+ include_directories : [
+ inc_amd, inc_gallium, inc_gallium_aux, inc_include, inc_src,
+ ],
+ c_args : [c_vis_args],
+ cpp_args : [cpp_vis_args],
+ link_with : libamdgpu_addrlib,
+ dependencies : dep_libdrm_amdgpu,
+ build_by_default : false,
+)
diff --git a/src/gallium/meson.build b/src/gallium/winsys/radeon/drm/meson.build
similarity index 72%
copy from src/gallium/meson.build
copy to src/gallium/winsys/radeon/drm/meson.build
index 47dbcd84414..8a3f8021157 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/winsys/radeon/drm/meson.build
@@ -18,13 +18,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-inc_gallium = include_directories('include')
-inc_gallium_winsys = include_directories('winsys')
-
-subdir('auxiliary')
-subdir('auxiliary/pipe-loader')
-subdir('drivers/ddebug')
-subdir('drivers/noop')
-subdir('drivers/trace')
-subdir('drivers/rbug')
-subdir('state_trackers/dri')
+libradeonwinsys = static_library(
+ 'radeonwinsys',
+ files('radeon_drm_bo.c', 'radeon_drm_bo.h', 'radeon_drm_cs.c',
+ 'radeon_drm_cs.h', 'radeon_drm_public.h', 'radeon_drm_surface.c',
+ 'radeon_drm_winsys.c', 'radeon_drm_winsys.h'),
+ include_directories : [inc_src, inc_include, inc_gallium, inc_gallium_aux],
+ c_args : [c_vis_args],
+ dependencies : [dep_libdrm_radeon],
+ build_by_default : false,
+)
--
2.14.2
More information about the mesa-dev
mailing list