From: Dylan Baker Date: Thu, 26 Oct 2017 00:59:11 +0000 (-0700) Subject: meson: build r300 driver X-Git-Tag: upstream/18.1.0~3724 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ae08296d09c00dd4650e53929576e00b7e2d1c8;p=platform%2Fupstream%2Fmesa.git meson: build r300 driver This is build tested only Signed-off-by: Dylan Baker Reviewed-by: Eric Anholt --- diff --git a/meson.build b/meson.build index b40b71c..d38fe8a 100644 --- a/meson.build +++ b/meson.build @@ -112,6 +112,7 @@ endif with_gallium = false with_gallium_pl111 = false with_gallium_radeonsi = false +with_gallium_r300 = false with_gallium_nouveau = false with_gallium_freedreno = false with_gallium_softpipe = false @@ -125,7 +126,7 @@ if _drivers == 'auto' if not ['darwin', 'windows'].contains(host_machine.system()) # TODO: PPC, Sparc if ['x86', 'x86_64'].contains(host_machine.cpu_family()) - _drivers = 'radeonsi,nouveau,swrast' + _drivers = 'r300,radeonsi,nouveau,swrast' elif ['arm', 'aarch64'].contains(host_machine.cpu_family()) _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,swrast' else @@ -139,6 +140,7 @@ if _drivers != '' _split = _drivers.split(',') with_gallium_pl111 = _split.contains('pl111') with_gallium_radeonsi = _split.contains('radeonsi') + with_gallium_r300 = _split.contains('r300') with_gallium_nouveau = _split.contains('nouveau') with_gallium_freedreno = _split.contains('freedreno') with_gallium_softpipe = _split.contains('swrast') @@ -717,7 +719,7 @@ dep_libdrm_freedreno = [] if with_amd_vk or with_gallium_radeonsi dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.88') endif -if with_gallium_radeonsi or with_dri_r100 or with_dri_r200 +if with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or with_gallium_r300 dep_libdrm_radeon = dependency('libdrm_radeon', version : '>= 2.4.71') endif if with_gallium_nouveau or with_dri_nouveau diff --git a/src/gallium/drivers/r300/meson.build b/src/gallium/drivers/r300/meson.build new file mode 100644 index 0000000..0d525d8 --- /dev/null +++ b/src/gallium/drivers/r300/meson.build @@ -0,0 +1,156 @@ +# Copyright © 2017 Intel Corporation + +# 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_r300 = files( + 'r300_blit.c', + 'r300_cb.h', + 'r300_chipset.c', + 'r300_chipset.h', + 'r300_context.c', + 'r300_context.h', + 'r300_cs.h', + 'r300_debug.c', + 'r300_defines.h', + 'r300_emit.c', + 'r300_emit.h', + 'r300_flush.c', + 'r300_fs.c', + 'r300_fs.h', + 'r300_hyperz.c', + 'r300_public.h', + 'r300_query.c', + 'r300_reg.h', + 'r300_render.c', + 'r300_render_stencilref.c', + 'r300_render_translate.c', + 'r300_resource.c', + 'r300_screen_buffer.c', + 'r300_screen_buffer.h', + 'r300_screen.c', + 'r300_screen.h', + 'r300_shader_semantics.h', + 'r300_state.c', + 'r300_state_derived.c', + 'r300_state_inlines.h', + 'r300_texture.c', + 'r300_texture_desc.c', + 'r300_texture_desc.h', + 'r300_texture.h', + 'r300_tgsi_to_rc.c', + 'r300_tgsi_to_rc.h', + 'r300_transfer.c', + 'r300_transfer.h', + 'r300_vs.c', + 'r300_vs_draw.c', + 'r300_vs.h', + 'compiler/memory_pool.c', + 'compiler/memory_pool.h', + 'compiler/r300_fragprog.c', + 'compiler/r300_fragprog_emit.c', + 'compiler/r300_fragprog.h', + 'compiler/r300_fragprog_swizzle.c', + 'compiler/r300_fragprog_swizzle.h', + 'compiler/r3xx_fragprog.c', + 'compiler/r3xx_vertprog.c', + 'compiler/r3xx_vertprog_dump.c', + 'compiler/r500_fragprog.c', + 'compiler/r500_fragprog_emit.c', + 'compiler/r500_fragprog.h', + 'compiler/radeon_code.c', + 'compiler/radeon_code.h', + 'compiler/radeon_compiler.c', + 'compiler/radeon_compiler.h', + 'compiler/radeon_compiler_util.c', + 'compiler/radeon_compiler_util.h', + 'compiler/radeon_dataflow.c', + 'compiler/radeon_dataflow_deadcode.c', + 'compiler/radeon_dataflow.h', + 'compiler/radeon_dataflow_swizzles.c', + 'compiler/radeon_emulate_branches.c', + 'compiler/radeon_emulate_branches.h', + 'compiler/radeon_emulate_loops.c', + 'compiler/radeon_emulate_loops.h', + 'compiler/radeon_inline_literals.c', + 'compiler/radeon_list.c', + 'compiler/radeon_list.h', + 'compiler/radeon_opcodes.c', + 'compiler/radeon_opcodes.h', + 'compiler/radeon_optimize.c', + 'compiler/radeon_pair_dead_sources.c', + 'compiler/radeon_pair_regalloc.c', + 'compiler/radeon_pair_schedule.c', + 'compiler/radeon_pair_translate.c', + 'compiler/radeon_program_alu.c', + 'compiler/radeon_program_alu.h', + 'compiler/radeon_program.c', + 'compiler/radeon_program_constants.h', + 'compiler/radeon_program.h', + 'compiler/radeon_program_pair.c', + 'compiler/radeon_program_pair.h', + 'compiler/radeon_program_print.c', + 'compiler/radeon_program_tex.c', + 'compiler/radeon_program_tex.h', + 'compiler/radeon_regalloc.h', + 'compiler/radeon_remove_constants.c', + 'compiler/radeon_remove_constants.h', + 'compiler/radeon_rename_regs.c', + 'compiler/radeon_rename_regs.h', + 'compiler/radeon_swizzle.h', + 'compiler/radeon_variable.c', + 'compiler/radeon_variable.h', + 'compiler/radeon_vert_fc.c', +) + +libr300 = static_library( + 'r300', + files_r300, + c_args : [c_vis_args], + include_directories : [ + inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_gallium_drivers, + inc_mesa, + ], + dependencies : [dep_libdrm_radeon, dep_llvm], +) + +if with_tests + test('r300_compiler_test', executable( + 'r300_compiler_test', + files( + 'compiler/tests/r300_compiler_tests.c', + 'compiler/tests/radeon_compiler_optimize_tests.c', + 'compiler/tests/radeon_compiler_regalloc_tests.c', + 'compiler/tests/radeon_compiler_util_tests.c', + 'compiler/tests/rc_test_helpers.c', + 'compiler/tests/unit_test.c', + ), + c_args : [ + '-DTEST_PATH="@0@"'.format( + join_paths(meson.current_source_dir(), 'compiler', 'tests') + ) + ], + include_directories : [ + inc_src, inc_include, inc_gallium, inc_gallium_aux, + include_directories('compiler'), + ], + link_with : [libr300, libgallium, libmesa_util], + dependencies : [dep_m, dep_clock, dep_dl, dep_thread, dep_unwind], + ) + ) +endif diff --git a/src/gallium/meson.build b/src/gallium/meson.build index 581f701..dd3b9f3 100644 --- a/src/gallium/meson.build +++ b/src/gallium/meson.build @@ -37,11 +37,15 @@ if with_gallium_softpipe subdir('drivers/llvmpipe') endif endif +if with_gallium_r300 or with_gallium_radeonsi + subdir('winsys/radeon/drm') +endif +if with_gallium_r300 + subdir('drivers/r300') +endif if with_gallium_radeonsi - # TODO: some of these are needed by r300 and r600 subdir('drivers/radeon') subdir('drivers/radeonsi') - subdir('winsys/radeon/drm') subdir('winsys/amdgpu/drm') endif if with_gallium_nouveau @@ -85,7 +89,6 @@ if with_glx == 'gallium-xlib' subdir('state_trackers/glx/xlib') endif # TODO: SVGA -# TODO: r300 # TODO: r600 # TODO: SWR # TODO: virgl diff --git a/src/gallium/targets/dri/meson.build b/src/gallium/targets/dri/meson.build index 4dbda07..88aae56 100644 --- a/src/gallium/targets/dri/meson.build +++ b/src/gallium/targets/dri/meson.build @@ -59,8 +59,7 @@ endif if with_gallium_radeonsi gallium_dri_c_args += '-DGALLIUM_RADEONSI' gallium_dri_link_with += [ - libradeonsi, libradeonwinsys, libamdgpuwinsys, libradeon, - libamd_common, + libradeonsi, libamdgpuwinsys, libradeon, libamd_common, ] gallium_dri_drivers += 'radeonsi_dri.so' gallium_dri_sources += [si_driinfo_h] @@ -113,6 +112,15 @@ if with_gallium_i915 gallium_dri_link_with += [libi915, libi915drm] gallium_dri_drivers += 'i915_dri.so' endif +if with_gallium_r300 + gallium_dri_c_args += '-DGALLIUM_R300' + gallium_dri_link_with += libr300 + gallium_dri_drivers += 'r300_dri.so' +endif + +if with_gallium_radeonsi or with_gallium_r300 # TODO: r600 + gallium_dri_link_with += libradeonwinsys +endif if with_gallium_vc4 or with_gallium_vc5 gallium_dri_link_with += libbroadcom_cle