xref: /linux/drivers/gpu/drm/xe/Makefile (revision 1c2097bbde107effe2183891f92c060aa64bfa8b)
1dd08ebf6SMatthew Brost# SPDX-License-Identifier: GPL-2.0
2dd08ebf6SMatthew Brost#
3dd08ebf6SMatthew Brost# Makefile for the drm device driver.  This driver provides support for the
4dd08ebf6SMatthew Brost# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
5dd08ebf6SMatthew Brost
6dd08ebf6SMatthew Brost# Add a set of useful warning flags and enable -Werror for CI to prevent
7dd08ebf6SMatthew Brost# trivial mistakes from creeping in. We have to do this piecemeal as we reject
8dd08ebf6SMatthew Brost# any patch that isn't warning clean, so turning on -Wall -Wextra (or W=1) we
9dd08ebf6SMatthew Brost# need to filter out dubious warnings.  Still it is our interest
10dd08ebf6SMatthew Brost# to keep running locally with W=1 C=1 until we are completely clean.
11dd08ebf6SMatthew Brost#
12dd08ebf6SMatthew Brost# Note the danger in using -Wall -Wextra is that when CI updates gcc we
13dd08ebf6SMatthew Brost# will most likely get a sudden build breakage... Hopefully we will fix
14dd08ebf6SMatthew Brost# new warnings before CI updates!
15dd08ebf6SMatthew Brostsubdir-ccflags-y := -Wall -Wextra
165a4a8e8bSLucas De Marchisubdir-ccflags-y += $(call cc-disable-warning, unused-parameter)
175a4a8e8bSLucas De Marchisubdir-ccflags-y += $(call cc-disable-warning, type-limits)
18dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers)
19dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable)
20dd08ebf6SMatthew Brost# clang warnings
21dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, sign-compare)
22dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, sometimes-uninitialized)
23dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, initializer-overrides)
24dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, frame-address)
25dd08ebf6SMatthew Brostsubdir-ccflags-$(CONFIG_DRM_XE_WERROR) += -Werror
26dd08ebf6SMatthew Brost
27dd08ebf6SMatthew Brost# Fine grained warnings disable
28dd08ebf6SMatthew BrostCFLAGS_xe_pci.o = $(call cc-disable-warning, override-init)
29dd08ebf6SMatthew Brost
30464f2243SLucas De Marchisubdir-ccflags-y += -I$(obj) -I$(srctree)/$(src)
31dd08ebf6SMatthew Brost
329616e74bSLucas De Marchi# generated sources
339616e74bSLucas De Marchihostprogs := xe_gen_wa_oob
349616e74bSLucas De Marchi
359616e74bSLucas De Marchigenerated_oob := $(obj)/generated/xe_wa_oob.c $(obj)/generated/xe_wa_oob.h
369616e74bSLucas De Marchi
379616e74bSLucas De Marchiquiet_cmd_wa_oob = GEN     $(notdir $(generated_oob))
389616e74bSLucas De Marchi      cmd_wa_oob = mkdir -p $(@D); $^ $(generated_oob)
399616e74bSLucas De Marchi
409616e74bSLucas De Marchi$(generated_oob) &: $(obj)/xe_gen_wa_oob $(srctree)/$(src)/xe_wa_oob.rules
419616e74bSLucas De Marchi	$(call cmd,wa_oob)
429616e74bSLucas De Marchi
439f8f93beSThomas Hellström$(obj)/xe_guc.o $(obj)/xe_wa.o $(obj)/xe_ring_ops.o: $(generated_oob)
449616e74bSLucas De Marchi
45dd08ebf6SMatthew Brost# Please keep these build lists sorted!
46dd08ebf6SMatthew Brost
47dd08ebf6SMatthew Brost# core driver code
48dd08ebf6SMatthew Brost
49dd08ebf6SMatthew Brostxe-y += xe_bb.o \
50dd08ebf6SMatthew Brost	xe_bo.o \
51dd08ebf6SMatthew Brost	xe_bo_evict.o \
52dd08ebf6SMatthew Brost	xe_debugfs.o \
53e7994850SRodrigo Vivi	xe_devcoredump.o \
54dd08ebf6SMatthew Brost	xe_device.o \
55dd08ebf6SMatthew Brost	xe_dma_buf.o \
56dd08ebf6SMatthew Brost	xe_engine.o \
57dd08ebf6SMatthew Brost	xe_exec.o \
58dd08ebf6SMatthew Brost	xe_execlist.o \
59dd08ebf6SMatthew Brost	xe_force_wake.o \
60dd08ebf6SMatthew Brost	xe_ggtt.o \
61dd08ebf6SMatthew Brost	xe_gpu_scheduler.o \
62dd08ebf6SMatthew Brost	xe_gt.o \
63dd08ebf6SMatthew Brost	xe_gt_clock.o \
64dd08ebf6SMatthew Brost	xe_gt_debugfs.o \
65*1c2097bbSRiana Tauro	xe_gt_idle_sysfs.o \
66dd08ebf6SMatthew Brost	xe_gt_mcr.o \
67dd08ebf6SMatthew Brost	xe_gt_pagefault.o \
68dd08ebf6SMatthew Brost	xe_gt_sysfs.o \
69a9351846SMatthew Brost	xe_gt_tlb_invalidation.o \
70dd08ebf6SMatthew Brost	xe_gt_topology.o \
71dd08ebf6SMatthew Brost	xe_guc.o \
72dd08ebf6SMatthew Brost	xe_guc_ads.o \
73dd08ebf6SMatthew Brost	xe_guc_ct.o \
74dd08ebf6SMatthew Brost	xe_guc_debugfs.o \
75dd08ebf6SMatthew Brost	xe_guc_hwconfig.o \
76dd08ebf6SMatthew Brost	xe_guc_log.o \
77dd08ebf6SMatthew Brost	xe_guc_pc.o \
78dd08ebf6SMatthew Brost	xe_guc_submit.o \
79dd08ebf6SMatthew Brost	xe_hw_engine.o \
80dd08ebf6SMatthew Brost	xe_hw_fence.o \
81dd08ebf6SMatthew Brost	xe_huc.o \
82dd08ebf6SMatthew Brost	xe_huc_debugfs.o \
83dd08ebf6SMatthew Brost	xe_irq.o \
84dd08ebf6SMatthew Brost	xe_lrc.o \
85dd08ebf6SMatthew Brost	xe_migrate.o \
86dd08ebf6SMatthew Brost	xe_mmio.o \
87dd08ebf6SMatthew Brost	xe_mocs.o \
88dd08ebf6SMatthew Brost	xe_module.o \
89576c6380SMatt Roper	xe_pat.o \
90dd08ebf6SMatthew Brost	xe_pci.o \
91dd08ebf6SMatthew Brost	xe_pcode.o \
92dd08ebf6SMatthew Brost	xe_pm.o \
93dd08ebf6SMatthew Brost	xe_preempt_fence.o \
94dd08ebf6SMatthew Brost	xe_pt.o \
95dd08ebf6SMatthew Brost	xe_pt_walk.o \
96dd08ebf6SMatthew Brost	xe_query.o \
97dd08ebf6SMatthew Brost	xe_reg_sr.o \
98dd08ebf6SMatthew Brost	xe_reg_whitelist.o \
99dd08ebf6SMatthew Brost	xe_rtp.o \
100dd08ebf6SMatthew Brost	xe_ring_ops.o \
101dd08ebf6SMatthew Brost	xe_sa.o \
102dd08ebf6SMatthew Brost	xe_sched_job.o \
103dd08ebf6SMatthew Brost	xe_step.o \
104dd08ebf6SMatthew Brost	xe_sync.o \
105ad703e06SMatt Roper	xe_tile.o \
106dd08ebf6SMatthew Brost	xe_trace.o \
1071a545ed7SChang, Bruce	xe_ttm_sys_mgr.o \
108d8b52a02SMaarten Lankhorst	xe_ttm_stolen_mgr.o \
109dd08ebf6SMatthew Brost	xe_ttm_vram_mgr.o \
110dd08ebf6SMatthew Brost	xe_tuning.o \
111dd08ebf6SMatthew Brost	xe_uc.o \
112dd08ebf6SMatthew Brost	xe_uc_debugfs.o \
113dd08ebf6SMatthew Brost	xe_uc_fw.o \
114dd08ebf6SMatthew Brost	xe_vm.o \
115dd08ebf6SMatthew Brost	xe_vm_madvise.o \
116dd08ebf6SMatthew Brost	xe_wait_user_fence.o \
117dd08ebf6SMatthew Brost	xe_wa.o \
118dd08ebf6SMatthew Brost	xe_wopcm.o
119dd08ebf6SMatthew Brost
120dd08ebf6SMatthew Brostobj-$(CONFIG_DRM_XE) += xe.o
121dd08ebf6SMatthew Brostobj-$(CONFIG_DRM_XE_KUNIT_TEST) += tests/
1229a56502fSLucas De Marchi
123dd08ebf6SMatthew Brost# header test
1249a56502fSLucas De Marchihdrtest_find_args := -not -path xe_rtp_helpers.h
1259a56502fSLucas De Marchi
126dd08ebf6SMatthew Brostalways-$(CONFIG_DRM_XE_WERROR) += \
1279a56502fSLucas De Marchi	$(patsubst %.h,%.hdrtest, $(shell cd $(srctree)/$(src) && find * -name '*.h' $(hdrtest_find_args)))
128dd08ebf6SMatthew Brost
129dd08ebf6SMatthew Brostquiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
130dd08ebf6SMatthew Brost      cmd_hdrtest = $(CC) -DHDRTEST $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@
131dd08ebf6SMatthew Brost
132dd08ebf6SMatthew Brost$(obj)/%.hdrtest: $(src)/%.h FORCE
133dd08ebf6SMatthew Brost	$(call if_changed_dep,hdrtest)
134