1 # $NetBSD: Makefile,v 1.21 2019/04/07 05:28:09 rin Exp $ 2 3 # Link the gallium mega driver. 4 5 LIBISMODULE= yes 6 LIBISCXX= yes 7 8 .include <bsd.own.mk> 9 10 SHLIB_MAJOR= 0 11 12 LIB= gallium_dri 13 DRIDIR= ${X11USRLIBDIR}/modules/dri 14 DRIDEBUGDIR= ${DEBUGDIR}${X11USRLIBDIR}/modules/dri 15 16 LLVM_INCLUDE_OBJDIR!= cd ${NETBSDSRCDIR}/external/bsd/llvm/include && ${PRINTOBJDIR} 17 18 CXXFLAGS+= -std=c++11 19 CFLAGS+= -std=gnu11 20 CPPFLAGS+= -I${DESTDIR}${X11INCDIR}/libdrm \ 21 -I${NETBSDSRCDIR}/external/bsd/llvm/dist/llvm/include \ 22 -I${LLVM_INCLUDE_OBJDIR} -I${NETBSDSRCDIR}/external/bsd/llvm/config 23 24 GALLIUM_SUBDIRS= \ 25 auxiliary \ 26 auxiliary/cso_cache \ 27 auxiliary/draw \ 28 auxiliary/driver_ddebug \ 29 auxiliary/driver_noop \ 30 auxiliary/driver_rbug \ 31 auxiliary/driver_trace \ 32 auxiliary/hud \ 33 auxiliary/indices \ 34 auxiliary/nir \ 35 auxiliary/os \ 36 auxiliary/pipebuffer \ 37 auxiliary/pipe-loader \ 38 auxiliary/postprocess \ 39 auxiliary/rbug \ 40 auxiliary/renderonly \ 41 auxiliary/rtasm \ 42 auxiliary/tgsi \ 43 auxiliary/translate \ 44 auxiliary/util \ 45 auxiliary/vl \ 46 drivers/noop \ 47 drivers/rbug \ 48 drivers/softpipe \ 49 winsys/sw/dri \ 50 winsys/sw/kms-dri \ 51 winsys/sw/null \ 52 winsys/sw/wrapper \ 53 state_trackers/dri 54 55 GALLIUM_SUBDIRS_VDPAU= \ 56 state_trackers/vdpau 57 58 GALLIUM_SUBDIRS_LLVMPIPE= \ 59 auxiliary/gallivm \ 60 drivers/llvmpipe 61 62 GALLIUM_SUBDIRS_ATI= \ 63 drivers/radeon \ 64 drivers/radeonsi \ 65 drivers/r300 \ 66 drivers/r300/compiler \ 67 drivers/r600 \ 68 drivers/r600/sb \ 69 winsys/radeon/drm \ 70 winsys/amdgpu/drm 71 72 GALLIUM_SUBDIRS_I915= \ 73 drivers/i915 \ 74 winsys/i915/drm 75 76 GALLIUM_SUBDIRS_NOUVEAU= \ 77 drivers/nouveau \ 78 drivers/nouveau/nv30 \ 79 drivers/nouveau/nv50 \ 80 drivers/nouveau/codegen \ 81 drivers/nouveau/nvc0 \ 82 winsys/nouveau/drm 83 84 BUILD_RADEON=0 85 BUILD_NOUVEAU=0 86 BUILD_VDPAU=0 87 BUILD_LLVMPIPE=0 88 BUILD_I915=0 89 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" 90 BUILD_RADEON=1 91 BUILD_I915=1 92 .if ${MKLLVMRT} != "no" 93 BUILD_LLVMPIPE=1 94 .endif 95 .endif 96 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || ${MACHINE} == "evbarm" 97 BUILD_NOUVEAU=1 98 BUILD_VDPAU=1 99 .endif 100 101 DRIVERS= kms_swrast swrast 102 .if ${BUILD_RADEON} == 1 103 DRIVERS+= r600 r300 104 GALLIUM_SUBDIRS+= ${GALLIUM_SUBDIRS_ATI} 105 .endif 106 .if ${BUILD_NOUVEAU} == 1 107 DRIVERS+= nouveau 108 GALLIUM_SUBDIRS+= ${GALLIUM_SUBDIRS_NOUVEAU} 109 .endif 110 .if ${BUILD_VDPAU} == 1 111 GALLIUM_SUBDIRS+= ${GALLIUM_SUBDIRS_VDPAU} 112 .endif 113 .if ${BUILD_I915} == 1 114 GALLIUM_SUBDIRS+= ${GALLIUM_SUBDIRS_I915} 115 .endif 116 .if ${BUILD_LLVMPIPE} == 1 117 GALLIUM_SUBDIRS+= ${GALLIUM_SUBDIRS_LLVMPIPE} 118 .endif 119 120 GALLIUM_SOURCES.auxiliary/cso_cache= \ 121 cso_cache.c \ 122 cso_context.c \ 123 cso_hash.c 124 125 GALLIUM_SOURCES.auxiliary/draw= \ 126 draw_context.c \ 127 draw_fs.c \ 128 draw_gs.c \ 129 draw_pipe_aaline.c \ 130 draw_pipe_aapoint.c \ 131 draw_pipe.c \ 132 draw_pipe_clip.c \ 133 draw_pipe_cull.c \ 134 draw_pipe_flatshade.c \ 135 draw_pipe_offset.c \ 136 draw_pipe_pstipple.c \ 137 draw_pipe_stipple.c \ 138 draw_pipe_twoside.c \ 139 draw_pipe_unfilled.c \ 140 draw_pipe_util.c \ 141 draw_pipe_validate.c \ 142 draw_pipe_vbuf.c \ 143 draw_pipe_wide_line.c \ 144 draw_pipe_wide_point.c \ 145 draw_prim_assembler.c \ 146 draw_pt.c \ 147 draw_pt_emit.c \ 148 draw_pt_fetch.c \ 149 draw_pt_fetch_emit.c \ 150 draw_pt_fetch_shade_emit.c \ 151 draw_pt_fetch_shade_pipeline.c \ 152 draw_pt_post_vs.c \ 153 draw_pt_so_emit.c \ 154 draw_pt_util.c \ 155 draw_pt_vsplit.c \ 156 draw_vertex.c \ 157 draw_vs.c \ 158 draw_vs_exec.c \ 159 draw_vs_variant.c 160 161 .if ${MKLLVMRT} != "no" 162 GALLIUM_SOURCES.auxiliary/draw+= \ 163 draw_llvm.c \ 164 draw_llvm_sample.c \ 165 draw_pt_fetch_shade_pipeline_llvm.c \ 166 draw_vs_llvm.c 167 .endif 168 169 GALLIUM_SOURCES.auxiliary/hud= \ 170 font.c \ 171 hud_context.c \ 172 hud_cpu.c \ 173 hud_nic.c \ 174 hud_cpufreq.c \ 175 hud_diskstat.c \ 176 hud_sensors_temp.c \ 177 hud_fps.c \ 178 hud_driver_query.c 179 GALLIUM_SOURCES.auxiliary/indices= \ 180 u_primconvert.c 181 GALLIUM_SOURCES.auxiliary/os= \ 182 os_process.c 183 GALLIUM_SOURCES.auxiliary/pipe-loader= \ 184 pipe_loader.c \ 185 pipe_loader_drm.c \ 186 pipe_loader_sw.c 187 188 .for _f in ${GALLIUM_SOURCES.auxiliary/pipe-loader} 189 CPPFLAGS.${_f} += -DHAVE_PIPE_LOADER_KMS=1 \ 190 -DHAVE_PIPE_LOADER_DRI=1 \ 191 -DGALLIUM_STATIC_TARGETS=1 \ 192 -I${X11SRCDIR.Mesa}/src/gallium/winsys \ 193 -I${X11SRCDIR.Mesa}/src/loader 194 .endfor 195 196 GALLIUM_SOURCES.auxiliary/pipebuffer= \ 197 pb_buffer_fenced.c \ 198 pb_buffer_malloc.c \ 199 pb_bufmgr_alt.c \ 200 pb_bufmgr_cache.c \ 201 pb_bufmgr_debug.c \ 202 pb_bufmgr_mm.c \ 203 pb_bufmgr_ondemand.c \ 204 pb_bufmgr_pool.c \ 205 pb_bufmgr_slab.c \ 206 pb_cache.c \ 207 pb_slab.c \ 208 pb_validate.c 209 GALLIUM_SOURCES.auxiliary/postprocess= \ 210 pp_celshade.c \ 211 pp_colors.c \ 212 pp_init.c \ 213 pp_mlaa.c \ 214 pp_run.c \ 215 pp_program.c 216 GALLIUM_SOURCES.auxiliary/rbug= \ 217 rbug_connection.c \ 218 RBUGrbug_context.c \ 219 RBUGrbug_core.c \ 220 rbug_demarshal.c \ 221 rbug_texture.c \ 222 rbug_shader.c 223 GALLIUM_SOURCES.auxiliary/rtasm= \ 224 rtasm_cpu.c \ 225 rtasm_execmem.c \ 226 rtasm_x86sse.c 227 GALLIUM_SOURCES.auxiliary/tgsi= \ 228 tgsi_aa_point.c \ 229 tgsi_build.c \ 230 tgsi_dump.c \ 231 tgsi_exec.c \ 232 tgsi_emulate.c \ 233 tgsi_from_mesa.c \ 234 tgsi_info.c \ 235 tgsi_iterate.c \ 236 tgsi_lowering.c \ 237 tgsi_parse.c \ 238 tgsi_point_sprite.c \ 239 tgsi_sanity.c \ 240 tgsi_scan.c \ 241 tgsi_strings.c \ 242 tgsi_text.c \ 243 tgsi_transform.c \ 244 tgsi_two_side.c \ 245 tgsi_ureg.c \ 246 tgsi_util.c 247 GALLIUM_SOURCES.auxiliary/translate= \ 248 translate.c \ 249 translate_cache.c \ 250 translate_generic.c \ 251 translate_sse.c 252 GALLIUM_SOURCES.auxiliary/util= \ 253 os_misc.c \ 254 u_async_debug.c \ 255 u_bitmask.c \ 256 u_blit.c \ 257 u_blitter.c \ 258 u_cache.c \ 259 u_debug.c \ 260 u_debug_describe.c \ 261 u_debug_flush.c \ 262 u_debug_gallium.c \ 263 u_debug_image.c \ 264 u_debug_memory.c \ 265 u_debug_refcnt.c \ 266 u_debug_stack.c \ 267 u_debug_symbol.c \ 268 u_dl.c \ 269 u_draw.c \ 270 u_draw_quad.c \ 271 u_dump_defines.c \ 272 u_dump_state.c \ 273 u_format.c \ 274 u_format_bptc.c \ 275 u_format_etc.c \ 276 u_format_latc.c \ 277 u_format_other.c \ 278 u_format_rgtc.c \ 279 u_format_s3tc.c \ 280 u_format_tests.c \ 281 u_format_yuv.c \ 282 u_format_zs.c \ 283 u_framebuffer.c \ 284 u_gen_mipmap.c \ 285 u_handle_table.c \ 286 u_hash_table.c \ 287 u_helpers.c \ 288 u_idalloc.c \ 289 u_index_modify.c \ 290 u_linear.c \ 291 u_log.c \ 292 u_mm.c \ 293 u_network.c \ 294 u_prim.c \ 295 u_prim_restart.c \ 296 u_pstipple.c \ 297 u_resource.c \ 298 u_ringbuffer.c \ 299 u_sampler.c \ 300 u_screen.c \ 301 u_simple_shaders.c \ 302 u_suballoc.c \ 303 u_surface.c \ 304 u_surfaces.c \ 305 u_tests.c \ 306 u_texture.c \ 307 u_tile.c \ 308 u_transfer.c \ 309 u_transfer_helper.c \ 310 u_threaded_context.c \ 311 u_upload_mgr.c \ 312 u_vbuf.c 313 GALLIUM_SOURCES.auxiliary/nir = \ 314 tgsi_to_nir.c 315 GALLIUM_SOURCES.auxiliary/vl= \ 316 vl_bicubic_filter.c \ 317 vl_compositor.c \ 318 vl_csc.c \ 319 vl_decoder.c \ 320 vl_deint_filter.c \ 321 vl_idct.c \ 322 vl_matrix_filter.c \ 323 vl_mc.c \ 324 vl_median_filter.c \ 325 vl_mpeg12_bitstream.c \ 326 vl_mpeg12_decoder.c \ 327 vl_vertex_buffers.c \ 328 vl_video_buffer.c \ 329 vl_winsys_dri.c \ 330 vl_zscan.c 331 332 # Generated 333 .PATH: ${X11SRCDIR.Mesa}/../src/gallium/auxiliary 334 GALLIUM_SOURCES.auxiliary= \ 335 u_indices_gen.c \ 336 u_unfilled_gen.c \ 337 u_format_table.c 338 .for _f in ${GALLIUM_SOURCES.auxiliary/vl} 339 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/loader 340 .endfor 341 .for _f in ${GALLIUM_SOURCES.auxiliary} 342 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/auxiliary/util 343 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/util 344 .endfor 345 346 GALLIUM_SOURCES.auxiliary/renderonly= \ 347 renderonly.c 348 349 GALLIUM_SOURCES.auxiliary/gallivm= \ 350 lp_bld_arit.c \ 351 lp_bld_arit_overflow.c \ 352 lp_bld_assert.c \ 353 lp_bld_bitarit.c \ 354 lp_bld_const.c \ 355 lp_bld_conv.c \ 356 lp_bld_flow.c \ 357 lp_bld_format_aos_array.c \ 358 lp_bld_format_aos.c \ 359 lp_bld_format_cached.c \ 360 lp_bld_format_float.c \ 361 lp_bld_format.c \ 362 lp_bld_format_soa.c \ 363 lp_bld_format_srgb.c \ 364 lp_bld_format_yuv.c \ 365 lp_bld_gather.c \ 366 lp_bld_init.c \ 367 lp_bld_intr.c \ 368 lp_bld_logic.c \ 369 lp_bld_misc.cpp \ 370 lp_bld_pack.c \ 371 lp_bld_printf.c \ 372 lp_bld_quad.c \ 373 lp_bld_sample_aos.c \ 374 lp_bld_sample.c \ 375 lp_bld_sample_soa.c \ 376 lp_bld_struct.c \ 377 lp_bld_swizzle.c \ 378 lp_bld_tgsi_action.c \ 379 lp_bld_tgsi_aos.c \ 380 lp_bld_tgsi.c \ 381 lp_bld_tgsi_info.c \ 382 lp_bld_tgsi_soa.c \ 383 lp_bld_type.c 384 #lp_bld_debug.cpp 385 386 .for _f in ${GALLIUM_SOURCES.auxiliary/gallivm} 387 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/auxiliary/util 388 .endfor 389 390 391 GALLIUM_SOURCES.auxiliary/driver_ddebug = \ 392 dd_context.c \ 393 dd_draw.c \ 394 dd_screen.c 395 396 GALLIUM_SOURCES.auxiliary/driver_noop = \ 397 noop_pipe.c \ 398 noop_state.c 399 400 GALLIUM_SOURCES.auxiliary/driver_trace = \ 401 tr_context.c \ 402 tr_dump.c \ 403 tr_dump_state.c \ 404 tr_screen.c \ 405 tr_texture.c 406 407 GALLIUM_SOURCES.auxiliary/driver_rbug = \ 408 DRIVERrbug_core.c \ 409 DRIVERrbug_context.c \ 410 rbug_objects.c \ 411 rbug_screen.c 412 # Conflicts with auxiliary/rbug/ files 413 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/auxiliary/rbug/rbug_core.c RBUGrbug_core.c 414 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/auxiliary/rbug/rbug_context.c RBUGrbug_context.c 415 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug/rbug_core.c DRIVERrbug_core.c 416 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug/rbug_context.c DRIVERrbug_context.c 417 CPPFLAGS.DRIVERrbug_core.c+= -I${X11SRCDIR.Mesa}/src/gallium/auxiliary 418 CPPFLAGS.DRIVERrbug_core.c+= -I${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug 419 CPPFLAGS.DRIVERrbug_core.c+= -I${X11SRCDIR.Mesa}/src/gallium/drivers 420 CPPFLAGS.DRIVERrbug_context.c+= -I${X11SRCDIR.Mesa}/src/gallium/auxiliary 421 CPPFLAGS.DRIVERrbug_context.c+= -I${X11SRCDIR.Mesa}/src/gallium/auxiliary/driver_rbug 422 CPPFLAGS.DRIVERrbug_context.c+= -I${X11SRCDIR.Mesa}/src/gallium/drivers 423 424 GALLIUM_SOURCES.drivers/i915= \ 425 i915_blit.c \ 426 i915_clear.c \ 427 i915_context.c \ 428 i915_debug.c \ 429 i915_debug_fp.c \ 430 i915_flush.c \ 431 i915_fpc_emit.c \ 432 i915_fpc_optimize.c \ 433 i915_fpc_translate.c \ 434 i915_prim_emit.c \ 435 i915_prim_vbuf.c \ 436 i915_query.c \ 437 i915_resource_buffer.c \ 438 i915_resource.c \ 439 i915_resource_texture.c \ 440 i915_screen.c \ 441 i915_state.c \ 442 i915_state_derived.c \ 443 i915_state_dynamic.c \ 444 i915_state_emit.c \ 445 i915_state_fpc.c \ 446 i915_state_immediate.c \ 447 i915_state_sampler.c \ 448 i915_state_static.c \ 449 i915_surface.c 450 451 GALLIUM_SOURCES.winsys/i915/drm= \ 452 i915_drm_batchbuffer.c \ 453 i915_drm_buffer.c \ 454 i915_drm_fence.c \ 455 i915_drm_winsys.c 456 457 # Conflicts with r600/radeon_video.c and radeon/radeon_video.c 458 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/r600/radeon_video.c r600_radeon_video.c 459 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/radeon_video.c radeon_radeon_video.c 460 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/r600/radeon_vce.c r600_radeon_vce.c 461 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/radeon_vce.c radeon_radeon_vce.c 462 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/r600/r600_perfcounter.c r600_r600_perfcounter.c 463 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/r600_perfcounter.c radeon_r600_perfcounter.c 464 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/r600/radeon_uvd.c r600_radeon_uvd.c 465 BUILDSYMLINKS+= ${X11SRCDIR.Mesa}/src/gallium/drivers/radeon/radeon_uvd.c radeon_radeon_uvd.c 466 467 GALLIUM_SOURCES.drivers/radeon = \ 468 cayman_msaa.c \ 469 r600_buffer_common.c \ 470 r600_pipe_common.c \ 471 r600_query.c \ 472 r600_streamout.c \ 473 r600_texture.c \ 474 radeon_r600_perfcounter.c \ 475 radeon_radeon_uvd.c \ 476 radeon_uvd_enc.c \ 477 radeon_uvd_enc_1_1.c \ 478 radeon_vce_40_2_2.c \ 479 radeon_vce_50.c \ 480 radeon_vce_52.c \ 481 radeon_vcn_dec.c \ 482 radeon_vcn_dec_jpeg.c \ 483 radeon_vcn_enc.c \ 484 radeon_vcn_enc_1_2.c \ 485 radeon_radeon_vce.c \ 486 radeon_radeon_video.c \ 487 488 GALLIUM_SOURCES.drivers/r600 = \ 489 eg_debug.c \ 490 r600_gpu_load.c \ 491 r600_r600_perfcounter.c \ 492 r600_radeon_vce.c \ 493 r600_radeon_video.c \ 494 compute_memory_pool.c \ 495 r600_viewport.c \ 496 eg_asm.c \ 497 evergreen_compute.c \ 498 evergreen_hw_context.c \ 499 evergreen_state.c \ 500 r600_asm.c \ 501 r600_blit.c \ 502 r600_hw_context.c \ 503 r600_isa.c \ 504 r600_pipe.c \ 505 r600_shader.c \ 506 r600_state.c \ 507 r600_state_common.c \ 508 r600_uvd.c \ 509 r600_radeon_uvd.c \ 510 r600_test_dma.c \ 511 r700_asm.c 512 GALLIUM_SOURCES.drivers/r600/sb = \ 513 sb_bc_builder.cpp \ 514 sb_bc_decoder.cpp \ 515 sb_bc_dump.cpp \ 516 sb_bc_finalize.cpp \ 517 sb_bc_parser.cpp \ 518 sb_context.cpp \ 519 sb_core.cpp \ 520 sb_dce_cleanup.cpp \ 521 sb_def_use.cpp \ 522 sb_dump.cpp \ 523 sb_expr.cpp \ 524 sb_gcm.cpp \ 525 sb_gvn.cpp \ 526 sb_if_conversion.cpp \ 527 sb_ir.cpp \ 528 sb_liveness.cpp \ 529 sb_pass.cpp \ 530 sb_peephole.cpp \ 531 sb_psi_ops.cpp \ 532 sb_ra_checker.cpp \ 533 sb_ra_coalesce.cpp \ 534 sb_ra_init.cpp \ 535 sb_sched.cpp \ 536 sb_shader.cpp \ 537 sb_ssa_builder.cpp \ 538 sb_valtable.cpp 539 540 GALLIUM_SOURCES.drivers/r300 = \ 541 r300_blit.c \ 542 r300_chipset.c \ 543 r300_context.c \ 544 r300_debug.c \ 545 r300_emit.c \ 546 r300_flush.c \ 547 r300_fs.c \ 548 r300_hyperz.c \ 549 r300_query.c \ 550 r300_render.c \ 551 r300_render_stencilref.c \ 552 r300_render_translate.c \ 553 r300_resource.c \ 554 r300_screen_buffer.c \ 555 r300_screen.c \ 556 r300_state.c \ 557 r300_state_derived.c \ 558 r300_texture.c \ 559 r300_texture_desc.c \ 560 r300_tgsi_to_rc.c \ 561 r300_transfer.c \ 562 r300_vs.c \ 563 r300_vs_draw.c 564 565 GALLIUM_SOURCES.drivers/r300/compiler = \ 566 memory_pool.c \ 567 r300_fragprog.c \ 568 r300_fragprog_emit.c \ 569 r300_fragprog_swizzle.c \ 570 r3xx_fragprog.c \ 571 r3xx_vertprog.c \ 572 r3xx_vertprog_dump.c \ 573 r500_fragprog.c \ 574 r500_fragprog_emit.c \ 575 radeon_code.c \ 576 radeon_compiler.c \ 577 radeon_compiler_util.c \ 578 radeon_dataflow.c \ 579 radeon_dataflow_deadcode.c \ 580 radeon_dataflow_swizzles.c \ 581 radeon_emulate_branches.c \ 582 radeon_emulate_loops.c \ 583 radeon_inline_literals.c \ 584 radeon_list.c \ 585 radeon_opcodes.c \ 586 radeon_optimize.c \ 587 radeon_pair_dead_sources.c \ 588 radeon_pair_regalloc.c \ 589 radeon_pair_schedule.c \ 590 radeon_pair_translate.c \ 591 radeon_program_alu.c \ 592 radeon_program.c \ 593 radeon_program_pair.c \ 594 radeon_program_print.c \ 595 radeon_program_tex.c \ 596 radeon_remove_constants.c \ 597 radeon_rename_regs.c \ 598 radeon_variable.c \ 599 radeon_vert_fc.c 600 601 GALLIUM_SOURCES.drivers/radeonsi = \ 602 cik_sdma.c \ 603 si_blit.c \ 604 si_buffer.c \ 605 si_clear.c \ 606 si_compute.c \ 607 si_compute_blit.c \ 608 si_cp_dma.c \ 609 si_debug.c \ 610 si_descriptors.c \ 611 si_dma.c \ 612 si_dma_cs.c \ 613 si_fence.c \ 614 si_get.c \ 615 si_gfx_cs.c \ 616 si_gpu_load.c \ 617 si_pipe.c \ 618 si_pm4.c \ 619 si_perfcounter.c \ 620 si_query.c \ 621 si_shader.c \ 622 si_shader_nir.c \ 623 si_shader_tgsi_alu.c \ 624 si_shader_tgsi_mem.c \ 625 si_shader_tgsi_setup.c \ 626 si_shaderlib_tgsi.c \ 627 si_state.c \ 628 si_state_binning.c \ 629 si_state_draw.c \ 630 si_state_msaa.c \ 631 si_state_shaders.c \ 632 si_state_streamout.c \ 633 si_state_viewport.c \ 634 si_test_dma.c \ 635 si_test_dma_perf.c \ 636 si_texture.c \ 637 si_uvd.c 638 639 .for _f in ${GALLIUM_SOURCES.drivers/radeon} 640 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/drivers/radeon 641 .endfor 642 643 .for _f in ${GALLIUM_SOURCES.drivers/r300} ${GALLIUM_SOURCES.drivers/r300/compiler} 644 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/drivers/r300 \ 645 -I${X11SRCDIR.Mesa}/src/gallium/drivers/r300/compiler 646 .endfor 647 648 .for _f in ${GALLIUM_SOURCES.drivers/r600} ${GALLIUM_SOURCES.drivers/r600/sb} ${GALLIUM_SOURCES.drivers/radeonsi} 649 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/drivers/r600 650 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/../src/gallium/drivers/r600 651 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/amd/common 652 .endfor 653 654 .for _f in ${GALLIUM_SOURCES.drivers/radeon} 655 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/drivers/radeonsi 656 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/amd/common 657 .endfor 658 659 GALLIUM_SOURCES.drivers/nouveau = \ 660 nouveau_buffer.c \ 661 nouveau_fence.c \ 662 nouveau_heap.c \ 663 nouveau_mm.c \ 664 nouveau_screen.c \ 665 nouveau_video.c \ 666 nouveau_vp3_video_bsp.c \ 667 nouveau_vp3_video.c \ 668 nouveau_vp3_video_vp.c 669 670 GALLIUM_SOURCES.drivers/nouveau/nv30 = \ 671 nv30_clear.c \ 672 nv30_context.c \ 673 nv30_draw.c \ 674 nv30_format.c \ 675 nv30_fragprog.c \ 676 nv30_fragtex.c \ 677 nv30_miptree.c \ 678 nv30_push.c \ 679 nv30_query.c \ 680 nv30_resource.c \ 681 nv30_screen.c \ 682 nv30_state.c \ 683 nv30_state_validate.c \ 684 nv30_texture.c \ 685 nv30_transfer.c \ 686 nv30_vbo.c \ 687 nv30_vertprog.c \ 688 nv40_verttex.c \ 689 nvfx_fragprog.c \ 690 nvfx_vertprog.c 691 692 GALLIUM_SOURCES.drivers/nouveau/nv50 = \ 693 nv50_compute.c \ 694 nv50_context.c \ 695 nv50_formats.c \ 696 nv50_miptree.c \ 697 nv50_program.c \ 698 nv50_push.c \ 699 nv50_query.c \ 700 nv50_query_hw.c \ 701 nv50_query_hw_metric.c \ 702 nv50_query_hw_sm.c \ 703 nv50_resource.c \ 704 nv50_screen.c \ 705 nv50_shader_state.c \ 706 nv50_state.c \ 707 nv50_state_validate.c \ 708 nv50_surface.c \ 709 nv50_tex.c \ 710 nv50_transfer.c \ 711 nv50_vbo.c \ 712 nv84_video_bsp.c \ 713 nv84_video.c \ 714 nv84_video_vp.c \ 715 nv98_video_bsp.c \ 716 nv98_video.c \ 717 nv98_video_ppp.c \ 718 nv98_video_vp.c 719 720 GALLIUM_SOURCES.drivers/nouveau/codegen = \ 721 nv50_ir.cpp \ 722 nv50_ir_bb.cpp \ 723 nv50_ir_build_util.cpp \ 724 nv50_ir_emit_nv50.cpp \ 725 nv50_ir_from_tgsi.cpp \ 726 nv50_ir_graph.cpp \ 727 nv50_ir_lowering_nv50.cpp \ 728 nv50_ir_peephole.cpp \ 729 nv50_ir_print.cpp \ 730 nv50_ir_ra.cpp \ 731 nv50_ir_ssa.cpp \ 732 nv50_ir_target.cpp \ 733 nv50_ir_target_nv50.cpp \ 734 nv50_ir_util.cpp \ 735 nv50_ir_emit_gk110.cpp \ 736 nv50_ir_emit_gm107.cpp \ 737 nv50_ir_emit_nvc0.cpp \ 738 nv50_ir_lowering_gm107.cpp \ 739 nv50_ir_lowering_nvc0.cpp \ 740 nv50_ir_target_gm107.cpp \ 741 nv50_ir_target_nvc0.cpp 742 743 GALLIUM_SOURCES.drivers/nouveau/nvc0 = \ 744 nvc0_compute.c \ 745 nvc0_context.c \ 746 nvc0_formats.c \ 747 nvc0_miptree.c \ 748 nvc0_resource.c \ 749 nvc0_screen.c \ 750 nvc0_state.c \ 751 nvc0_state_validate.c \ 752 nvc0_surface.c \ 753 nvc0_tex.c \ 754 nvc0_transfer.c \ 755 nvc0_vbo.c \ 756 nvc0_vbo_translate.c \ 757 nvc0_program.c \ 758 nvc0_shader_state.c \ 759 nvc0_query.c \ 760 nvc0_query_hw.c \ 761 nvc0_query_hw_metric.c \ 762 nvc0_query_hw_sm.c \ 763 nvc0_query_sw.c \ 764 nve4_compute.c \ 765 nvc0_video.c \ 766 nvc0_video_bsp.c \ 767 nvc0_video_vp.c \ 768 nvc0_video_ppp.c 769 770 771 GALLIUM_SOURCES.winsys/nouveau/drm = \ 772 nouveau_drm_winsys.c 773 774 .for _f in ${GALLIUM_SOURCES.drivers/nouveau} \ 775 ${GALLIUM_SOURCES.drivers/nouveau/nv30} \ 776 ${GALLIUM_SOURCES.drivers/nouveau/nv50} \ 777 ${GALLIUM_SOURCES.drivers/nouveau/codegen} \ 778 ${GALLIUM_SOURCES.drivers/nouveau/nvc0} \ 779 ${GALLIUM_SOURCES.winsys/nouveau/drm} 780 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/drivers/nouveau \ 781 -I${DESTDIR}${X11INCDIR}/libdrm/nouveau 782 .endfor 783 784 GALLIUM_SOURCES.winsys/radeon/drm = \ 785 radeon_drm_bo.c \ 786 radeon_drm_cs.c \ 787 radeon_drm_surface.c \ 788 radeon_drm_winsys.c 789 790 GALLIUM_SOURCES.winsys/amdgpu/drm = \ 791 amdgpu_bo.c \ 792 amdgpu_cs.c \ 793 amdgpu_surface.c \ 794 amdgpu_winsys.c 795 796 .for _f in ${GALLIUM_SOURCES.winsys/amdgpu/drm} 797 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/amd 798 .endfor 799 800 GALLIUM_SOURCES.state_trackers/vdpau = \ 801 bitmap.c \ 802 decode.c \ 803 device.c \ 804 ftab.c \ 805 htab.c \ 806 mixer.c \ 807 output.c \ 808 preemption.c \ 809 presentation.c \ 810 query.c \ 811 surface.c 812 813 GALLIUM_SOURCES.drivers/llvmpipe = \ 814 lp_bld_alpha.c \ 815 lp_bld_blend_aos.c \ 816 lp_bld_blend.c \ 817 lp_bld_blend_logicop.c \ 818 lp_bld_depth.c \ 819 lp_bld_interp.c \ 820 lp_clear.c \ 821 lp_context.c \ 822 lp_draw_arrays.c \ 823 lp_fence.c \ 824 lp_flush.c \ 825 lp_jit.c \ 826 lp_memory.c \ 827 lp_perf.c \ 828 lp_query.c \ 829 lp_rast.c \ 830 lp_rast_debug.c \ 831 lp_rast_tri.c \ 832 lp_scene.c \ 833 lp_scene_queue.c \ 834 lp_screen.c \ 835 lp_setup.c \ 836 lp_setup_line.c \ 837 lp_setup_point.c \ 838 lp_setup_tri.c \ 839 lp_setup_vbuf.c \ 840 lp_state_blend.c \ 841 lp_state_clip.c \ 842 lp_state_derived.c \ 843 lp_state_fs.c \ 844 lp_state_gs.c \ 845 lp_state_rasterizer.c \ 846 lp_state_sampler.c \ 847 lp_state_setup.c \ 848 lp_state_so.c \ 849 lp_state_surface.c \ 850 lp_state_vertex.c \ 851 lp_state_vs.c \ 852 lp_surface.c \ 853 lp_tex_sample.c \ 854 lp_texture.c 855 856 GALLIUM_SOURCES.drivers/softpipe = \ 857 sp_buffer.c \ 858 sp_clear.c \ 859 sp_context.c \ 860 sp_compute.c \ 861 sp_draw_arrays.c \ 862 sp_fence.c \ 863 sp_flush.c \ 864 sp_fs_exec.c \ 865 sp_image.c \ 866 sp_prim_vbuf.c \ 867 sp_quad_blend.c \ 868 sp_quad_depth_test.c \ 869 sp_quad_fs.c \ 870 sp_quad_pipe.c \ 871 sp_quad_stipple.c \ 872 sp_query.c \ 873 sp_screen.c \ 874 sp_setup.c \ 875 sp_state_blend.c \ 876 sp_state_clip.c \ 877 sp_state_derived.c \ 878 sp_state_image.c \ 879 sp_state_rasterizer.c \ 880 sp_state_sampler.c \ 881 sp_state_shader.c \ 882 sp_state_so.c \ 883 sp_state_surface.c \ 884 sp_state_vertex.c \ 885 sp_surface.c \ 886 sp_tex_sample.c \ 887 sp_tex_tile_cache.c \ 888 sp_texture.c \ 889 sp_tile_cache.c 890 891 GALLIUM_SOURCES.winsys/sw/null = \ 892 null_sw_winsys.c 893 894 GALLIUM_SOURCES.winsys/sw/wrapper = \ 895 wrapper_sw_winsys.c 896 897 GALLIUM_SOURCES.winsys/sw/dri = \ 898 dri_sw_winsys.c 899 900 GALLIUM_SOURCES.winsys/sw/kms-dri = \ 901 kms_dri_sw_winsys.c 902 903 GALLIUM_SOURCES.state_trackers/dri = \ 904 dri_context.c \ 905 dri_drawable.c \ 906 dri_helpers.c \ 907 dri_query_renderer.c \ 908 dri_screen.c \ 909 drisw.c \ 910 dri2.c 911 .for _f in ${GALLIUM_SOURCES.state_trackers/dri} 912 CPPFLAGS.${_f} += -I${X11SRCDIR.Mesa}/src/gallium/state_trackers/dri/common 913 .endfor 914 915 # missing 916 CPPFLAGS+= \ 917 -DGALLIUM_SOFTPIPE \ 918 -DGALLIUM_STATIC_TARGETS=1 \ 919 -DMESA_EGL_NO_X11_HEADERS 920 921 .for _d in ${GALLIUM_SUBDIRS} 922 SRCS+= ${GALLIUM_SOURCES.${_d}} 923 .PATH: ${X11SRCDIR.Mesa}/src/gallium/${_d} 924 . for _s in ${GALLIUM_SOURCES.${_d}} 925 CPPFLAGS.${_s}+= -I${X11SRCDIR.Mesa}/src/gallium/${_d} 926 . endfor 927 .endfor 928 929 #. if defined(${GALLIUM_SOURCES.${_d}}) 930 #SRCS+= ${GALLIUM_SOURCES.${_d}} 931 #. endif 932 933 .include "../libloader.mk" 934 935 .if ${BUILD_RADEON} == 1 936 CFLAGS+= -pthread 937 LDFLAGS+= -pthread 938 LIBDPLIBS+= pthread ${.CURDIR}/../../../../../lib/libpthread 939 .endif 940 941 LIBDPLIBS+= m ${.CURDIR}/../../../../../lib/libm 942 .if ${BUILD_RADEON} == 1 || ${BUILD_NOUVEAU} == 1 943 LIBDPLIBS+= drm ${.CURDIR}/../libdrm 944 .if ${BUILD_I915} == 1 945 LIBDPLIBS+= drm_intel ${.CURDIR}/../libdrm_intel 946 .endif 947 .if ${BUILD_RADEON} == 1 948 LIBDPLIBS+= drm_radeon ${.CURDIR}/../libdrm_radeon 949 LIBDPLIBS+= drm_amdgpu ${.CURDIR}/../libdrm_amdgpu 950 .endif # ${BUILD_RADEON} == 1 951 .if ${BUILD_NOUVEAU} == 1 952 LIBDPLIBS+= drm_nouveau ${.CURDIR}/../libdrm_nouveau 953 .endif # ${BUILD_NOUVEAU} == 1 954 .endif # ${BUILD_RADEON} == 1 || ${BUILD_NOUVEAU} == 1 955 LIBDPLIBS+= glapi ${.CURDIR}/../libglapi 956 LIBDPLIBS+= expat ${.CURDIR}/../../../../../external/mit/expat/lib/libexpat 957 LIBDPLIBS+= terminfo ${.CURDIR}/../../../../../lib/libterminfo 958 LIBDPLIBS+= z ${.CURDIR}/../../../../../lib/libz 959 LIBDPLIBS+= execinfo ${.CURDIR}/../../../../../lib/libexecinfo 960 961 # gallium drivers requiring LLVM 962 .if ${BUILD_LLVMPIPE} == 1 || ${BUILD_RADEON} == 1 963 964 LLVM_LIB_DIR!= cd ${.CURDIR}/../../../../../external/bsd/llvm/librt; ${PRINTOBJDIR} 965 966 LLVM_LIBS= \ 967 TransformsCoroutines \ 968 Passes \ 969 MCJIT \ 970 ExecutionEngine \ 971 RuntimeDyld 972 973 .if ${BUILD_RADEON} == 1 974 LLVM_LIBS+= \ 975 AMDGPUCodeGen \ 976 AMDGPUMCTargetDesc \ 977 AMDGPUAsmPrinter \ 978 AMDGPUTargetInfo \ 979 AMDGPUAsmParser \ 980 AMDGPUUtils 981 .endif 982 983 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" 984 # XXX duplicates 985 LLVM_LIBS+= \ 986 X86Disassembler \ 987 X86CodeGen \ 988 X86MCTargetDesc \ 989 X86Disassembler \ 990 X86MCTargetDesc \ 991 X86AsmPrinter \ 992 X86TargetInfo \ 993 X86Utils 994 .endif 995 LLVM_LIBS+= \ 996 GlobalISel \ 997 MCDisassembler \ 998 SelectionDAG \ 999 AsmPrinter \ 1000 CodeGen \ 1001 Target \ 1002 InstCombine \ 1003 ScalarOpts \ 1004 DebugInfoCodeView \ 1005 Object \ 1006 BitReader \ 1007 MCParser \ 1008 MC \ 1009 ipo \ 1010 Instrumentation \ 1011 IRReader \ 1012 AsmParser \ 1013 Vectorize \ 1014 TransformsAggressiveInstCombine \ 1015 ProfileData \ 1016 Analysis \ 1017 IR \ 1018 Linker \ 1019 BinaryFormat \ 1020 TransformsUtils \ 1021 Support 1022 1023 .for llvm_library in ${LLVM_LIBS} 1024 dir!= cd ${LLVM_LIB_DIR}/libLLVM${llvm_library}; ${PRINTOBJDIR} 1025 lib= ${dir}/libLLVM${llvm_library}_pic.a 1026 DPADD+= ${lib} 1027 LDADD+= ${lib} 1028 .endfor 1029 1030 .endif # ${BUILD_LLVM_PIPE} == 1 || ${BUILD_RADEON} == 1 1031 1032 LDFLAGS+= -Wl,--version-script=${X11SRCDIR.Mesa}/src/gallium/targets/dri/dri.sym 1033 1034 ## build mesagallium parts 1035 MESA_SRC_MODULES= main math vbo state_tracker program asm_s 1036 .if ${BUILD_RADEON} == 1 1037 MESA_SRC_MODULES+= amd 1038 .endif 1039 1040 .include "../libmesa.mk" 1041 .include "../libglsl.mk" 1042 1043 # Special addition for just gallium; it misses the rest of asm_c files. 1044 .PATH: ${X11SRCDIR.Mesa}/src/mesa/x86 1045 SRCS+= common_x86.c 1046 1047 .if ${MACHINE} == "amd64" || ${MACHINE} == "i386" 1048 SRCS+= streaming-load-memcpy.c 1049 CPPFLAGS.streaming-load-memcpy.c+= -msse4.1 1050 .endif 1051 1052 # Needs 64bit atomics 1053 .if ${MACHINE} == "i386" 1054 CPPFLAGS+= -march=i586 1055 .endif 1056 1057 .include "../driver.mk" 1058 1059 1060 .PATH: ${X11SRCDIR.Mesa}/src/gallium/targets/dri 1061 SRCS+= target.c 1062 1063 CPPFLAGS+= \ 1064 -I${X11SRCDIR.Mesa}/src/gallium/include \ 1065 -I${X11SRCDIR.Mesa}/src/gallium/auxiliary \ 1066 -I${X11SRCDIR.Mesa}/src/gallium/drivers \ 1067 -I${X11SRCDIR.Mesa}/../src/mesa/drivers/dri/common 1068 1069 CPPFLAGS.target.c += \ 1070 -DDRI_TARGET \ 1071 -DGALLIUM_NOOP \ 1072 -DGALLIUM_RBUG \ 1073 -DGALLIUM_TRACE \ 1074 -DGALLIUM_SOFTPIPE \ 1075 -I${X11SRCDIR.Mesa}/src/gallium/state_trackers/dri \ 1076 -I${X11SRCDIR.Mesa}/src/loader \ 1077 -I${X11SRCDIR.Mesa}/src/gallium/winsys 1078 1079 .if ${BUILD_LLVMPIPE} == 1 1080 CPPFLAGS.target.c += \ 1081 -DGALLIUM_LLVMPIPE 1082 .endif #${BUILD_LLVMPIPE} == 1 1083 .if ${BUILD_I915} == 1 1084 CPPFLAGS.target.c += \ 1085 -DGALLIUM_I915 \ 1086 -DGALLIUM_ILO 1087 .endif 1088 .if ${BUILD_RADEON} == 1 1089 CPPFLAGS.target.c += \ 1090 -DGALLIUM_R200 \ 1091 -DGALLIUM_R300 \ 1092 -DGALLIUM_R600 \ 1093 -DGALLIUM_RADEONSI 1094 .endif # ${BUILD_RADEON} == 1 1095 1096 .if ${BUILD_NOUVEAU} == 1 1097 CPPFLAGS.target.c += \ 1098 -DGALLIUM_NOUVEAU 1099 .endif # ${BUILD_NOUVEAU} == 1 1100 1101 CWARNFLAGS.clang+= -Wno-error=constant-conversion \ 1102 -Wno-error=tautological-constant-out-of-range-compare \ 1103 -Wno-error=pointer-sign \ 1104 -Wno-error=switch \ 1105 -Wno-error=absolute-value \ 1106 -Wno-error=tautological-compare \ 1107 -Wno-error=static-in-inline \ 1108 -Wno-error=logical-not-parentheses \ 1109 -Wno-error=constant-logical-operand \ 1110 -Wno-error=unknown-warning-option \ 1111 -Wno-error=typedef-redefinition \ 1112 -Wno-error=enum-conversion # https://bugs.freedesktop.org/show_bug.cgi?id=109761 1113 1114 .include <bsd.x11.mk> 1115 LIBDIR= ${X11USRLIBDIR}/modules/dri 1116 1117 .for _d in ${DRIVERS} 1118 SYMLINKS+= gallium_dri.so ${DRIDIR}/${_d}_dri.so 1119 SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so.${SHLIB_MAJOR} 1120 .if ${MKDEBUG} != "no" 1121 SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHLIB_MAJOR}.debug 1122 .endif 1123 .endfor 1124 1125 .if ${MACHINE_ARCH} == "sparc" || ${COMMON_MACHINE_ARCH:U} == "sparc" 1126 COPTS+= ${${ACTIVE_CC} == "clang":? -Wa,-Av8plus :} 1127 .endif 1128 1129 .include <bsd.lib.mk> 1130 # Don't regenerate c files 1131 .y.c: 1132