1d39784e92fd9565ebb414ffacdbdaa7ac27e360
[linux-2.6-block.git] / drivers / gpu / drm / xe / Makefile
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
16 subdir-ccflags-y += $(call cc-disable-warning, unused-parameter)
17 subdir-ccflags-y += $(call cc-disable-warning, type-limits)
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
30 subdir-ccflags-y += -I$(obj) -I$(srctree)/$(src)
31
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_guc.o $(obj)/xe_migrate.o $(obj)/xe_ring_ops.o $(obj)/xe_vm.o $(obj)/xe_wa.o $(obj)/xe_ttm_stolen_mgr.o: $(generated_oob)
44
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 \
53         xe_devcoredump.o \
54         xe_device.o \
55         xe_device_sysfs.o \
56         xe_dma_buf.o \
57         xe_drm_client.o \
58         xe_exec.o \
59         xe_execlist.o \
60         xe_exec_queue.o \
61         xe_force_wake.o \
62         xe_ggtt.o \
63         xe_gpu_scheduler.o \
64         xe_gt.o \
65         xe_gt_clock.o \
66         xe_gt_debugfs.o \
67         xe_gt_idle_sysfs.o \
68         xe_gt_mcr.o \
69         xe_gt_pagefault.o \
70         xe_gt_sysfs.o \
71         xe_gt_tlb_invalidation.o \
72         xe_gt_topology.o \
73         xe_guc.o \
74         xe_guc_ads.o \
75         xe_guc_ct.o \
76         xe_guc_debugfs.o \
77         xe_guc_hwconfig.o \
78         xe_guc_log.o \
79         xe_guc_pc.o \
80         xe_guc_submit.o \
81         xe_heci_gsc.o \
82         xe_hw_engine.o \
83         xe_hw_engine_class_sysfs.o \
84         xe_hw_fence.o \
85         xe_huc.o \
86         xe_huc_debugfs.o \
87         xe_irq.o \
88         xe_lrc.o \
89         xe_migrate.o \
90         xe_mmio.o \
91         xe_mocs.o \
92         xe_module.o \
93         xe_pat.o \
94         xe_pci.o \
95         xe_pcode.o \
96         xe_pm.o \
97         xe_preempt_fence.o \
98         xe_pt.o \
99         xe_pt_walk.o \
100         xe_query.o \
101         xe_range_fence.o \
102         xe_reg_sr.o \
103         xe_reg_whitelist.o \
104         xe_rtp.o \
105         xe_ring_ops.o \
106         xe_sa.o \
107         xe_sched_job.o \
108         xe_step.o \
109         xe_sync.o \
110         xe_tile.o \
111         xe_tile_sysfs.o \
112         xe_trace.o \
113         xe_ttm_sys_mgr.o \
114         xe_ttm_stolen_mgr.o \
115         xe_ttm_vram_mgr.o \
116         xe_tuning.o \
117         xe_uc.o \
118         xe_uc_debugfs.o \
119         xe_uc_fw.o \
120         xe_vm.o \
121         xe_vm_madvise.o \
122         xe_wait_user_fence.o \
123         xe_wa.o \
124         xe_wopcm.o
125
126 # graphics hardware monitoring (HWMON) support
127 xe-$(CONFIG_HWMON) += xe_hwmon.o
128
129 obj-$(CONFIG_DRM_XE) += xe.o
130 obj-$(CONFIG_DRM_XE_KUNIT_TEST) += tests/
131
132 xe-$(CONFIG_PERF_EVENTS) += xe_pmu.o
133
134 # header test
135 hdrtest_find_args := -not -path xe_rtp_helpers.h
136
137 always-$(CONFIG_DRM_XE_WERROR) += \
138         $(patsubst %.h,%.hdrtest, $(shell cd $(srctree)/$(src) && find * -name '*.h' $(hdrtest_find_args)))
139
140 quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
141       cmd_hdrtest = $(CC) -DHDRTEST $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@
142
143 $(obj)/%.hdrtest: $(src)/%.h FORCE
144         $(call if_changed_dep,hdrtest)