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# Unconditionally enable W=1 warnings locally 7# --- begin copy-paste W=1 warnings from scripts/Makefile.extrawarn 8subdir-ccflags-y += -Wextra -Wunused -Wno-unused-parameter 9subdir-ccflags-y += -Wmissing-declarations 10subdir-ccflags-y += $(call cc-option, -Wrestrict) 11subdir-ccflags-y += -Wmissing-format-attribute 12subdir-ccflags-y += -Wmissing-prototypes 13subdir-ccflags-y += -Wold-style-definition 14subdir-ccflags-y += -Wmissing-include-dirs 15subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable) 16subdir-ccflags-y += $(call cc-option, -Wunused-const-variable) 17subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned) 18subdir-ccflags-y += $(call cc-option, -Wformat-overflow) 19subdir-ccflags-y += $(call cc-option, -Wformat-truncation) 20subdir-ccflags-y += $(call cc-option, -Wstringop-overflow) 21subdir-ccflags-y += $(call cc-option, -Wstringop-truncation) 22# The following turn off the warnings enabled by -Wextra 23ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),) 24subdir-ccflags-y += -Wno-missing-field-initializers 25subdir-ccflags-y += -Wno-type-limits 26subdir-ccflags-y += -Wno-shift-negative-value 27endif 28ifeq ($(findstring 3, $(KBUILD_EXTRA_WARN)),) 29subdir-ccflags-y += -Wno-sign-compare 30endif 31# --- end copy-paste 32 33# Enable -Werror in CI and development 34subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror 35 36# Fine grained warnings disable 37CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init) 38CFLAGS_display/intel_display_device.o = $(call cc-disable-warning, override-init) 39CFLAGS_display/intel_fbdev.o = $(call cc-disable-warning, override-init) 40 41# Support compiling the display code separately for both i915 and xe 42# drivers. Define I915 when building i915. 43subdir-ccflags-y += -DI915 44 45subdir-ccflags-y += -I$(srctree)/$(src) 46 47# Please keep these build lists sorted! 48 49# core driver code 50i915-y += \ 51 i915_config.o \ 52 i915_driver.o \ 53 i915_drm_client.o \ 54 i915_getparam.o \ 55 i915_ioctl.o \ 56 i915_irq.o \ 57 i915_mitigations.o \ 58 i915_module.o \ 59 i915_params.o \ 60 i915_pci.o \ 61 i915_scatterlist.o \ 62 i915_suspend.o \ 63 i915_switcheroo.o \ 64 i915_sysfs.o \ 65 i915_utils.o \ 66 intel_clock_gating.o \ 67 intel_device_info.o \ 68 intel_memory_region.o \ 69 intel_pcode.o \ 70 intel_region_ttm.o \ 71 intel_runtime_pm.o \ 72 intel_sbi.o \ 73 intel_step.o \ 74 intel_uncore.o \ 75 intel_wakeref.o \ 76 vlv_sideband.o \ 77 vlv_suspend.o 78 79# core peripheral code 80i915-y += \ 81 soc/intel_dram.o \ 82 soc/intel_gmch.o \ 83 soc/intel_pch.o 84 85# core library code 86i915-y += \ 87 i915_memcpy.o \ 88 i915_mm.o \ 89 i915_sw_fence.o \ 90 i915_sw_fence_work.o \ 91 i915_syncmap.o \ 92 i915_user_extensions.o 93 94i915-$(CONFIG_COMPAT) += \ 95 i915_ioc32.o 96i915-$(CONFIG_DEBUG_FS) += \ 97 i915_debugfs.o \ 98 i915_debugfs_params.o 99i915-$(CONFIG_PERF_EVENTS) += \ 100 i915_pmu.o 101 102# "Graphics Technology" (aka we talk to the gpu) 103gt-y += \ 104 gt/gen2_engine_cs.o \ 105 gt/gen6_engine_cs.o \ 106 gt/gen6_ppgtt.o \ 107 gt/gen7_renderclear.o \ 108 gt/gen8_engine_cs.o \ 109 gt/gen8_ppgtt.o \ 110 gt/intel_breadcrumbs.o \ 111 gt/intel_context.o \ 112 gt/intel_context_sseu.o \ 113 gt/intel_engine_cs.o \ 114 gt/intel_engine_heartbeat.o \ 115 gt/intel_engine_pm.o \ 116 gt/intel_engine_user.o \ 117 gt/intel_execlists_submission.o \ 118 gt/intel_ggtt.o \ 119 gt/intel_ggtt_fencing.o \ 120 gt/intel_gt.o \ 121 gt/intel_gt_buffer_pool.o \ 122 gt/intel_gt_clock_utils.o \ 123 gt/intel_gt_debugfs.o \ 124 gt/intel_gt_engines_debugfs.o \ 125 gt/intel_gt_irq.o \ 126 gt/intel_gt_mcr.o \ 127 gt/intel_gt_pm.o \ 128 gt/intel_gt_pm_debugfs.o \ 129 gt/intel_gt_pm_irq.o \ 130 gt/intel_gt_requests.o \ 131 gt/intel_gt_sysfs.o \ 132 gt/intel_gt_sysfs_pm.o \ 133 gt/intel_gtt.o \ 134 gt/intel_llc.o \ 135 gt/intel_lrc.o \ 136 gt/intel_migrate.o \ 137 gt/intel_mocs.o \ 138 gt/intel_ppgtt.o \ 139 gt/intel_rc6.o \ 140 gt/intel_region_lmem.o \ 141 gt/intel_renderstate.o \ 142 gt/intel_reset.o \ 143 gt/intel_ring.o \ 144 gt/intel_ring_submission.o \ 145 gt/intel_rps.o \ 146 gt/intel_sa_media.o \ 147 gt/intel_sseu.o \ 148 gt/intel_sseu_debugfs.o \ 149 gt/intel_timeline.o \ 150 gt/intel_tlb.o \ 151 gt/intel_wopcm.o \ 152 gt/intel_workarounds.o \ 153 gt/shmem_utils.o \ 154 gt/sysfs_engines.o 155 156# x86 intel-gtt module support 157gt-$(CONFIG_X86) += \ 158 gt/intel_ggtt_gmch.o 159# autogenerated null render state 160gt-y += \ 161 gt/gen6_renderstate.o \ 162 gt/gen7_renderstate.o \ 163 gt/gen8_renderstate.o \ 164 gt/gen9_renderstate.o 165i915-y += $(gt-y) 166 167# GEM (Graphics Execution Management) code 168gem-y += \ 169 gem/i915_gem_busy.o \ 170 gem/i915_gem_clflush.o \ 171 gem/i915_gem_context.o \ 172 gem/i915_gem_create.o \ 173 gem/i915_gem_dmabuf.o \ 174 gem/i915_gem_domain.o \ 175 gem/i915_gem_execbuffer.o \ 176 gem/i915_gem_internal.o \ 177 gem/i915_gem_lmem.o \ 178 gem/i915_gem_mman.o \ 179 gem/i915_gem_object.o \ 180 gem/i915_gem_pages.o \ 181 gem/i915_gem_phys.o \ 182 gem/i915_gem_pm.o \ 183 gem/i915_gem_region.o \ 184 gem/i915_gem_shmem.o \ 185 gem/i915_gem_shrinker.o \ 186 gem/i915_gem_stolen.o \ 187 gem/i915_gem_throttle.o \ 188 gem/i915_gem_tiling.o \ 189 gem/i915_gem_ttm.o \ 190 gem/i915_gem_ttm_move.o \ 191 gem/i915_gem_ttm_pm.o \ 192 gem/i915_gem_userptr.o \ 193 gem/i915_gem_wait.o \ 194 gem/i915_gemfs.o 195i915-y += \ 196 $(gem-y) \ 197 i915_active.o \ 198 i915_cmd_parser.o \ 199 i915_deps.o \ 200 i915_gem.o \ 201 i915_gem_evict.o \ 202 i915_gem_gtt.o \ 203 i915_gem_ww.o \ 204 i915_query.o \ 205 i915_request.o \ 206 i915_scheduler.o \ 207 i915_trace_points.o \ 208 i915_ttm_buddy_manager.o \ 209 i915_vma.o \ 210 i915_vma_resource.o 211 212# general-purpose microcontroller (GuC) support 213i915-y += \ 214 gt/uc/intel_gsc_fw.o \ 215 gt/uc/intel_gsc_proxy.o \ 216 gt/uc/intel_gsc_uc.o \ 217 gt/uc/intel_gsc_uc_debugfs.o \ 218 gt/uc/intel_gsc_uc_heci_cmd_submit.o\ 219 gt/uc/intel_guc.o \ 220 gt/uc/intel_guc_ads.o \ 221 gt/uc/intel_guc_capture.o \ 222 gt/uc/intel_guc_ct.o \ 223 gt/uc/intel_guc_debugfs.o \ 224 gt/uc/intel_guc_fw.o \ 225 gt/uc/intel_guc_hwconfig.o \ 226 gt/uc/intel_guc_log.o \ 227 gt/uc/intel_guc_log_debugfs.o \ 228 gt/uc/intel_guc_rc.o \ 229 gt/uc/intel_guc_slpc.o \ 230 gt/uc/intel_guc_submission.o \ 231 gt/uc/intel_huc.o \ 232 gt/uc/intel_huc_debugfs.o \ 233 gt/uc/intel_huc_fw.o \ 234 gt/uc/intel_uc.o \ 235 gt/uc/intel_uc_debugfs.o \ 236 gt/uc/intel_uc_fw.o 237 238# graphics system controller (GSC) support 239i915-y += \ 240 gt/intel_gsc.o 241 242# graphics hardware monitoring (HWMON) support 243i915-$(CONFIG_HWMON) += \ 244 i915_hwmon.o 245 246# modesetting core code 247i915-y += \ 248 display/hsw_ips.o \ 249 display/i9xx_plane.o \ 250 display/i9xx_wm.o \ 251 display/intel_atomic.o \ 252 display/intel_atomic_plane.o \ 253 display/intel_audio.o \ 254 display/intel_bios.o \ 255 display/intel_bw.o \ 256 display/intel_cdclk.o \ 257 display/intel_color.o \ 258 display/intel_combo_phy.o \ 259 display/intel_connector.o \ 260 display/intel_crtc.o \ 261 display/intel_crtc_state_dump.o \ 262 display/intel_cursor.o \ 263 display/intel_display.o \ 264 display/intel_display_driver.o \ 265 display/intel_display_irq.o \ 266 display/intel_display_params.o \ 267 display/intel_display_power.o \ 268 display/intel_display_power_map.o \ 269 display/intel_display_power_well.o \ 270 display/intel_display_reset.o \ 271 display/intel_display_rps.o \ 272 display/intel_display_wa.o \ 273 display/intel_dmc.o \ 274 display/intel_dpio_phy.o \ 275 display/intel_dpll.o \ 276 display/intel_dpll_mgr.o \ 277 display/intel_dpt.o \ 278 display/intel_dpt_common.o \ 279 display/intel_drrs.o \ 280 display/intel_dsb.o \ 281 display/intel_dsb_buffer.o \ 282 display/intel_fb.o \ 283 display/intel_fb_bo.o \ 284 display/intel_fb_pin.o \ 285 display/intel_fbc.o \ 286 display/intel_fdi.o \ 287 display/intel_fifo_underrun.o \ 288 display/intel_frontbuffer.o \ 289 display/intel_global_state.o \ 290 display/intel_hdcp.o \ 291 display/intel_hdcp_gsc.o \ 292 display/intel_hdcp_gsc_message.o \ 293 display/intel_hotplug.o \ 294 display/intel_hotplug_irq.o \ 295 display/intel_hti.o \ 296 display/intel_link_bw.o \ 297 display/intel_load_detect.o \ 298 display/intel_lpe_audio.o \ 299 display/intel_modeset_lock.o \ 300 display/intel_modeset_setup.o \ 301 display/intel_modeset_verify.o \ 302 display/intel_overlay.o \ 303 display/intel_pch_display.o \ 304 display/intel_pch_refclk.o \ 305 display/intel_plane_initial.o \ 306 display/intel_pmdemand.o \ 307 display/intel_psr.o \ 308 display/intel_quirks.o \ 309 display/intel_sprite.o \ 310 display/intel_sprite_uapi.o \ 311 display/intel_tc.o \ 312 display/intel_vblank.o \ 313 display/intel_vga.o \ 314 display/intel_wm.o \ 315 display/skl_scaler.o \ 316 display/skl_universal_plane.o \ 317 display/skl_watermark.o 318i915-$(CONFIG_ACPI) += \ 319 display/intel_acpi.o \ 320 display/intel_opregion.o 321i915-$(CONFIG_DRM_FBDEV_EMULATION) += \ 322 display/intel_fbdev.o \ 323 display/intel_fbdev_fb.o 324i915-$(CONFIG_DEBUG_FS) += \ 325 display/intel_display_debugfs.o \ 326 display/intel_display_debugfs_params.o \ 327 display/intel_pipe_crc.o 328 329# modesetting output/encoder code 330i915-y += \ 331 display/dvo_ch7017.o \ 332 display/dvo_ch7xxx.o \ 333 display/dvo_ivch.o \ 334 display/dvo_ns2501.o \ 335 display/dvo_sil164.o \ 336 display/dvo_tfp410.o \ 337 display/g4x_dp.o \ 338 display/g4x_hdmi.o \ 339 display/icl_dsi.o \ 340 display/intel_backlight.o \ 341 display/intel_crt.o \ 342 display/intel_cx0_phy.o \ 343 display/intel_ddi.o \ 344 display/intel_ddi_buf_trans.o \ 345 display/intel_display_device.o \ 346 display/intel_display_trace.o \ 347 display/intel_dkl_phy.o \ 348 display/intel_dp.o \ 349 display/intel_dp_aux.o \ 350 display/intel_dp_aux_backlight.o \ 351 display/intel_dp_hdcp.o \ 352 display/intel_dp_link_training.o \ 353 display/intel_dp_mst.o \ 354 display/intel_dsi.o \ 355 display/intel_dsi_dcs_backlight.o \ 356 display/intel_dsi_vbt.o \ 357 display/intel_dvo.o \ 358 display/intel_gmbus.o \ 359 display/intel_hdmi.o \ 360 display/intel_lspcon.o \ 361 display/intel_lvds.o \ 362 display/intel_panel.o \ 363 display/intel_pps.o \ 364 display/intel_qp_tables.o \ 365 display/intel_sdvo.o \ 366 display/intel_snps_phy.o \ 367 display/intel_tv.o \ 368 display/intel_vdsc.o \ 369 display/intel_vrr.o \ 370 display/vlv_dsi.o \ 371 display/vlv_dsi_pll.o 372 373i915-y += \ 374 i915_perf.o 375 376# Protected execution platform (PXP) support. Base support is required for HuC 377i915-y += \ 378 pxp/intel_pxp.o \ 379 pxp/intel_pxp_huc.o \ 380 pxp/intel_pxp_tee.o 381 382i915-$(CONFIG_DRM_I915_PXP) += \ 383 pxp/intel_pxp_cmd.o \ 384 pxp/intel_pxp_debugfs.o \ 385 pxp/intel_pxp_gsccs.o \ 386 pxp/intel_pxp_irq.o \ 387 pxp/intel_pxp_pm.o \ 388 pxp/intel_pxp_session.o 389 390# Post-mortem debug and GPU hang state capture 391i915-$(CONFIG_DRM_I915_CAPTURE_ERROR) += \ 392 i915_gpu_error.o 393i915-$(CONFIG_DRM_I915_SELFTEST) += \ 394 gem/selftests/i915_gem_client_blt.o \ 395 gem/selftests/igt_gem_utils.o \ 396 selftests/i915_random.o \ 397 selftests/i915_selftest.o \ 398 selftests/igt_atomic.o \ 399 selftests/igt_flush_test.o \ 400 selftests/igt_live_test.o \ 401 selftests/igt_mmap.o \ 402 selftests/igt_reset.o \ 403 selftests/igt_spinner.o \ 404 selftests/intel_scheduler_helpers.o \ 405 selftests/librapl.o 406 407# virtual gpu code 408i915-y += \ 409 i915_vgpu.o 410 411i915-$(CONFIG_DRM_I915_GVT) += \ 412 intel_gvt.o \ 413 intel_gvt_mmio_table.o 414include $(src)/gvt/Makefile 415 416obj-$(CONFIG_DRM_I915) += i915.o 417obj-$(CONFIG_DRM_I915_GVT_KVMGT) += kvmgt.o 418 419# kernel-doc test 420# 421# Enable locally for CONFIG_DRM_I915_WERROR=y. See also scripts/Makefile.build 422ifdef CONFIG_DRM_I915_WERROR 423 cmd_checkdoc = $(srctree)/scripts/kernel-doc -none -Werror $< 424endif 425 426# header test 427 428# exclude some broken headers from the test coverage 429no-header-test := \ 430 display/intel_vbt_defs.h 431 432always-$(CONFIG_DRM_I915_WERROR) += \ 433 $(patsubst %.h,%.hdrtest, $(filter-out $(no-header-test), \ 434 $(shell cd $(srctree)/$(src) && find * -name '*.h'))) 435 436quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@) 437 cmd_hdrtest = $(CC) $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; \ 438 $(srctree)/scripts/kernel-doc -none -Werror $<; touch $@ 439 440$(obj)/%.hdrtest: $(src)/%.h FORCE 441 $(call if_changed_dep,hdrtest) 442