xref: /linux/drivers/gpu/drm/i915/Makefile (revision e96fddb32931d007db12b1fce9b5e8e4c080401b)
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# Unconditionally enable W=1 warnings locally
7# --- begin copy-paste W=1 warnings from scripts/Makefile.extrawarn
8subdir-ccflags-y += -Wextra -Wunused -Wno-unused-parameter
9subdir-ccflags-y += -Wmissing-declarations
10subdir-ccflags-y += $(call cc-option, -Wrestrict)
11subdir-ccflags-y += -Wmissing-format-attribute
12subdir-ccflags-y += -Wmissing-prototypes
13subdir-ccflags-y += -Wold-style-definition
14subdir-ccflags-y += -Wmissing-include-dirs
15subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable)
16subdir-ccflags-y += $(call cc-option, -Wunused-const-variable)
17subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned)
18subdir-ccflags-y += $(call cc-option, -Wformat-overflow)
19subdir-ccflags-y += $(call cc-option, -Wformat-truncation)
20subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
21# The following turn off the warnings enabled by -Wextra
22ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),)
23subdir-ccflags-y += -Wno-missing-field-initializers
24subdir-ccflags-y += -Wno-type-limits
25subdir-ccflags-y += -Wno-shift-negative-value
26endif
27ifeq ($(findstring 3, $(KBUILD_EXTRA_WARN)),)
28subdir-ccflags-y += -Wno-sign-compare
29endif
30# --- end copy-paste
31
32# Enable -Werror in CI and development
33subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
34
35# Fine grained warnings disable
36CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init)
37CFLAGS_display/intel_display_device.o = $(call cc-disable-warning, override-init)
38CFLAGS_display/intel_fbdev.o = $(call cc-disable-warning, override-init)
39
40# Support compiling the display code separately for both i915 and xe
41# drivers. Define I915 when building i915.
42subdir-ccflags-y += -DI915
43
44subdir-ccflags-y += -I$(srctree)/$(src)
45
46# Please keep these build lists sorted!
47
48# core driver code
49i915-y += \
50	i915_config.o \
51	i915_driver.o \
52	i915_drm_client.o \
53	i915_getparam.o \
54	i915_ioctl.o \
55	i915_irq.o \
56	i915_mitigations.o \
57	i915_module.o \
58	i915_params.o \
59	i915_pci.o \
60	i915_scatterlist.o \
61	i915_suspend.o \
62	i915_switcheroo.o \
63	i915_sysfs.o \
64	i915_utils.o \
65	intel_clock_gating.o \
66	intel_device_info.o \
67	intel_memory_region.o \
68	intel_pcode.o \
69	intel_region_ttm.o \
70	intel_runtime_pm.o \
71	intel_sbi.o \
72	intel_step.o \
73	intel_uncore.o \
74	intel_wakeref.o \
75	vlv_sideband.o \
76	vlv_suspend.o
77
78# core peripheral code
79i915-y += \
80	soc/intel_dram.o \
81	soc/intel_gmch.o \
82	soc/intel_pch.o
83
84# core library code
85i915-y += \
86	i915_memcpy.o \
87	i915_mm.o \
88	i915_sw_fence.o \
89	i915_sw_fence_work.o \
90	i915_syncmap.o \
91	i915_user_extensions.o
92
93i915-$(CONFIG_COMPAT) += \
94	i915_ioc32.o
95i915-$(CONFIG_DEBUG_FS) += \
96	i915_debugfs.o \
97	i915_debugfs_params.o
98i915-$(CONFIG_PERF_EVENTS) += \
99	i915_pmu.o
100
101# "Graphics Technology" (aka we talk to the gpu)
102gt-y += \
103	gt/gen2_engine_cs.o \
104	gt/gen6_engine_cs.o \
105	gt/gen6_ppgtt.o \
106	gt/gen7_renderclear.o \
107	gt/gen8_engine_cs.o \
108	gt/gen8_ppgtt.o \
109	gt/intel_breadcrumbs.o \
110	gt/intel_context.o \
111	gt/intel_context_sseu.o \
112	gt/intel_engine_cs.o \
113	gt/intel_engine_heartbeat.o \
114	gt/intel_engine_pm.o \
115	gt/intel_engine_user.o \
116	gt/intel_execlists_submission.o \
117	gt/intel_ggtt.o \
118	gt/intel_ggtt_fencing.o \
119	gt/intel_gt.o \
120	gt/intel_gt_buffer_pool.o \
121	gt/intel_gt_clock_utils.o \
122	gt/intel_gt_debugfs.o \
123	gt/intel_gt_engines_debugfs.o \
124	gt/intel_gt_irq.o \
125	gt/intel_gt_mcr.o \
126	gt/intel_gt_pm.o \
127	gt/intel_gt_pm_debugfs.o \
128	gt/intel_gt_pm_irq.o \
129	gt/intel_gt_requests.o \
130	gt/intel_gt_sysfs.o \
131	gt/intel_gt_sysfs_pm.o \
132	gt/intel_gtt.o \
133	gt/intel_llc.o \
134	gt/intel_lrc.o \
135	gt/intel_migrate.o \
136	gt/intel_mocs.o \
137	gt/intel_ppgtt.o \
138	gt/intel_rc6.o \
139	gt/intel_region_lmem.o \
140	gt/intel_renderstate.o \
141	gt/intel_reset.o \
142	gt/intel_ring.o \
143	gt/intel_ring_submission.o \
144	gt/intel_rps.o \
145	gt/intel_sa_media.o \
146	gt/intel_sseu.o \
147	gt/intel_sseu_debugfs.o \
148	gt/intel_timeline.o \
149	gt/intel_tlb.o \
150	gt/intel_wopcm.o \
151	gt/intel_workarounds.o \
152	gt/shmem_utils.o \
153	gt/sysfs_engines.o
154
155# x86 intel-gtt module support
156gt-$(CONFIG_X86) += \
157	gt/intel_ggtt_gmch.o
158# autogenerated null render state
159gt-y += \
160	gt/gen6_renderstate.o \
161	gt/gen7_renderstate.o \
162	gt/gen8_renderstate.o \
163	gt/gen9_renderstate.o
164i915-y += $(gt-y)
165
166# GEM (Graphics Execution Management) code
167gem-y += \
168	gem/i915_gem_busy.o \
169	gem/i915_gem_clflush.o \
170	gem/i915_gem_context.o \
171	gem/i915_gem_create.o \
172	gem/i915_gem_dmabuf.o \
173	gem/i915_gem_domain.o \
174	gem/i915_gem_execbuffer.o \
175	gem/i915_gem_internal.o \
176	gem/i915_gem_lmem.o \
177	gem/i915_gem_mman.o \
178	gem/i915_gem_object.o \
179	gem/i915_gem_pages.o \
180	gem/i915_gem_phys.o \
181	gem/i915_gem_pm.o \
182	gem/i915_gem_region.o \
183	gem/i915_gem_shmem.o \
184	gem/i915_gem_shrinker.o \
185	gem/i915_gem_stolen.o \
186	gem/i915_gem_throttle.o \
187	gem/i915_gem_tiling.o \
188	gem/i915_gem_ttm.o \
189	gem/i915_gem_ttm_move.o \
190	gem/i915_gem_ttm_pm.o \
191	gem/i915_gem_userptr.o \
192	gem/i915_gem_wait.o \
193	gem/i915_gemfs.o
194i915-y += \
195	$(gem-y) \
196	i915_active.o \
197	i915_cmd_parser.o \
198	i915_deps.o \
199	i915_gem.o \
200	i915_gem_evict.o \
201	i915_gem_gtt.o \
202	i915_gem_ww.o \
203	i915_query.o \
204	i915_request.o \
205	i915_scheduler.o \
206	i915_trace_points.o \
207	i915_ttm_buddy_manager.o \
208	i915_vma.o \
209	i915_vma_resource.o
210
211# general-purpose microcontroller (GuC) support
212i915-y += \
213	gt/uc/intel_gsc_fw.o \
214	gt/uc/intel_gsc_proxy.o \
215	gt/uc/intel_gsc_uc.o \
216	gt/uc/intel_gsc_uc_debugfs.o \
217	gt/uc/intel_gsc_uc_heci_cmd_submit.o\
218	gt/uc/intel_guc.o \
219	gt/uc/intel_guc_ads.o \
220	gt/uc/intel_guc_capture.o \
221	gt/uc/intel_guc_ct.o \
222	gt/uc/intel_guc_debugfs.o \
223	gt/uc/intel_guc_fw.o \
224	gt/uc/intel_guc_hwconfig.o \
225	gt/uc/intel_guc_log.o \
226	gt/uc/intel_guc_log_debugfs.o \
227	gt/uc/intel_guc_rc.o \
228	gt/uc/intel_guc_slpc.o \
229	gt/uc/intel_guc_submission.o \
230	gt/uc/intel_huc.o \
231	gt/uc/intel_huc_debugfs.o \
232	gt/uc/intel_huc_fw.o \
233	gt/uc/intel_uc.o \
234	gt/uc/intel_uc_debugfs.o \
235	gt/uc/intel_uc_fw.o
236
237# graphics system controller (GSC) support
238i915-y += \
239	gt/intel_gsc.o
240
241# graphics hardware monitoring (HWMON) support
242i915-$(CONFIG_HWMON) += \
243	i915_hwmon.o
244
245# modesetting core code
246i915-y += \
247	display/hsw_ips.o \
248	display/i9xx_plane.o \
249	display/i9xx_wm.o \
250	display/intel_atomic.o \
251	display/intel_atomic_plane.o \
252	display/intel_audio.o \
253	display/intel_bios.o \
254	display/intel_bw.o \
255	display/intel_cdclk.o \
256	display/intel_color.o \
257	display/intel_combo_phy.o \
258	display/intel_connector.o \
259	display/intel_crtc.o \
260	display/intel_crtc_state_dump.o \
261	display/intel_cursor.o \
262	display/intel_display.o \
263	display/intel_display_driver.o \
264	display/intel_display_irq.o \
265	display/intel_display_params.o \
266	display/intel_display_power.o \
267	display/intel_display_power_map.o \
268	display/intel_display_power_well.o \
269	display/intel_display_reset.o \
270	display/intel_display_rps.o \
271	display/intel_display_wa.o \
272	display/intel_dmc.o \
273	display/intel_dpio_phy.o \
274	display/intel_dpll.o \
275	display/intel_dpll_mgr.o \
276	display/intel_dpt.o \
277	display/intel_dpt_common.o \
278	display/intel_drrs.o \
279	display/intel_dsb.o \
280	display/intel_dsb_buffer.o \
281	display/intel_fb.o \
282	display/intel_fb_bo.o \
283	display/intel_fb_pin.o \
284	display/intel_fbc.o \
285	display/intel_fdi.o \
286	display/intel_fifo_underrun.o \
287	display/intel_frontbuffer.o \
288	display/intel_global_state.o \
289	display/intel_hdcp.o \
290	display/intel_hdcp_gsc.o \
291	display/intel_hdcp_gsc_message.o \
292	display/intel_hotplug.o \
293	display/intel_hotplug_irq.o \
294	display/intel_hti.o \
295	display/intel_link_bw.o \
296	display/intel_load_detect.o \
297	display/intel_lpe_audio.o \
298	display/intel_modeset_lock.o \
299	display/intel_modeset_setup.o \
300	display/intel_modeset_verify.o \
301	display/intel_overlay.o \
302	display/intel_pch_display.o \
303	display/intel_pch_refclk.o \
304	display/intel_plane_initial.o \
305	display/intel_pmdemand.o \
306	display/intel_psr.o \
307	display/intel_quirks.o \
308	display/intel_sprite.o \
309	display/intel_sprite_uapi.o \
310	display/intel_tc.o \
311	display/intel_vblank.o \
312	display/intel_vga.o \
313	display/intel_wm.o \
314	display/skl_scaler.o \
315	display/skl_universal_plane.o \
316	display/skl_watermark.o
317i915-$(CONFIG_ACPI) += \
318	display/intel_acpi.o \
319	display/intel_opregion.o
320i915-$(CONFIG_DRM_FBDEV_EMULATION) += \
321	display/intel_fbdev.o \
322	display/intel_fbdev_fb.o
323i915-$(CONFIG_DEBUG_FS) += \
324	display/intel_display_debugfs.o \
325	display/intel_display_debugfs_params.o \
326	display/intel_pipe_crc.o
327
328# modesetting output/encoder code
329i915-y += \
330	display/dvo_ch7017.o \
331	display/dvo_ch7xxx.o \
332	display/dvo_ivch.o \
333	display/dvo_ns2501.o \
334	display/dvo_sil164.o \
335	display/dvo_tfp410.o \
336	display/g4x_dp.o \
337	display/g4x_hdmi.o \
338	display/icl_dsi.o \
339	display/intel_backlight.o \
340	display/intel_crt.o \
341	display/intel_cx0_phy.o \
342	display/intel_ddi.o \
343	display/intel_ddi_buf_trans.o \
344	display/intel_display_device.o \
345	display/intel_display_trace.o \
346	display/intel_dkl_phy.o \
347	display/intel_dp.o \
348	display/intel_dp_aux.o \
349	display/intel_dp_aux_backlight.o \
350	display/intel_dp_hdcp.o \
351	display/intel_dp_link_training.o \
352	display/intel_dp_mst.o \
353	display/intel_dsi.o \
354	display/intel_dsi_dcs_backlight.o \
355	display/intel_dsi_vbt.o \
356	display/intel_dvo.o \
357	display/intel_gmbus.o \
358	display/intel_hdmi.o \
359	display/intel_lspcon.o \
360	display/intel_lvds.o \
361	display/intel_panel.o \
362	display/intel_pps.o \
363	display/intel_qp_tables.o \
364	display/intel_sdvo.o \
365	display/intel_snps_phy.o \
366	display/intel_tv.o \
367	display/intel_vdsc.o \
368	display/intel_vrr.o \
369	display/vlv_dsi.o \
370	display/vlv_dsi_pll.o
371
372i915-y += \
373	i915_perf.o
374
375# Protected execution platform (PXP) support. Base support is required for HuC
376i915-y += \
377	pxp/intel_pxp.o \
378	pxp/intel_pxp_huc.o \
379	pxp/intel_pxp_tee.o
380
381i915-$(CONFIG_DRM_I915_PXP) += \
382	pxp/intel_pxp_cmd.o \
383	pxp/intel_pxp_debugfs.o \
384	pxp/intel_pxp_gsccs.o \
385	pxp/intel_pxp_irq.o \
386	pxp/intel_pxp_pm.o \
387	pxp/intel_pxp_session.o
388
389# Post-mortem debug and GPU hang state capture
390i915-$(CONFIG_DRM_I915_CAPTURE_ERROR) += \
391	i915_gpu_error.o
392i915-$(CONFIG_DRM_I915_SELFTEST) += \
393	gem/selftests/i915_gem_client_blt.o \
394	gem/selftests/igt_gem_utils.o \
395	selftests/i915_random.o \
396	selftests/i915_selftest.o \
397	selftests/igt_atomic.o \
398	selftests/igt_flush_test.o \
399	selftests/igt_live_test.o \
400	selftests/igt_mmap.o \
401	selftests/igt_reset.o \
402	selftests/igt_spinner.o \
403	selftests/intel_scheduler_helpers.o \
404	selftests/librapl.o
405
406# virtual gpu code
407i915-y += \
408	i915_vgpu.o
409
410i915-$(CONFIG_DRM_I915_GVT) += \
411	intel_gvt.o \
412	intel_gvt_mmio_table.o
413include $(src)/gvt/Makefile
414
415obj-$(CONFIG_DRM_I915) += i915.o
416obj-$(CONFIG_DRM_I915_GVT_KVMGT) += kvmgt.o
417
418# kernel-doc test
419#
420# Enable locally for CONFIG_DRM_I915_WERROR=y. See also scripts/Makefile.build
421ifdef CONFIG_DRM_I915_WERROR
422    cmd_checkdoc = $(srctree)/scripts/kernel-doc -none -Werror $<
423endif
424
425# header test
426
427# exclude some broken headers from the test coverage
428no-header-test := \
429	display/intel_vbt_defs.h
430
431always-$(CONFIG_DRM_I915_WERROR) += \
432	$(patsubst %.h,%.hdrtest, $(filter-out $(no-header-test), \
433		$(shell cd $(srctree)/$(src) && find * -name '*.h')))
434
435quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
436      cmd_hdrtest = $(CC) $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; \
437		$(srctree)/scripts/kernel-doc -none -Werror $<; touch $@
438
439$(obj)/%.hdrtest: $(src)/%.h FORCE
440	$(call if_changed_dep,hdrtest)
441