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 16subdir-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) 20subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable) 21# 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) 25subdir-ccflags-y += $(call cc-disable-warning, uninitialized) 26subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror 27 28# Fine grained warnings disable 29CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init) 30CFLAGS_intel_fbdev.o = $(call cc-disable-warning, override-init) 31 32subdir-ccflags-y += \ 33 $(call as-instr,movntdqa (%eax)$(comma)%xmm0,-DCONFIG_AS_MOVNTDQA) 34 35# Extra header tests 36include $(src)/Makefile.header-test 37 38subdir-ccflags-y += -I$(src) 39 40# Please keep these build lists sorted! 41 42# core driver code 43i915-y += i915_drv.o \ 44 i915_irq.o \ 45 i915_params.o \ 46 i915_pci.o \ 47 i915_suspend.o \ 48 i915_sysfs.o \ 49 intel_csr.o \ 50 intel_device_info.o \ 51 intel_pm.o \ 52 intel_runtime_pm.o \ 53 intel_wakeref.o \ 54 intel_uncore.o 55 56# core library code 57i915-y += \ 58 i915_memcpy.o \ 59 i915_mm.o \ 60 i915_sw_fence.o \ 61 i915_syncmap.o \ 62 i915_user_extensions.o 63 64i915-$(CONFIG_COMPAT) += i915_ioc32.o 65i915-$(CONFIG_DEBUG_FS) += i915_debugfs.o intel_pipe_crc.o 66i915-$(CONFIG_PERF_EVENTS) += i915_pmu.o 67 68# "Graphics Technology" (aka we talk to the gpu) 69obj-y += gt/ 70gt-y += \ 71 gt/intel_breadcrumbs.o \ 72 gt/intel_context.o \ 73 gt/intel_engine_cs.o \ 74 gt/intel_engine_pm.o \ 75 gt/intel_gt_pm.o \ 76 gt/intel_hangcheck.o \ 77 gt/intel_lrc.o \ 78 gt/intel_reset.o \ 79 gt/intel_ringbuffer.o \ 80 gt/intel_mocs.o \ 81 gt/intel_sseu.o \ 82 gt/intel_workarounds.o 83gt-$(CONFIG_DRM_I915_SELFTEST) += \ 84 gt/mock_engine.o 85i915-y += $(gt-y) 86 87# GEM (Graphics Execution Management) code 88i915-y += \ 89 i915_active.o \ 90 i915_cmd_parser.o \ 91 i915_gem_batch_pool.o \ 92 i915_gem_clflush.o \ 93 i915_gem_context.o \ 94 i915_gem_dmabuf.o \ 95 i915_gem_evict.o \ 96 i915_gem_execbuffer.o \ 97 i915_gem_fence_reg.o \ 98 i915_gem_gtt.o \ 99 i915_gem_internal.o \ 100 i915_gem.o \ 101 i915_gem_object.o \ 102 i915_gem_pm.o \ 103 i915_gem_render_state.o \ 104 i915_gem_shrinker.o \ 105 i915_gem_stolen.o \ 106 i915_gem_tiling.o \ 107 i915_gem_userptr.o \ 108 i915_gemfs.o \ 109 i915_globals.o \ 110 i915_query.o \ 111 i915_request.o \ 112 i915_scheduler.o \ 113 i915_timeline.o \ 114 i915_trace_points.o \ 115 i915_vma.o \ 116 intel_wopcm.o 117 118# general-purpose microcontroller (GuC) support 119i915-y += intel_uc.o \ 120 intel_uc_fw.o \ 121 intel_guc.o \ 122 intel_guc_ads.o \ 123 intel_guc_ct.o \ 124 intel_guc_fw.o \ 125 intel_guc_log.o \ 126 intel_guc_submission.o \ 127 intel_huc.o \ 128 intel_huc_fw.o 129 130# autogenerated null render state 131i915-y += intel_renderstate_gen6.o \ 132 intel_renderstate_gen7.o \ 133 intel_renderstate_gen8.o \ 134 intel_renderstate_gen9.o 135 136# modesetting core code 137i915-y += intel_audio.o \ 138 intel_atomic.o \ 139 intel_atomic_plane.o \ 140 intel_bios.o \ 141 intel_cdclk.o \ 142 intel_color.o \ 143 intel_combo_phy.o \ 144 intel_connector.o \ 145 intel_display.o \ 146 intel_dpio_phy.o \ 147 intel_dpll_mgr.o \ 148 intel_fbc.o \ 149 intel_fifo_underrun.o \ 150 intel_frontbuffer.o \ 151 intel_hdcp.o \ 152 intel_hotplug.o \ 153 intel_overlay.o \ 154 intel_psr.o \ 155 intel_quirks.o \ 156 intel_sideband.o \ 157 intel_sprite.o 158i915-$(CONFIG_ACPI) += intel_acpi.o intel_opregion.o 159i915-$(CONFIG_DRM_FBDEV_EMULATION) += intel_fbdev.o 160 161# modesetting output/encoder code 162i915-y += dvo_ch7017.o \ 163 dvo_ch7xxx.o \ 164 dvo_ivch.o \ 165 dvo_ns2501.o \ 166 dvo_sil164.o \ 167 dvo_tfp410.o \ 168 icl_dsi.o \ 169 intel_crt.o \ 170 intel_ddi.o \ 171 intel_dp_aux_backlight.o \ 172 intel_dp_link_training.o \ 173 intel_dp_mst.o \ 174 intel_dp.o \ 175 intel_dsi.o \ 176 intel_dsi_dcs_backlight.o \ 177 intel_dsi_vbt.o \ 178 intel_dvo.o \ 179 intel_gmbus.o \ 180 intel_hdmi.o \ 181 intel_lspcon.o \ 182 intel_lvds.o \ 183 intel_panel.o \ 184 intel_sdvo.o \ 185 intel_tv.o \ 186 vlv_dsi.o \ 187 vlv_dsi_pll.o \ 188 intel_vdsc.o 189 190# Post-mortem debug and GPU hang state capture 191i915-$(CONFIG_DRM_I915_CAPTURE_ERROR) += i915_gpu_error.o 192i915-$(CONFIG_DRM_I915_SELFTEST) += \ 193 selftests/i915_random.o \ 194 selftests/i915_selftest.o \ 195 selftests/igt_flush_test.o \ 196 selftests/igt_gem_utils.o \ 197 selftests/igt_live_test.o \ 198 selftests/igt_reset.o \ 199 selftests/igt_spinner.o 200 201# virtual gpu code 202i915-y += i915_vgpu.o 203 204# perf code 205i915-y += i915_perf.o \ 206 i915_oa_hsw.o \ 207 i915_oa_bdw.o \ 208 i915_oa_chv.o \ 209 i915_oa_sklgt2.o \ 210 i915_oa_sklgt3.o \ 211 i915_oa_sklgt4.o \ 212 i915_oa_bxt.o \ 213 i915_oa_kblgt2.o \ 214 i915_oa_kblgt3.o \ 215 i915_oa_glk.o \ 216 i915_oa_cflgt2.o \ 217 i915_oa_cflgt3.o \ 218 i915_oa_cnl.o \ 219 i915_oa_icl.o 220 221ifeq ($(CONFIG_DRM_I915_GVT),y) 222i915-y += intel_gvt.o 223include $(src)/gvt/Makefile 224endif 225 226# LPE Audio for VLV and CHT 227i915-y += intel_lpe_audio.o 228 229obj-$(CONFIG_DRM_I915) += i915.o 230obj-$(CONFIG_DRM_I915_GVT_KVMGT) += gvt/kvmgt.o 231