Makefile 8.65 KB
Newer Older
1 2 3 4 5
# SPDX-License-Identifier: GPL-2.0
#
# Makefile for the drm device driver.  This driver provides support for the
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.

6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
# Unconditionally enable W=1 warnings locally
# --- begin copy-paste W=1 warnings from scripts/Makefile.extrawarn
subdir-ccflags-y += -Wextra -Wunused -Wno-unused-parameter
subdir-ccflags-y += -Wmissing-declarations
subdir-ccflags-y += $(call cc-option, -Wrestrict)
subdir-ccflags-y += -Wmissing-format-attribute
subdir-ccflags-y += -Wmissing-prototypes
subdir-ccflags-y += -Wold-style-definition
subdir-ccflags-y += -Wmissing-include-dirs
subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable)
subdir-ccflags-y += $(call cc-option, -Wunused-const-variable)
subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned)
subdir-ccflags-y += $(call cc-option, -Wformat-overflow)
subdir-ccflags-y += $(call cc-option, -Wformat-truncation)
subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
# The following turn off the warnings enabled by -Wextra
ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),)
subdir-ccflags-y += -Wno-missing-field-initializers
subdir-ccflags-y += -Wno-type-limits
subdir-ccflags-y += -Wno-shift-negative-value
endif
ifeq ($(findstring 3, $(KBUILD_EXTRA_WARN)),)
subdir-ccflags-y += -Wno-sign-compare
endif
# --- end copy-paste

# Enable -Werror in CI and development
33 34
subdir-ccflags-$(CONFIG_DRM_XE_WERROR) += -Werror

35
subdir-ccflags-y += -I$(obj) -I$(src)
36

37 38 39 40 41 42 43 44
# generated sources
hostprogs := xe_gen_wa_oob

generated_oob := $(obj)/generated/xe_wa_oob.c $(obj)/generated/xe_wa_oob.h

quiet_cmd_wa_oob = GEN     $(notdir $(generated_oob))
      cmd_wa_oob = mkdir -p $(@D); $^ $(generated_oob)

45
$(obj)/generated/%_wa_oob.c $(obj)/generated/%_wa_oob.h: $(obj)/xe_gen_wa_oob \
46
		 $(src)/xe_wa_oob.rules
47 48
	$(call cmd,wa_oob)

49 50 51
uses_generated_oob := \
	$(obj)/xe_gsc.o \
	$(obj)/xe_guc.o \
52
	$(obj)/xe_guc_ads.o \
53 54 55 56 57 58 59
	$(obj)/xe_migrate.o \
	$(obj)/xe_ring_ops.o \
	$(obj)/xe_vm.o \
	$(obj)/xe_wa.o \
	$(obj)/xe_ttm_stolen_mgr.o

$(uses_generated_oob): $(generated_oob)
60

61 62 63 64 65 66 67 68
# Please keep these build lists sorted!

# core driver code

xe-y += xe_bb.o \
	xe_bo.o \
	xe_bo_evict.o \
	xe_debugfs.o \
69
	xe_devcoredump.o \
70
	xe_device.o \
71
	xe_device_sysfs.o \
72
	xe_dma_buf.o \
73
	xe_drm_client.o \
74 75
	xe_exec.o \
	xe_execlist.o \
76
	xe_exec_queue.o \
77 78 79
	xe_force_wake.o \
	xe_ggtt.o \
	xe_gpu_scheduler.o \
80
	xe_gsc.o \
81
	xe_gsc_proxy.o \
82
	xe_gsc_submit.o \
83
	xe_gt.o \
84
	xe_gt_ccs_mode.o \
85 86
	xe_gt_clock.o \
	xe_gt_debugfs.o \
87
	xe_gt_freq.o \
88
	xe_gt_idle.o \
89 90 91
	xe_gt_mcr.o \
	xe_gt_pagefault.o \
	xe_gt_sysfs.o \
92
	xe_gt_throttle_sysfs.o \
93
	xe_gt_tlb_invalidation.o \
94 95 96 97
	xe_gt_topology.o \
	xe_guc.o \
	xe_guc_ads.o \
	xe_guc_ct.o \
98
	xe_guc_db_mgr.o \
99 100
	xe_guc_debugfs.o \
	xe_guc_hwconfig.o \
101
	xe_guc_id_mgr.o \
102
	xe_guc_klv_helpers.o \
103 104 105
	xe_guc_log.o \
	xe_guc_pc.o \
	xe_guc_submit.o \
106
	xe_heci_gsc.o \
107
	xe_hw_engine.o \
108
	xe_hw_engine_class_sysfs.o \
