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 16dd08ebf6SMatthew Brost# making these call cc-disable-warning breaks when trying to build xe.mod.o 17dd08ebf6SMatthew Brost# by calling make M=drivers/gpu/drm/xe. This doesn't happen in upstream tree, 18dd08ebf6SMatthew Brost# so it was somehow fixed by the changes in the build system. Move it back to 19dd08ebf6SMatthew Brost# $(call cc-disable-warning, ...) after rebase. 20dd08ebf6SMatthew Brostsubdir-ccflags-y += -Wno-unused-parameter 21dd08ebf6SMatthew Brostsubdir-ccflags-y += -Wno-type-limits 22dd08ebf6SMatthew Brost#subdir-ccflags-y += $(call cc-disable-warning, unused-parameter) 23dd08ebf6SMatthew Brost#subdir-ccflags-y += $(call cc-disable-warning, type-limits) 24dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers) 25dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable) 26dd08ebf6SMatthew Brost# clang warnings 27dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, sign-compare) 28dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, sometimes-uninitialized) 29dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, initializer-overrides) 30dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, frame-address) 31dd08ebf6SMatthew Brostsubdir-ccflags-$(CONFIG_DRM_XE_WERROR) += -Werror 32dd08ebf6SMatthew Brost 33dd08ebf6SMatthew Brost# Fine grained warnings disable 34dd08ebf6SMatthew BrostCFLAGS_xe_pci.o = $(call cc-disable-warning, override-init) 35dd08ebf6SMatthew Brost 36dd08ebf6SMatthew Brostsubdir-ccflags-y += -I$(srctree)/$(src) 37dd08ebf6SMatthew Brost 38dd08ebf6SMatthew Brost# Please keep these build lists sorted! 39dd08ebf6SMatthew Brost 40dd08ebf6SMatthew Brost# core driver code 41dd08ebf6SMatthew Brost 42dd08ebf6SMatthew Brostxe-y += xe_bb.o \ 43dd08ebf6SMatthew Brost xe_bo.o \ 44dd08ebf6SMatthew Brost xe_bo_evict.o \ 45dd08ebf6SMatthew Brost xe_debugfs.o \ 46dd08ebf6SMatthew Brost xe_device.o \ 47dd08ebf6SMatthew Brost xe_dma_buf.o \ 48dd08ebf6SMatthew Brost xe_engine.o \ 49dd08ebf6SMatthew Brost xe_exec.o \ 50dd08ebf6SMatthew Brost xe_execlist.o \ 51dd08ebf6SMatthew Brost xe_force_wake.o \ 52dd08ebf6SMatthew Brost xe_ggtt.o \ 53dd08ebf6SMatthew Brost xe_gpu_scheduler.o \ 54dd08ebf6SMatthew Brost xe_gt.o \ 55dd08ebf6SMatthew Brost xe_gt_clock.o \ 56dd08ebf6SMatthew Brost xe_gt_debugfs.o \ 57dd08ebf6SMatthew Brost xe_gt_mcr.o \ 58dd08ebf6SMatthew Brost xe_gt_pagefault.o \ 59dd08ebf6SMatthew Brost xe_gt_sysfs.o \ 60*a9351846SMatthew Brost xe_gt_tlb_invalidation.o \ 61dd08ebf6SMatthew Brost xe_gt_topology.o \ 62dd08ebf6SMatthew Brost xe_guc.o \ 63dd08ebf6SMatthew Brost xe_guc_ads.o \ 64dd08ebf6SMatthew Brost xe_guc_ct.o \ 65dd08ebf6SMatthew Brost xe_guc_debugfs.o \ 66dd08ebf6SMatthew Brost xe_guc_hwconfig.o \ 67dd08ebf6SMatthew Brost xe_guc_log.o \ 68dd08ebf6SMatthew Brost xe_guc_pc.o \ 69dd08ebf6SMatthew Brost xe_guc_submit.o \ 70dd08ebf6SMatthew Brost xe_hw_engine.o \ 71dd08ebf6SMatthew Brost xe_hw_fence.o \ 72dd08ebf6SMatthew Brost xe_huc.o \ 73dd08ebf6SMatthew Brost xe_huc_debugfs.o \ 74dd08ebf6SMatthew Brost xe_irq.o \ 75dd08ebf6SMatthew Brost xe_lrc.o \ 76dd08ebf6SMatthew Brost xe_migrate.o \ 77dd08ebf6SMatthew Brost xe_mmio.o \ 78dd08ebf6SMatthew Brost xe_mocs.o \ 79dd08ebf6SMatthew Brost xe_module.o \ 80dd08ebf6SMatthew Brost xe_pci.o \ 81dd08ebf6SMatthew Brost xe_pcode.o \ 82dd08ebf6SMatthew Brost xe_pm.o \ 83dd08ebf6SMatthew Brost xe_preempt_fence.o \ 84dd08ebf6SMatthew Brost xe_pt.o \ 85dd08ebf6SMatthew Brost xe_pt_walk.o \ 86dd08ebf6SMatthew Brost xe_query.o \ 87dd08ebf6SMatthew Brost xe_reg_sr.o \ 88dd08ebf6SMatthew Brost xe_reg_whitelist.o \ 89dd08ebf6SMatthew Brost xe_rtp.o \ 90dd08ebf6SMatthew Brost xe_ring_ops.o \ 91dd08ebf6SMatthew Brost xe_sa.o \ 92dd08ebf6SMatthew Brost xe_sched_job.o \ 93dd08ebf6SMatthew Brost xe_step.o \ 94dd08ebf6SMatthew Brost xe_sync.o \ 95dd08ebf6SMatthew Brost xe_trace.o \ 96dd08ebf6SMatthew Brost xe_ttm_gtt_mgr.o \ 97d8b52a02SMaarten Lankhorst xe_ttm_stolen_mgr.o \ 98dd08ebf6SMatthew Brost xe_ttm_vram_mgr.o \ 99dd08ebf6SMatthew Brost xe_tuning.o \ 100dd08ebf6SMatthew Brost xe_uc.o \ 101dd08ebf6SMatthew Brost xe_uc_debugfs.o \ 102dd08ebf6SMatthew Brost xe_uc_fw.o \ 103dd08ebf6SMatthew Brost xe_vm.o \ 104dd08ebf6SMatthew Brost xe_vm_madvise.o \ 105dd08ebf6SMatthew Brost xe_wait_user_fence.o \ 106dd08ebf6SMatthew Brost xe_wa.o \ 107dd08ebf6SMatthew Brost xe_wopcm.o 108dd08ebf6SMatthew Brost 109dd08ebf6SMatthew Brost# XXX: Needed for i915 register definitions. Will be removed after xe-regs. 110dd08ebf6SMatthew Brostsubdir-ccflags-y += -I$(srctree)/drivers/gpu/drm/i915/ 111dd08ebf6SMatthew Brost 112dd08ebf6SMatthew Brostobj-$(CONFIG_DRM_XE) += xe.o 113dd08ebf6SMatthew Brostobj-$(CONFIG_DRM_XE_KUNIT_TEST) += tests/ 114dd08ebf6SMatthew Brost\ 115dd08ebf6SMatthew Brost# header test 116dd08ebf6SMatthew Brostalways-$(CONFIG_DRM_XE_WERROR) += \ 117dd08ebf6SMatthew Brost $(patsubst %.h,%.hdrtest, $(shell cd $(srctree)/$(src) && find * -name '*.h')) 118dd08ebf6SMatthew Brost 119dd08ebf6SMatthew Brostquiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@) 120dd08ebf6SMatthew Brost cmd_hdrtest = $(CC) -DHDRTEST $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@ 121dd08ebf6SMatthew Brost 122dd08ebf6SMatthew Brost$(obj)/%.hdrtest: $(src)/%.h FORCE 123dd08ebf6SMatthew Brost $(call if_changed_dep,hdrtest) 124