blob: 3bd8f0349a8ab549808f67909c43ca579dd6bcbc [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Dave Airliec0e09202008-05-29 10:09:59 +10002#
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
Chris Wilson39bf4de2017-10-24 19:15:47 +01006# 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!
Kees Cook0bb95f82018-06-25 15:59:34 -070015subdir-ccflags-y := -Wall -Wextra
Chris Wilson4ab09d02017-10-30 17:29:27 +000016subdir-ccflags-y += $(call cc-disable-warning, unused-parameter)
17subdir-ccflags-y += $(call cc-disable-warning, type-limits)
18subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers)
19subdir-ccflags-y += $(call cc-disable-warning, implicit-fallthrough)
Chris Wilson6a05d292018-02-08 16:16:39 +000020subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable)
Matthias Kaehlcke46e20682018-05-01 11:24:40 -070021# clang warnings
22subdir-ccflags-y += $(call cc-disable-warning, sign-compare)
23subdir-ccflags-y += $(call cc-disable-warning, sometimes-uninitialized)
24subdir-ccflags-y += $(call cc-disable-warning, initializer-overrides)
Nathan Chancellorc5627462019-01-26 00:11:23 -070025subdir-ccflags-y += $(call cc-disable-warning, uninitialized)
Chris Wilson39bf4de2017-10-24 19:15:47 +010026subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
27
28# Fine grained warnings disable
Chris Wilson4ab09d02017-10-30 17:29:27 +000029CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init)
30CFLAGS_intel_fbdev.o = $(call cc-disable-warning, override-init)
Chris Wilson39bf4de2017-10-24 19:15:47 +010031
Chris Wilson0b1de5d2016-08-12 12:39:59 +010032subdir-ccflags-y += \
33 $(call as-instr,movntdqa (%eax)$(comma)%xmm0,-DCONFIG_AS_MOVNTDQA)
Chris Wilson0a793ad2016-04-13 17:35:00 +010034
Jani Nikulac2400ec2019-04-03 16:52:36 +030035# Extra header tests
36include $(src)/Makefile.header-test
37
Jani Nikula9ef424e2019-06-26 17:36:17 +030038subdir-ccflags-y += -I$(srctree)/$(src)
Chris Wilson112ed2d2019-04-24 18:48:39 +010039
Daniel Vetter2fae6a82014-03-07 09:17:21 +010040# Please keep these build lists sorted!
41
42# core driver code
Jani Nikulac2400ec2019-04-03 16:52:36 +030043i915-y += i915_drv.o \
Daniel Vetter042794b2015-07-24 13:55:10 +020044 i915_irq.o \
Daniel Vetter2fae6a82014-03-07 09:17:21 +010045 i915_params.o \
Chris Wilson42f55512016-06-24 14:00:26 +010046 i915_pci.o \
Chris Wilson37d63f82019-05-28 10:29:50 +010047 i915_scatterlist.o \
Pedro Tammela79960222018-12-05 09:06:08 -020048 i915_suspend.o \
Daniel Vetter2fae6a82014-03-07 09:17:21 +010049 i915_sysfs.o \
Daniel Vetter042794b2015-07-24 13:55:10 +020050 intel_csr.o \
Chris Wilson94b4f3b2016-07-05 10:40:20 +010051 intel_device_info.o \
Daniel Vetter9c065a72014-09-30 10:56:38 +020052 intel_pm.o \
Oscar Mateo7d3c4252018-04-10 09:12:46 -070053 intel_runtime_pm.o \
Jani Nikuladf0566a2019-06-13 11:44:16 +030054 intel_sideband.o \
55 intel_uncore.o \
56 intel_wakeref.o
Chris Wilson112ed2d2019-04-24 18:48:39 +010057
58# core library code
59i915-y += \
60 i915_memcpy.o \
61 i915_mm.o \
62 i915_sw_fence.o \
63 i915_syncmap.o \
64 i915_user_extensions.o
Daniel Vetter9c065a72014-09-30 10:56:38 +020065
Daniel Vetter2fae6a82014-03-07 09:17:21 +010066i915-$(CONFIG_COMPAT) += i915_ioc32.o
Jani Nikuladf0566a2019-06-13 11:44:16 +030067i915-$(CONFIG_DEBUG_FS) += i915_debugfs.o display/intel_pipe_crc.o
Tvrtko Ursulinb46a33e2017-11-21 18:18:45 +000068i915-$(CONFIG_PERF_EVENTS) += i915_pmu.o
Daniel Vetter2fae6a82014-03-07 09:17:21 +010069
Chris Wilson112ed2d2019-04-24 18:48:39 +010070# "Graphics Technology" (aka we talk to the gpu)
71obj-y += gt/
72gt-y += \
73 gt/intel_breadcrumbs.o \
74 gt/intel_context.o \
75 gt/intel_engine_cs.o \
Chris Wilson79ffac852019-04-24 21:07:17 +010076 gt/intel_engine_pm.o \
Tvrtko Ursulin24635c52019-06-21 08:07:41 +010077 gt/intel_gt.o \
Chris Wilson79ffac852019-04-24 21:07:17 +010078 gt/intel_gt_pm.o \
Chris Wilson112ed2d2019-04-24 18:48:39 +010079 gt/intel_hangcheck.o \
80 gt/intel_lrc.o \
81 gt/intel_reset.o \
82 gt/intel_ringbuffer.o \
83 gt/intel_mocs.o \
84 gt/intel_sseu.o \
Tvrtko Ursulinf0c02c12019-06-21 08:08:10 +010085 gt/intel_timeline.o \
Chris Wilson112ed2d2019-04-24 18:48:39 +010086 gt/intel_workarounds.o
87gt-$(CONFIG_DRM_I915_SELFTEST) += \
88 gt/mock_engine.o
89i915-y += $(gt-y)
90
91# GEM (Graphics Execution Management) code
Chris Wilson5e5d2e22019-05-28 10:29:42 +010092obj-y += gem/
Chris Wilson98932142019-05-28 10:29:44 +010093gem-y += \
Chris Wilson3f43c872019-05-28 10:29:53 +010094 gem/i915_gem_busy.o \
Chris Wilson10be98a2019-05-28 10:29:49 +010095 gem/i915_gem_clflush.o \
Matthew Auld6501aa42019-05-29 13:31:08 +010096 gem/i915_gem_client_blt.o \
Chris Wilson10be98a2019-05-28 10:29:49 +010097 gem/i915_gem_context.o \
98 gem/i915_gem_dmabuf.o \
Chris Wilsonf0e4a062019-05-28 10:29:48 +010099 gem/i915_gem_domain.o \
Chris Wilson10be98a2019-05-28 10:29:49 +0100100 gem/i915_gem_execbuffer.o \
Chris Wilson6951e582019-05-28 10:29:51 +0100101 gem/i915_gem_fence.o \
Chris Wilson10be98a2019-05-28 10:29:49 +0100102 gem/i915_gem_internal.o \
Chris Wilson84753552019-05-28 10:29:45 +0100103 gem/i915_gem_object.o \
Matthew Auld6501aa42019-05-29 13:31:08 +0100104 gem/i915_gem_object_blt.o \
Chris Wilsonb414fcd2019-05-28 10:29:47 +0100105 gem/i915_gem_mman.o \
Chris Wilsonf0334282019-05-28 10:29:46 +0100106 gem/i915_gem_pages.o \
107 gem/i915_gem_phys.o \
Chris Wilson10be98a2019-05-28 10:29:49 +0100108 gem/i915_gem_pm.o \
109 gem/i915_gem_shmem.o \
110 gem/i915_gem_shrinker.o \
111 gem/i915_gem_stolen.o \
Chris Wilson446e2d12019-05-28 10:29:54 +0100112 gem/i915_gem_throttle.o \
Chris Wilson10be98a2019-05-28 10:29:49 +0100113 gem/i915_gem_tiling.o \
114 gem/i915_gem_userptr.o \
Chris Wilsond45a1a52019-05-28 10:29:52 +0100115 gem/i915_gem_wait.o \
Chris Wilson10be98a2019-05-28 10:29:49 +0100116 gem/i915_gemfs.o
Chris Wilson64d6c502019-02-05 13:00:02 +0000117i915-y += \
Chris Wilson98932142019-05-28 10:29:44 +0100118 $(gem-y) \
Chris Wilson64d6c502019-02-05 13:00:02 +0000119 i915_active.o \
120 i915_cmd_parser.o \
Brad Volkin493018d2014-12-11 12:13:08 -0800121 i915_gem_batch_pool.o \
Chris Wilsonb47eb4a2010-08-07 11:01:23 +0100122 i915_gem_evict.o \
Joonas Lahtinenb42fe9c2016-11-11 12:43:54 +0200123 i915_gem_fence_reg.o \
Chris Wilson54cf91d2010-11-25 18:00:26 +0000124 i915_gem_gtt.o \
Daniel Vetter2fae6a82014-03-07 09:17:21 +0100125 i915_gem.o \
Daniel Vetter042794b2015-07-24 13:55:10 +0200126 i915_gem_render_state.o \
Chris Wilson32eb6bc2019-02-28 10:20:33 +0000127 i915_globals.o \
Lionel Landwerlina446ae22018-03-06 12:28:56 +0000128 i915_query.o \
Chris Wilsone61e0f52018-02-21 09:56:36 +0000129 i915_request.o \
Chris Wilsone2f34962018-10-01 15:47:54 +0100130 i915_scheduler.o \
Chris Wilson1c5d22f2009-08-25 11:15:50 +0100131 i915_trace_points.o \
Joonas Lahtinenb42fe9c2016-11-11 12:43:54 +0200132 i915_vma.o \
Jackie Li6b0478f2018-03-13 17:32:50 -0700133 intel_wopcm.o
Daniel Vetter2fae6a82014-03-07 09:17:21 +0100134
Alex Dai33a732f2015-08-12 15:43:36 +0100135# general-purpose microcontroller (GuC) support
Arkadiusz Hiler2d803c22016-11-25 18:59:35 +0100136i915-y += intel_uc.o \
Michal Wajdeczkoa16b4312017-10-04 15:33:25 +0000137 intel_uc_fw.o \
Michal Wajdeczko9bf384c2017-10-04 18:13:41 +0000138 intel_guc.o \
Sujaritha Sundaresanc24f0c12018-01-02 13:20:24 -0800139 intel_guc_ads.o \
Michal Wajdeczkof8a58d62017-05-26 11:13:25 +0000140 intel_guc_ct.o \
Michal Wajdeczkoe8668bb2017-10-16 14:47:14 +0000141 intel_guc_fw.o \
Sagar Arun Kamblea2695742017-11-16 19:02:41 +0530142 intel_guc_log.o \
143 intel_guc_submission.o \
Sagar Arun Kamble57312ea2018-03-01 22:15:45 +0530144 intel_huc.o \
145 intel_huc_fw.o
Alex Dai33a732f2015-08-12 15:43:36 +0100146
Mika Kuoppala9d0a6fa2014-05-14 17:02:16 +0300147# autogenerated null render state
148i915-y += intel_renderstate_gen6.o \
149 intel_renderstate_gen7.o \
Armin Reeseff7a60f2014-10-23 08:34:28 -0700150 intel_renderstate_gen8.o \
151 intel_renderstate_gen9.o
Mika Kuoppala9d0a6fa2014-05-14 17:02:16 +0300152
Daniel Vetter2fae6a82014-03-07 09:17:21 +0100153# modesetting core code
Jani Nikuladf0566a2019-06-13 11:44:16 +0300154obj-y += display/
155i915-y += \
156 display/intel_atomic.o \
157 display/intel_atomic_plane.o \
158 display/intel_audio.o \
159 display/intel_bios.o \
160 display/intel_bw.o \
161 display/intel_cdclk.o \
162 display/intel_color.o \
163 display/intel_combo_phy.o \
164 display/intel_connector.o \
165 display/intel_display.o \
166 display/intel_display_power.o \
167 display/intel_dpio_phy.o \
168 display/intel_dpll_mgr.o \
169 display/intel_fbc.o \
170 display/intel_fifo_underrun.o \
171 display/intel_frontbuffer.o \
172 display/intel_hdcp.o \
173 display/intel_hotplug.o \
174 display/intel_lpe_audio.o \
175 display/intel_overlay.o \
176 display/intel_psr.o \
177 display/intel_quirks.o \
178 display/intel_sprite.o
179i915-$(CONFIG_ACPI) += \
180 display/intel_acpi.o \
181 display/intel_opregion.o
182i915-$(CONFIG_DRM_FBDEV_EMULATION) += \
183 display/intel_fbdev.o
Daniel Vetter2fae6a82014-03-07 09:17:21 +0100184
185# modesetting output/encoder code
Jani Nikula379bc102019-06-13 11:44:15 +0300186i915-y += \
187 display/dvo_ch7017.o \
188 display/dvo_ch7xxx.o \
189 display/dvo_ivch.o \
190 display/dvo_ns2501.o \
191 display/dvo_sil164.o \
192 display/dvo_tfp410.o \
193 display/icl_dsi.o \
194 display/intel_crt.o \
195 display/intel_ddi.o \
196 display/intel_dp.o \
197 display/intel_dp_aux_backlight.o \
198 display/intel_dp_link_training.o \
199 display/intel_dp_mst.o \
200 display/intel_dsi.o \
201 display/intel_dsi_dcs_backlight.o \
202 display/intel_dsi_vbt.o \
203 display/intel_dvo.o \
204 display/intel_gmbus.o \
205 display/intel_hdmi.o \
206 display/intel_lspcon.o \
207 display/intel_lvds.o \
208 display/intel_panel.o \
209 display/intel_sdvo.o \
210 display/intel_tv.o \
211 display/intel_vdsc.o \
212 display/vlv_dsi.o \
213 display/vlv_dsi_pll.o
Dave Airliec0e09202008-05-29 10:09:59 +1000214
Michal Wajdeczko5ed7a0c2019-06-26 12:38:26 +0000215# perf code
216obj-y += oa/
217i915-y += \
218 oa/i915_oa_hsw.o \
219 oa/i915_oa_bdw.o \
220 oa/i915_oa_chv.o \
221 oa/i915_oa_sklgt2.o \
222 oa/i915_oa_sklgt3.o \
223 oa/i915_oa_sklgt4.o \
224 oa/i915_oa_bxt.o \
225 oa/i915_oa_kblgt2.o \
226 oa/i915_oa_kblgt3.o \
227 oa/i915_oa_glk.o \
228 oa/i915_oa_cflgt2.o \
229 oa/i915_oa_cflgt3.o \
230 oa/i915_oa_cnl.o \
231 oa/i915_oa_icl.o
232i915-y += i915_perf.o
233
Chris Wilson98a2f412016-10-12 10:05:18 +0100234# Post-mortem debug and GPU hang state capture
235i915-$(CONFIG_DRM_I915_CAPTURE_ERROR) += i915_gpu_error.o
Chris Wilson953c7f82017-02-13 17:15:12 +0000236i915-$(CONFIG_DRM_I915_SELFTEST) += \
Chris Wilson10be98a2019-05-28 10:29:49 +0100237 gem/selftests/igt_gem_utils.o \
Chris Wilson953c7f82017-02-13 17:15:12 +0000238 selftests/i915_random.o \
Chris Wilson98dc0452018-05-05 10:10:13 +0100239 selftests/i915_selftest.o \
Tvrtko Ursulin8d2f6e22018-11-30 08:02:53 +0000240 selftests/igt_flush_test.o \
Chris Wilsone4a8c812019-01-21 22:20:47 +0000241 selftests/igt_live_test.o \
Tvrtko Ursulin28d6ccc2018-12-03 12:50:11 +0000242 selftests/igt_reset.o \
Tvrtko Ursulin8d2f6e22018-11-30 08:02:53 +0000243 selftests/igt_spinner.o
Chris Wilson98a2f412016-10-12 10:05:18 +0100244
Yu Zhangcf9d2892015-02-10 19:05:47 +0800245# virtual gpu code
246i915-y += i915_vgpu.o
247
Zhi Wang0ad35fe2016-06-16 08:07:00 -0400248ifeq ($(CONFIG_DRM_I915_GVT),y)
249i915-y += intel_gvt.o
250include $(src)/gvt/Makefile
251endif
252
Chris Wilsonc58305a2016-08-19 16:54:28 +0100253obj-$(CONFIG_DRM_I915) += i915.o
Zhenyu Wang9bdb0732018-12-07 16:16:53 +0800254obj-$(CONFIG_DRM_I915_GVT_KVMGT) += gvt/kvmgt.o