109 110 111 112 113 114 115 116 117
	xe_hw_fence.o \
	xe_huc.o \
	xe_huc_debugfs.o \
	xe_irq.o \
	xe_lrc.o \
	xe_migrate.o \
	xe_mmio.o \
	xe_mocs.o \
	xe_module.o \
118
	xe_pat.o \
119 120 121 122 123 124 125
	xe_pci.o \
	xe_pcode.o \
	xe_pm.o \
	xe_preempt_fence.o \
	xe_pt.o \
	xe_pt_walk.o \
	xe_query.o \
126
	xe_range_fence.o \
127 128 129 130 131 132 133 134
	xe_reg_sr.o \
	xe_reg_whitelist.o \
	xe_rtp.o \
	xe_ring_ops.o \
	xe_sa.o \
	xe_sched_job.o \
	xe_step.o \
	xe_sync.o \
135
	xe_tile.o \
136
	xe_tile_sysfs.o \
137
	xe_trace.o \
138
	xe_ttm_sys_mgr.o \
139
	xe_ttm_stolen_mgr.o \
140 141 142 143 144 145
	xe_ttm_vram_mgr.o \
	xe_tuning.o \
	xe_uc.o \
	xe_uc_debugfs.o \
	xe_uc_fw.o \
	xe_vm.o \
146
	xe_vram_freq.o \
147 148 149 150
	xe_wait_user_fence.o \
	xe_wa.o \
	xe_wopcm.o

151 152
xe-$(CONFIG_HMM_MIRROR) += xe_hmm.o

153 154 155
# graphics hardware monitoring (HWMON) support
xe-$(CONFIG_HWMON) += xe_hwmon.o

156
# graphics virtualization (SR-IOV) support
157
xe-y += \
158
	xe_guc_relay.o \
159 160
	xe_memirq.o \
	xe_sriov.o
161

162
xe-$(CONFIG_PCI_IOV) += \
163
	xe_gt_sriov_pf.o \
164
	xe_gt_sriov_pf_config.o \
165
	xe_gt_sriov_pf_control.o \
166
	xe_gt_sriov_pf_policy.o \
167 168
	xe_lmtt.o \
	xe_lmtt_2l.o \
169 170
	xe_lmtt_ml.o \
	xe_sriov_pf.o
171

172 173 174 175
# include helpers for tests even when XE is built-in
ifdef CONFIG_DRM_XE_KUNIT_TEST
xe-y += tests/xe_kunit_helpers.o
endif
176

177 178
# i915 Display compat #defines and #includes
subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \
179 180
	-I$(src)/display/ext \
	-I$(src)/compat-i915-headers \
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
	-I$(srctree)/drivers/gpu/drm/i915/display/ \
	-Ddrm_i915_gem_object=xe_bo \
	-Ddrm_i915_private=xe_device

# Rule to build SOC code shared with i915
$(obj)/i915-soc/%.o: $(srctree)/drivers/gpu/drm/i915/soc/%.c FORCE
	$(call cmd,force_checksrc)
	$(call if_changed_rule,cc_o_c)

# Rule to build display code shared with i915
$(obj)/i915-display/%.o: $(srctree)/drivers/gpu/drm/i915/display/%.c FORCE
	$(call cmd,force_checksrc)
	$(call if_changed_rule,cc_o_c)

# Display code specific to xe
xe-$(CONFIG_DRM_XE_DISPLAY) += \
197 198 199 200 201
	display/ext/i915_irq.o \
	display/ext/i915_utils.o \
	display/intel_fb_bo.o \
	display/intel_fbdev_fb.o \
	display/xe_display.o \
202
	display/xe_display_misc.o \
203
	display/xe_display_rps.o \
204
	display/xe_dsb_buffer.o \
205 206 207
	display/xe_fb_pin.o \
	display/xe_hdcp_gsc.o \
	display/xe_plane_initial.o
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266

# SOC code shared with i915
xe-$(CONFIG_DRM_XE_DISPLAY) += \
	i915-soc/intel_dram.o \
	i915-soc/intel_pch.o

