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