Commit | Line | Data |
---|---|---|
dd08ebf6 MB |
1 | # SPDX-License-Identifier: GPL-2.0 |
2 | # | |
3 | # Makefile for the drm device driver. This driver provides support for the | |
4 | # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. | |
5 | ||
6 | # Add a set of useful warning flags and enable -Werror for CI to prevent | |
7 | # trivial mistakes from creeping in. We have to do this piecemeal as we reject | |
8 | # any patch that isn't warning clean, so turning on -Wall -Wextra (or W=1) we | |
9 | # need to filter out dubious warnings. Still it is our interest | |
10 | # to keep running locally with W=1 C=1 until we are completely clean. | |
11 | # | |
12 | # Note the danger in using -Wall -Wextra is that when CI updates gcc we | |
13 | # will most likely get a sudden build breakage... Hopefully we will fix | |
14 | # new warnings before CI updates! | |
15 | subdir-ccflags-y := -Wall -Wextra | |
5a4a8e8b LDM |
16 | subdir-ccflags-y += $(call cc-disable-warning, unused-parameter) |
17 | subdir-ccflags-y += $(call cc-disable-warning, type-limits) | |
dd08ebf6 MB |
18 | subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers) |
19 | subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable) | |
20 | # clang warnings | |
21 | subdir-ccflags-y += $(call cc-disable-warning, sign-compare) | |
22 | subdir-ccflags-y += $(call cc-disable-warning, sometimes-uninitialized) | |
23 | subdir-ccflags-y += $(call cc-disable-warning, initializer-overrides) | |
24 | subdir-ccflags-y += $(call cc-disable-warning, frame-address) | |
25 | subdir-ccflags-$(CONFIG_DRM_XE_WERROR) += -Werror | |
26 | ||
27 | # Fine grained warnings disable | |
28 | CFLAGS_xe_pci.o = $(call cc-disable-warning, override-init) | |
29 | ||
464f2243 | 30 | subdir-ccflags-y += -I$(obj) -I$(srctree)/$(src) |
dd08ebf6 | 31 | |
9616e74b LDM |
32 | # generated sources |
33 | hostprogs := xe_gen_wa_oob | |
34 | ||
35 | generated_oob := $(obj)/generated/xe_wa_oob.c $(obj)/generated/xe_wa_oob.h | |
36 | ||
37 | quiet_cmd_wa_oob = GEN $(notdir $(generated_oob)) | |
38 | cmd_wa_oob = mkdir -p $(@D); $^ $(generated_oob) | |
39 | ||
40 | $(generated_oob) &: $(obj)/xe_gen_wa_oob $(srctree)/$(src)/xe_wa_oob.rules | |
41 | $(call cmd,wa_oob) | |
42 | ||
43 | $(obj)/xe_wa.o: $(generated_oob) | |
44 | ||
dd08ebf6 MB |
45 | # Please keep these build lists sorted! |
46 | ||
47 | # core driver code | |
48 | ||
49 | xe-y += xe_bb.o \ | |
50 | xe_bo.o \ | |
51 | xe_bo_evict.o \ | |
52 | xe_debugfs.o \ | |
e7994850 | 53 | xe_devcoredump.o \ |
dd08ebf6 MB |
54 | xe_device.o \ |
55 | xe_dma_buf.o \ | |
56 | xe_engine.o \ | |
57 | xe_exec.o \ | |
58 | xe_execlist.o \ | |
59 | xe_force_wake.o \ | |
60 | xe_ggtt.o \ | |
61 | xe_gpu_scheduler.o \ | |
62 | xe_gt.o \ | |
63 | xe_gt_clock.o \ | |
64 | xe_gt_debugfs.o \ | |
65 | xe_gt_mcr.o \ | |
66 | xe_gt_pagefault.o \ | |
67 | xe_gt_sysfs.o \ | |
a9351846 | 68 | xe_gt_tlb_invalidation.o \ |
dd08ebf6 MB |
69 | xe_gt_topology.o \ |
70 | xe_guc.o \ | |
71 | xe_guc_ads.o \ | |
72 | xe_guc_ct.o \ | |
73 | xe_guc_debugfs.o \ | |
74 | xe_guc_hwconfig.o \ | |
75 | xe_guc_log.o \ | |
76 | xe_guc_pc.o \ | |
77 | xe_guc_submit.o \ | |
78 | xe_hw_engine.o \ | |
79 | xe_hw_fence.o \ | |
80 | xe_huc.o \ | |
81 | xe_huc_debugfs.o \ | |
82 | xe_irq.o \ | |
83 | xe_lrc.o \ | |
84 | xe_migrate.o \ | |
85 | xe_mmio.o \ | |
86 | xe_mocs.o \ | |
87 | xe_module.o \ | |
576c6380 | 88 | xe_pat.o \ |
dd08ebf6 MB |
89 | xe_pci.o \ |
90 | xe_pcode.o \ | |
91 | xe_pm.o \ | |
92 | xe_preempt_fence.o \ | |
93 | xe_pt.o \ | |
94 | xe_pt_walk.o \ | |
95 | xe_query.o \ | |
96 | xe_reg_sr.o \ | |
97 | xe_reg_whitelist.o \ | |
98 | xe_rtp.o \ | |
99 | xe_ring_ops.o \ | |
100 | xe_sa.o \ | |
101 | xe_sched_job.o \ | |
102 | xe_step.o \ | |
103 | xe_sync.o \ | |
104 | xe_trace.o \ | |
1a545ed7 | 105 | xe_ttm_sys_mgr.o \ |
d8b52a02 | 106 | xe_ttm_stolen_mgr.o \ |
dd08ebf6 MB |
107 | xe_ttm_vram_mgr.o \ |
108 | xe_tuning.o \ | |
109 | xe_uc.o \ | |
110 | xe_uc_debugfs.o \ | |
111 | xe_uc_fw.o \ | |
112 | xe_vm.o \ | |
113 | xe_vm_madvise.o \ | |
114 | xe_wait_user_fence.o \ | |
115 | xe_wa.o \ | |
116 | xe_wopcm.o | |
117 | ||
dd08ebf6 MB |
118 | obj-$(CONFIG_DRM_XE) += xe.o |
119 | obj-$(CONFIG_DRM_XE_KUNIT_TEST) += tests/ | |
9a56502f | 120 | |
dd08ebf6 | 121 | # header test |
9a56502f LDM |
122 | hdrtest_find_args := -not -path xe_rtp_helpers.h |
123 | ||
dd08ebf6 | 124 | always-$(CONFIG_DRM_XE_WERROR) += \ |
9a56502f | 125 | $(patsubst %.h,%.hdrtest, $(shell cd $(srctree)/$(src) && find * -name '*.h' $(hdrtest_find_args))) |
dd08ebf6 MB |
126 | |
127 | quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@) | |
128 | cmd_hdrtest = $(CC) -DHDRTEST $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@ | |
129 | ||
130 | $(obj)/%.hdrtest: $(src)/%.h FORCE | |
131 | $(call if_changed_dep,hdrtest) |