# Display code shared with i915
xe-$(CONFIG_DRM_XE_DISPLAY) += \
	i915-display/icl_dsi.o \
	i915-display/intel_atomic.o \
	i915-display/intel_atomic_plane.o \
	i915-display/intel_audio.o \
	i915-display/intel_backlight.o \
	i915-display/intel_bios.o \
	i915-display/intel_bw.o \
	i915-display/intel_cdclk.o \
	i915-display/intel_color.o \
	i915-display/intel_combo_phy.o \
	i915-display/intel_connector.o \
	i915-display/intel_crtc.o \
	i915-display/intel_crtc_state_dump.o \
	i915-display/intel_cursor.o \
	i915-display/intel_cx0_phy.o \
	i915-display/intel_ddi.o \
	i915-display/intel_ddi_buf_trans.o \
	i915-display/intel_display.o \
	i915-display/intel_display_device.o \
	i915-display/intel_display_driver.o \
	i915-display/intel_display_irq.o \
	i915-display/intel_display_params.o \
	i915-display/intel_display_power.o \
	i915-display/intel_display_power_map.o \
	i915-display/intel_display_power_well.o \
	i915-display/intel_display_trace.o \
	i915-display/intel_display_wa.o \
	i915-display/intel_dkl_phy.o \
	i915-display/intel_dmc.o \
	i915-display/intel_dp.o \
	i915-display/intel_dp_aux.o \
	i915-display/intel_dp_aux_backlight.o \
	i915-display/intel_dp_hdcp.o \
	i915-display/intel_dp_link_training.o \
	i915-display/intel_dp_mst.o \
	i915-display/intel_dpll.o \
	i915-display/intel_dpll_mgr.o \
	i915-display/intel_dpt_common.o \
	i915-display/intel_drrs.o \
	i915-display/intel_dsb.o \
	i915-display/intel_dsi.o \
	i915-display/intel_dsi_dcs_backlight.o \
	i915-display/intel_dsi_vbt.o \
	i915-display/intel_fb.o \
	i915-display/intel_fbc.o \
	i915-display/intel_fdi.o \
	i915-display/intel_fifo_underrun.o \
	i915-display/intel_frontbuffer.o \
	i915-display/intel_global_state.o \
	i915-display/intel_gmbus.o \
	i915-display/intel_hdcp.o \
267
	i915-display/intel_hdcp_gsc_message.o \
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
	i915-display/intel_hdmi.o \
	i915-display/intel_hotplug.o \
	i915-display/intel_hotplug_irq.o \
	i915-display/intel_hti.o \
	i915-display/intel_link_bw.o \
	i915-display/intel_lspcon.o \
	i915-display/intel_modeset_lock.o \
	i915-display/intel_modeset_setup.o \
	i915-display/intel_modeset_verify.o \
	i915-display/intel_panel.o \
	i915-display/intel_pmdemand.o \
	i915-display/intel_pps.o \
	i915-display/intel_psr.o \
	i915-display/intel_qp_tables.o \
	i915-display/intel_quirks.o \
	i915-display/intel_snps_phy.o \
	i915-display/intel_tc.o \
	i915-display/intel_vblank.o \
	i915-display/intel_vdsc.o \
	i915-display/intel_vga.o \
	i915-display/intel_vrr.o \
289
	i915-display/intel_dmc_wl.o \
290 291 292 293
	i915-display/intel_wm.o \
	i915-display/skl_scaler.o \
	i915-display/skl_universal_plane.o \
	i915-display/skl_watermark.o
294

295 296 297 298 299 300 301 302 303 304
ifeq ($(CONFIG_ACPI),y)
	xe-$(CONFIG_DRM_XE_DISPLAY) += \
		i915-display/intel_acpi.o \
		i915-display/intel_opregion.o
endif

ifeq ($(CONFIG_DRM_FBDEV_EMULATION),y)
	xe-$(CONFIG_DRM_XE_DISPLAY) += i915-display/intel_fbdev.o
endif

305 306 307 308 309 310 311
ifeq ($(CONFIG_DEBUG_FS),y)
	xe-$(CONFIG_DRM_XE_DISPLAY) += \
		i915-display/intel_display_debugfs.o \
		i915-display/intel_display_debugfs_params.o \
		i915-display/intel_pipe_crc.o
endif

312 313 314
obj-$(CONFIG_DRM_XE) += xe.o
obj-$(CONFIG_DRM_XE_KUNIT_TEST) += tests/

315
# header test
316
hdrtest_find_args := -not -path xe_rtp_helpers.h
317 318 319
ifneq ($(CONFIG_DRM_XE_DISPLAY),y)
	hdrtest_find_args += -not -path display/\* -not -path compat-i915-headers/\* -not -path xe_display.h
endif
320

321
always-$(CONFIG_DRM_XE_WERROR) += \
322
	$(patsubst %.h,%.hdrtest, $(shell cd $(src) && find * -name '*.h' $(hdrtest_find_args)))
323 324 325 326 327 328

quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
      cmd_hdrtest = $(CC) -DHDRTEST $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@

$(obj)/%.hdrtest: $(src)/%.h FORCE
	$(call if_changed_dep,hdrtest)