xref: /linux/drivers/gpu/drm/xe/Makefile (revision dd08ebf6c3525a7ea2186e636df064ea47281987)
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!
15subdir-ccflags-y := -Wall -Wextra
16# making these call cc-disable-warning breaks when trying to build xe.mod.o
17# by calling make M=drivers/gpu/drm/xe. This doesn't happen in upstream tree,
18# so it was somehow fixed by the changes in the build system. Move it back to
19# $(call cc-disable-warning, ...) after rebase.
20subdir-ccflags-y += -Wno-unused-parameter
21subdir-ccflags-y += -Wno-type-limits
22#subdir-ccflags-y += $(call cc-disable-warning, unused-parameter)
23#subdir-ccflags-y += $(call cc-disable-warning, type-limits)
24subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers)
25subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable)
26# clang warnings
27subdir-ccflags-y += $(call cc-disable-warning, sign-compare)
28subdir-ccflags-y += $(call cc-disable-warning, sometimes-uninitialized)
29subdir-ccflags-y += $(call cc-disable-warning, initializer-overrides)
30subdir-ccflags-y += $(call cc-disable-warning, frame-address)
31subdir-ccflags-$(CONFIG_DRM_XE_WERROR) += -Werror
32
33# Fine grained warnings disable
34CFLAGS_xe_pci.o = $(call cc-disable-warning, override-init)
35
36subdir-ccflags-y += -I$(srctree)/$(src)
37
38# Please keep these build lists sorted!
39
40# core driver code
41
42xe-y += xe_bb.o \
43	xe_bo.o \
44	xe_bo_evict.o \
45	xe_debugfs.o \
46	xe_device.o \
47	xe_dma_buf.o \
48	xe_engine.o \
49	xe_exec.o \
50	xe_execlist.o \
51	xe_force_wake.o \
52	xe_ggtt.o \
53	xe_gpu_scheduler.o \
54	xe_gt.o \
55	xe_gt_clock.o \
56	xe_gt_debugfs.o \
57	xe_gt_mcr.o \
58	xe_gt_pagefault.o \
59	xe_gt_sysfs.o \
60	xe_gt_topology.o \
61	xe_guc.o \
62	xe_guc_ads.o \
63	xe_guc_ct.o \
64	xe_guc_debugfs.o \
65	xe_guc_hwconfig.o \
66	xe_guc_log.o \
67	xe_guc_pc.o \
68	xe_guc_submit.o \
69	xe_hw_engine.o \
70	xe_hw_fence.o \
71	xe_huc.o \
72	xe_huc_debugfs.o \
73	xe_irq.o \
74	xe_lrc.o \
75	xe_migrate.o \
76	xe_mmio.o \
77	xe_mocs.o \
78	xe_module.o \
79	xe_pci.o \
80	xe_pcode.o \
81	xe_pm.o \
82	xe_preempt_fence.o \
83	xe_pt.o \
84	xe_pt_walk.o \
85	xe_query.o \
86	xe_reg_sr.o \
87	xe_reg_whitelist.o \
88	xe_rtp.o \
89	xe_ring_ops.o \
90	xe_sa.o \
91	xe_sched_job.o \
92	xe_step.o \
93	xe_sync.o \
94	xe_trace.o \
95	xe_ttm_gtt_mgr.o \
96	xe_ttm_vram_mgr.o \
97	xe_tuning.o \
98	xe_uc.o \
99	xe_uc_debugfs.o \
100	xe_uc_fw.o \
101	xe_vm.o \
102	xe_vm_madvise.o \
103	xe_wait_user_fence.o \
104	xe_wa.o \
105	xe_wopcm.o
106
107# XXX: Needed for i915 register definitions. Will be removed after xe-regs.
108subdir-ccflags-y += -I$(srctree)/drivers/gpu/drm/i915/
109
110obj-$(CONFIG_DRM_XE) += xe.o
111obj-$(CONFIG_DRM_XE_KUNIT_TEST) += tests/
112\
113# header test
114always-$(CONFIG_DRM_XE_WERROR) += \
115	$(patsubst %.h,%.hdrtest, $(shell cd $(srctree)/$(src) && find * -name '*.h'))
116
117quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
118      cmd_hdrtest = $(CC) -DHDRTEST $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@
119
120$(obj)/%.hdrtest: $(src)/%.h FORCE
121	$(call if_changed_dep,hdrtest)
122