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 | ||
7a8bc117 LDM |
6 | # Unconditionally enable W=1 warnings locally |
7 | # --- begin copy-paste W=1 warnings from scripts/Makefile.extrawarn | |
8 | subdir-ccflags-y += -Wextra -Wunused -Wno-unused-parameter | |
9 | subdir-ccflags-y += -Wmissing-declarations | |
10 | subdir-ccflags-y += $(call cc-option, -Wrestrict) | |
11 | subdir-ccflags-y += -Wmissing-format-attribute | |
12 | subdir-ccflags-y += -Wmissing-prototypes | |
13 | subdir-ccflags-y += -Wold-style-definition | |
14 | subdir-ccflags-y += -Wmissing-include-dirs | |
15 | subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable) | |
16 | subdir-ccflags-y += $(call cc-option, -Wunused-const-variable) | |
17 | subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned) | |
18 | subdir-ccflags-y += $(call cc-option, -Wformat-overflow) | |
19 | subdir-ccflags-y += $(call cc-option, -Wformat-truncation) | |
7a8bc117 LDM |
20 | subdir-ccflags-y += $(call cc-option, -Wstringop-truncation) |
21 | # The following turn off the warnings enabled by -Wextra | |
22 | ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),) | |
23 | subdir-ccflags-y += -Wno-missing-field-initializers | |
24 | subdir-ccflags-y += -Wno-type-limits | |
25 | subdir-ccflags-y += -Wno-shift-negative-value | |
26 | endif | |
27 | ifeq ($(findstring 3, $(KBUILD_EXTRA_WARN)),) | |
28 | subdir-ccflags-y += -Wno-sign-compare | |
29 | endif | |
30 | # --- end copy-paste | |
31 | ||
32 | # Enable -Werror in CI and development | |
dd08ebf6 MB |
33 | subdir-ccflags-$(CONFIG_DRM_XE_WERROR) += -Werror |
34 | ||
464f2243 | 35 | subdir-ccflags-y += -I$(obj) -I$(srctree)/$(src) |
dd08ebf6 | 36 | |
9616e74b LDM |
37 | # generated sources |
38 | hostprogs := xe_gen_wa_oob | |
39 | ||
40 | generated_oob := $(obj)/generated/xe_wa_oob.c $(obj)/generated/xe_wa_oob.h | |
41 | ||
42 | quiet_cmd_wa_oob = GEN $(notdir $(generated_oob)) | |
43 | cmd_wa_oob = mkdir -p $(@D); $^ $(generated_oob) | |
44 | ||
e62d2e00 DH |
45 | $(obj)/generated/%_wa_oob.c $(obj)/generated/%_wa_oob.h: $(obj)/xe_gen_wa_oob \ |
46 | $(srctree)/$(src)/xe_wa_oob.rules | |
9616e74b LDM |
47 | $(call cmd,wa_oob) |
48 | ||
aae84bf1 DCS |
49 | uses_generated_oob := \ |
50 | $(obj)/xe_gsc.o \ | |
51 | $(obj)/xe_guc.o \ | |
52 | $(obj)/xe_migrate.o \ | |
53 | $(obj)/xe_ring_ops.o \ | |
54 | $(obj)/xe_vm.o \ | |
55 | $(obj)/xe_wa.o \ | |
56 | $(obj)/xe_ttm_stolen_mgr.o | |
57 | ||
58 | $(uses_generated_oob): $(generated_oob) | |
9616e74b | 59 | |
dd08ebf6 MB |
60 | # Please keep these build lists sorted! |
61 | ||
62 | # core driver code | |
63 | ||
64 | xe-y += xe_bb.o \ | |
65 | xe_bo.o \ | |
66 | xe_bo_evict.o \ | |
67 | xe_debugfs.o \ | |
e7994850 | 68 | xe_devcoredump.o \ |
dd08ebf6 | 69 | xe_device.o \ |
b2d75619 | 70 | xe_device_sysfs.o \ |
dd08ebf6 | 71 | xe_dma_buf.o \ |
8f965392 | 72 | xe_drm_client.o \ |
dd08ebf6 MB |
73 | xe_exec.o \ |
74 | xe_execlist.o \ | |
c22a4ed0 | 75 | xe_exec_queue.o \ |
dd08ebf6 MB |
76 | xe_force_wake.o \ |
77 | xe_ggtt.o \ | |
78 | xe_gpu_scheduler.o \ | |
0d1caff4 | 79 | xe_gsc.o \ |
997a55ca | 80 | xe_gsc_proxy.o \ |
0881cbe0 | 81 | xe_gsc_submit.o \ |
dd08ebf6 | 82 | xe_gt.o \ |
0d97ecce | 83 | xe_gt_ccs_mode.o \ |
dd08ebf6 MB |
84 | xe_gt_clock.o \ |
85 | xe_gt_debugfs.o \ | |
bef52b5c | 86 | xe_gt_freq.o \ |
c550f64f | 87 | xe_gt_idle.o \ |
dd08ebf6 MB |
88 | xe_gt_mcr.o \ |
89 | xe_gt_pagefault.o \ | |
90 | xe_gt_sysfs.o \ | |
1c8e9019 | 91 | xe_gt_throttle_sysfs.o \ |
a9351846 | 92 | xe_gt_tlb_invalidation.o \ |
dd08ebf6 MB |
93 | xe_gt_topology.o \ |
94 | xe_guc.o \ | |
95 | xe_guc_ads.o \ | |
96 | xe_guc_ct.o \ | |
587c7334 | 97 | xe_guc_db_mgr.o \ |
dd08ebf6 MB |
98 | xe_guc_debugfs.o \ |
99 | xe_guc_hwconfig.o \ | |
100 | xe_guc_log.o \ | |
101 | xe_guc_pc.o \ | |
102 | xe_guc_submit.o \ | |
87a4c85d | 103 | xe_heci_gsc.o \ |
dd08ebf6 | 104 | xe_hw_engine.o \ |
038ff941 | 105 | xe_hw_engine_class_sysfs.o \ |
dd08ebf6 MB |
106 | xe_hw_fence.o \ |
107 | xe_huc.o \ | |
108 | xe_huc_debugfs.o \ | |
109 | xe_irq.o \ | |
110 | xe_lrc.o \ | |
111 | xe_migrate.o \ | |
112 | xe_mmio.o \ | |
113 | xe_mocs.o \ | |
114 | xe_module.o \ | |
576c6380 | 115 | xe_pat.o \ |
dd08ebf6 MB |
116 | xe_pci.o \ |
117 | xe_pcode.o \ | |
118 | xe_pm.o \ | |
119 | xe_preempt_fence.o \ | |
120 | xe_pt.o \ | |
121 | xe_pt_walk.o \ | |
122 | xe_query.o \ | |
845f64bd | 123 | xe_range_fence.o \ |
dd08ebf6 MB |
124 | xe_reg_sr.o \ |
125 | xe_reg_whitelist.o \ | |
126 | xe_rtp.o \ | |
127 | xe_ring_ops.o \ | |
128 | xe_sa.o \ | |
129 | xe_sched_job.o \ | |
130 | xe_step.o \ | |
131 | xe_sync.o \ | |
ad703e06 | 132 | xe_tile.o \ |
e5a845fd | 133 | xe_tile_sysfs.o \ |
dd08ebf6 | 134 | xe_trace.o \ |
1a545ed7 | 135 | xe_ttm_sys_mgr.o \ |
d8b52a02 | 136 | xe_ttm_stolen_mgr.o \ |
dd08ebf6 MB |
137 | xe_ttm_vram_mgr.o \ |
138 | xe_tuning.o \ | |
139 | xe_uc.o \ | |
140 | xe_uc_debugfs.o \ | |
141 | xe_uc_fw.o \ | |
142 | xe_vm.o \ | |
4ae3aeab | 143 | xe_vram_freq.o \ |
dd08ebf6 MB |
144 | xe_wait_user_fence.o \ |
145 | xe_wa.o \ | |
146 | xe_wopcm.o | |
147 | ||
fb1b7060 BN |
148 | # graphics hardware monitoring (HWMON) support |
149 | xe-$(CONFIG_HWMON) += xe_hwmon.o | |
150 | ||
13e5c32c | 151 | # graphics virtualization (SR-IOV) support |
a6581ebe | 152 | xe-y += \ |
811fe9f5 | 153 | xe_guc_relay.o \ |
a6581ebe MW |
154 | xe_memirq.o \ |
155 | xe_sriov.o | |
13e5c32c | 156 | |
b1d20405 MW |
157 | xe-$(CONFIG_PCI_IOV) += \ |
158 | xe_lmtt.o \ | |
159 | xe_lmtt_2l.o \ | |
160 | xe_lmtt_ml.o | |
161 | ||
d1d95985 AB |
162 | # include helpers for tests even when XE is built-in |
163 | ifdef CONFIG_DRM_XE_KUNIT_TEST | |
164 | xe-y += tests/xe_kunit_helpers.o | |
165 | endif | |
5095d13d | 166 | |
44e69495 ML |
167 | # i915 Display compat #defines and #includes |
168 | subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \ | |
169 | -I$(srctree)/$(src)/display/ext \ | |
170 | -I$(srctree)/$(src)/compat-i915-headers \ | |
44e69495 ML |
171 | -I$(srctree)/drivers/gpu/drm/i915/display/ \ |
172 | -Ddrm_i915_gem_object=xe_bo \ | |
173 | -Ddrm_i915_private=xe_device | |
174 | ||
c40845e3 AB |
175 | CFLAGS_i915-display/intel_fbdev.o = -Wno-override-init |
176 | CFLAGS_i915-display/intel_display_device.o = -Wno-override-init | |
44e69495 ML |
177 | |
178 | # Rule to build SOC code shared with i915 | |
179 | $(obj)/i915-soc/%.o: $(srctree)/drivers/gpu/drm/i915/soc/%.c FORCE | |
180 | $(call cmd,force_checksrc) | |
181 | $(call if_changed_rule,cc_o_c) | |
182 | ||
183 | # Rule to build display code shared with i915 | |
184 | $(obj)/i915-display/%.o: $(srctree)/drivers/gpu/drm/i915/display/%.c FORCE | |
185 | $(call cmd,force_checksrc) | |
186 | $(call if_changed_rule,cc_o_c) | |
187 | ||
188 | # Display code specific to xe | |
189 | xe-$(CONFIG_DRM_XE_DISPLAY) += \ | |
f01ece50 JN |
190 | display/ext/i915_irq.o \ |
191 | display/ext/i915_utils.o \ | |
192 | display/intel_fb_bo.o \ | |
193 | display/intel_fbdev_fb.o \ | |
194 | display/xe_display.o \ | |
c79802d1 | 195 | display/xe_display_misc.o \ |
f01ece50 | 196 | display/xe_display_rps.o \ |
a754391f | 197 | display/xe_dsb_buffer.o \ |
f01ece50 JN |
198 | display/xe_fb_pin.o \ |
199 | display/xe_hdcp_gsc.o \ | |
200 | display/xe_plane_initial.o | |
44e69495 ML |
201 | |
202 | # SOC code shared with i915 | |
203 | xe-$(CONFIG_DRM_XE_DISPLAY) += \ | |
204 | i915-soc/intel_dram.o \ | |
205 | i915-soc/intel_pch.o | |
206 | ||
207 | # Display code shared with i915 | |
208 | xe-$(CONFIG_DRM_XE_DISPLAY) += \ | |
209 | i915-display/icl_dsi.o \ | |
210 | i915-display/intel_atomic.o \ | |
211 | i915-display/intel_atomic_plane.o \ | |
212 | i915-display/intel_audio.o \ | |
213 | i915-display/intel_backlight.o \ | |
214 | i915-display/intel_bios.o \ | |
215 | i915-display/intel_bw.o \ | |
216 | i915-display/intel_cdclk.o \ | |
217 | i915-display/intel_color.o \ | |
218 | i915-display/intel_combo_phy.o \ | |
219 | i915-display/intel_connector.o \ | |
220 | i915-display/intel_crtc.o \ | |
221 | i915-display/intel_crtc_state_dump.o \ | |
222 | i915-display/intel_cursor.o \ | |
223 | i915-display/intel_cx0_phy.o \ | |
224 | i915-display/intel_ddi.o \ | |
225 | i915-display/intel_ddi_buf_trans.o \ | |
226 | i915-display/intel_display.o \ | |
44e69495 ML |
227 | i915-display/intel_display_device.o \ |
228 | i915-display/intel_display_driver.o \ | |
229 | i915-display/intel_display_irq.o \ | |
230 | i915-display/intel_display_params.o \ | |
231 | i915-display/intel_display_power.o \ | |
232 | i915-display/intel_display_power_map.o \ | |
233 | i915-display/intel_display_power_well.o \ | |
234 | i915-display/intel_display_trace.o \ | |
235 | i915-display/intel_display_wa.o \ | |
236 | i915-display/intel_dkl_phy.o \ | |
237 | i915-display/intel_dmc.o \ | |
238 | i915-display/intel_dp.o \ | |
239 | i915-display/intel_dp_aux.o \ | |
240 | i915-display/intel_dp_aux_backlight.o \ | |
241 | i915-display/intel_dp_hdcp.o \ | |
242 | i915-display/intel_dp_link_training.o \ | |
243 | i915-display/intel_dp_mst.o \ | |
244 | i915-display/intel_dpll.o \ | |
245 | i915-display/intel_dpll_mgr.o \ | |
246 | i915-display/intel_dpt_common.o \ | |
247 | i915-display/intel_drrs.o \ | |
248 | i915-display/intel_dsb.o \ | |
249 | i915-display/intel_dsi.o \ | |
250 | i915-display/intel_dsi_dcs_backlight.o \ | |
251 | i915-display/intel_dsi_vbt.o \ | |
252 | i915-display/intel_fb.o \ | |
253 | i915-display/intel_fbc.o \ | |
254 | i915-display/intel_fdi.o \ | |
255 | i915-display/intel_fifo_underrun.o \ | |
256 | i915-display/intel_frontbuffer.o \ | |
257 | i915-display/intel_global_state.o \ | |
258 | i915-display/intel_gmbus.o \ | |
259 | i915-display/intel_hdcp.o \ | |
260 | i915-display/intel_hdmi.o \ | |
261 | i915-display/intel_hotplug.o \ | |
262 | i915-display/intel_hotplug_irq.o \ | |
263 | i915-display/intel_hti.o \ | |
264 | i915-display/intel_link_bw.o \ | |
265 | i915-display/intel_lspcon.o \ | |
266 | i915-display/intel_modeset_lock.o \ | |
267 | i915-display/intel_modeset_setup.o \ | |
268 | i915-display/intel_modeset_verify.o \ | |
269 | i915-display/intel_panel.o \ | |
44e69495 ML |
270 | i915-display/intel_pmdemand.o \ |
271 | i915-display/intel_pps.o \ | |
272 | i915-display/intel_psr.o \ | |
273 | i915-display/intel_qp_tables.o \ | |
274 | i915-display/intel_quirks.o \ | |
275 | i915-display/intel_snps_phy.o \ | |
276 | i915-display/intel_tc.o \ | |
277 | i915-display/intel_vblank.o \ | |
278 | i915-display/intel_vdsc.o \ | |
279 | i915-display/intel_vga.o \ | |
280 | i915-display/intel_vrr.o \ | |
281 | i915-display/intel_wm.o \ | |
282 | i915-display/skl_scaler.o \ | |
283 | i915-display/skl_universal_plane.o \ | |
284 | i915-display/skl_watermark.o | |
9a56502f | 285 | |
44e69495 ML |
286 | ifeq ($(CONFIG_ACPI),y) |
287 | xe-$(CONFIG_DRM_XE_DISPLAY) += \ | |
288 | i915-display/intel_acpi.o \ | |
289 | i915-display/intel_opregion.o | |
290 | endif | |
291 | ||
292 | ifeq ($(CONFIG_DRM_FBDEV_EMULATION),y) | |
293 | xe-$(CONFIG_DRM_XE_DISPLAY) += i915-display/intel_fbdev.o | |
294 | endif | |
295 | ||
439987f6 JN |
296 | ifeq ($(CONFIG_DEBUG_FS),y) |
297 | xe-$(CONFIG_DRM_XE_DISPLAY) += \ | |
298 | i915-display/intel_display_debugfs.o \ | |
299 | i915-display/intel_display_debugfs_params.o \ | |
300 | i915-display/intel_pipe_crc.o | |
301 | endif | |
302 | ||
44e69495 ML |
303 | obj-$(CONFIG_DRM_XE) += xe.o |
304 | obj-$(CONFIG_DRM_XE_KUNIT_TEST) += tests/ | |
305 | ||
dd08ebf6 | 306 | # header test |
9a56502f | 307 | hdrtest_find_args := -not -path xe_rtp_helpers.h |
44e69495 ML |
308 | ifneq ($(CONFIG_DRM_XE_DISPLAY),y) |
309 | hdrtest_find_args += -not -path display/\* -not -path compat-i915-headers/\* -not -path xe_display.h | |
310 | endif | |
9a56502f | 311 | |
dd08ebf6 | 312 | always-$(CONFIG_DRM_XE_WERROR) += \ |
9a56502f | 313 | $(patsubst %.h,%.hdrtest, $(shell cd $(srctree)/$(src) && find * -name '*.h' $(hdrtest_find_args))) |
dd08ebf6 MB |
314 | |
315 | quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@) | |
316 | cmd_hdrtest = $(CC) -DHDRTEST $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@ | |
317 | ||
318 | $(obj)/%.hdrtest: $(src)/%.h FORCE | |
319 | $(call if_changed_dep,hdrtest) |