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 165a4a8e8bSLucas De Marchisubdir-ccflags-y += $(call cc-disable-warning, unused-parameter) 175a4a8e8bSLucas De Marchisubdir-ccflags-y += $(call cc-disable-warning, type-limits) 18dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers) 19dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable) 20dd08ebf6SMatthew Brost# clang warnings 21dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, sign-compare) 22dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, sometimes-uninitialized) 23dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, initializer-overrides) 24dd08ebf6SMatthew Brostsubdir-ccflags-y += $(call cc-disable-warning, frame-address) 25dd08ebf6SMatthew Brostsubdir-ccflags-$(CONFIG_DRM_XE_WERROR) += -Werror 26dd08ebf6SMatthew Brost 27dd08ebf6SMatthew Brost# Fine grained warnings disable 28dd08ebf6SMatthew BrostCFLAGS_xe_pci.o = $(call cc-disable-warning, override-init) 29dd08ebf6SMatthew Brost 30464f2243SLucas De Marchisubdir-ccflags-y += -I$(obj) -I$(srctree)/$(src) 31dd08ebf6SMatthew Brost 329616e74bSLucas De Marchi# generated sources 339616e74bSLucas De Marchihostprogs := xe_gen_wa_oob 349616e74bSLucas De Marchi 359616e74bSLucas De Marchigenerated_oob := $(obj)/generated/xe_wa_oob.c $(obj)/generated/xe_wa_oob.h 369616e74bSLucas De Marchi 379616e74bSLucas De Marchiquiet_cmd_wa_oob = GEN $(notdir $(generated_oob)) 389616e74bSLucas De Marchi cmd_wa_oob = mkdir -p $(@D); $^ $(generated_oob) 399616e74bSLucas De Marchi 409616e74bSLucas De Marchi$(generated_oob) &: $(obj)/xe_gen_wa_oob $(srctree)/$(src)/xe_wa_oob.rules 419616e74bSLucas De Marchi $(call cmd,wa_oob) 429616e74bSLucas De Marchi 43*5d30cfe0SMatt Roper$(obj)/xe_guc.o $(obj)/xe_migrate.o $(obj)/xe_ring_ops.o $(obj)/xe_vm.o $(obj)/xe_wa.o $(obj)/xe_ttm_stolen_mgr.o: $(generated_oob) 449616e74bSLucas De Marchi 45dd08ebf6SMatthew Brost# Please keep these build lists sorted! 46dd08ebf6SMatthew Brost 47dd08ebf6SMatthew Brost# core driver code 48dd08ebf6SMatthew Brost 49dd08ebf6SMatthew Brostxe-y += xe_bb.o \ 50dd08ebf6SMatthew Brost xe_bo.o \ 51dd08ebf6SMatthew Brost xe_bo_evict.o \ 52dd08ebf6SMatthew Brost xe_debugfs.o \ 53e7994850SRodrigo Vivi xe_devcoredump.o \ 54dd08ebf6SMatthew Brost xe_device.o \ 55b2d75619SAnshuman Gupta xe_device_sysfs.o \ 56dd08ebf6SMatthew Brost xe_dma_buf.o \ 578f965392STejas Upadhyay xe_drm_client.o \ 58dd08ebf6SMatthew Brost xe_exec.o \ 59dd08ebf6SMatthew Brost xe_execlist.o \ 60c22a4ed0SFrancois Dugast xe_exec_queue.o \ 61dd08ebf6SMatthew Brost xe_force_wake.o \ 62dd08ebf6SMatthew Brost xe_ggtt.o \ 63dd08ebf6SMatthew Brost xe_gpu_scheduler.o \ 64dd08ebf6SMatthew Brost xe_gt.o \ 65dd08ebf6SMatthew Brost xe_gt_clock.o \ 66dd08ebf6SMatthew Brost xe_gt_debugfs.o \ 671c2097bbSRiana Tauro xe_gt_idle_sysfs.o \ 68dd08ebf6SMatthew Brost xe_gt_mcr.o \ 69dd08ebf6SMatthew Brost xe_gt_pagefault.o \ 70dd08ebf6SMatthew Brost xe_gt_sysfs.o \ 71a9351846SMatthew Brost xe_gt_tlb_invalidation.o \ 72dd08ebf6SMatthew Brost xe_gt_topology.o \ 73dd08ebf6SMatthew Brost xe_guc.o \ 74dd08ebf6SMatthew Brost xe_guc_ads.o \ 75dd08ebf6SMatthew Brost xe_guc_ct.o \ 76dd08ebf6SMatthew Brost xe_guc_debugfs.o \ 77dd08ebf6SMatthew Brost xe_guc_hwconfig.o \ 78dd08ebf6SMatthew Brost xe_guc_log.o \ 79dd08ebf6SMatthew Brost xe_guc_pc.o \ 80dd08ebf6SMatthew Brost xe_guc_submit.o \ 8187a4c85dSVitaly Lubart xe_heci_gsc.o \ 82dd08ebf6SMatthew Brost xe_hw_engine.o \ 83038ff941STejas Upadhyay xe_hw_engine_class_sysfs.o \ 84dd08ebf6SMatthew Brost xe_hw_fence.o \ 85dd08ebf6SMatthew Brost xe_huc.o \ 86dd08ebf6SMatthew Brost xe_huc_debugfs.o \ 87dd08ebf6SMatthew Brost xe_irq.o \ 88dd08ebf6SMatthew Brost xe_lrc.o \ 89dd08ebf6SMatthew Brost xe_migrate.o \ 90dd08ebf6SMatthew Brost xe_mmio.o \ 91dd08ebf6SMatthew Brost xe_mocs.o \ 92dd08ebf6SMatthew Brost xe_module.o \ 93576c6380SMatt Roper xe_pat.o \ 94dd08ebf6SMatthew Brost xe_pci.o \ 95dd08ebf6SMatthew Brost xe_pcode.o \ 96dd08ebf6SMatthew Brost xe_pm.o \ 97dd08ebf6SMatthew Brost xe_preempt_fence.o \ 98dd08ebf6SMatthew Brost xe_pt.o \ 99dd08ebf6SMatthew Brost xe_pt_walk.o \ 100dd08ebf6SMatthew Brost xe_query.o \ 101845f64bdSThomas Hellström xe_range_fence.o \ 102dd08ebf6SMatthew Brost xe_reg_sr.o \ 103dd08ebf6SMatthew Brost xe_reg_whitelist.o \ 104dd08ebf6SMatthew Brost xe_rtp.o \ 105dd08ebf6SMatthew Brost xe_ring_ops.o \ 106dd08ebf6SMatthew Brost xe_sa.o \ 107dd08ebf6SMatthew Brost xe_sched_job.o \ 108dd08ebf6SMatthew Brost xe_step.o \ 109dd08ebf6SMatthew Brost xe_sync.o \ 110ad703e06SMatt Roper xe_tile.o \ 111e5a845fdSTejas Upadhyay xe_tile_sysfs.o \ 112dd08ebf6SMatthew Brost xe_trace.o \ 1131a545ed7SChang, Bruce xe_ttm_sys_mgr.o \ 114d8b52a02SMaarten Lankhorst xe_ttm_stolen_mgr.o \ 115dd08ebf6SMatthew Brost xe_ttm_vram_mgr.o \ 116dd08ebf6SMatthew Brost xe_tuning.o \ 117dd08ebf6SMatthew Brost xe_uc.o \ 118dd08ebf6SMatthew Brost xe_uc_debugfs.o \ 119dd08ebf6SMatthew Brost xe_uc_fw.o \ 120dd08ebf6SMatthew Brost xe_vm.o \ 121dd08ebf6SMatthew Brost xe_vm_madvise.o \ 122dd08ebf6SMatthew Brost xe_wait_user_fence.o \ 123dd08ebf6SMatthew Brost xe_wa.o \ 124dd08ebf6SMatthew Brost xe_wopcm.o 125dd08ebf6SMatthew Brost 126fb1b7060SBadal Nilawar# graphics hardware monitoring (HWMON) support 127fb1b7060SBadal Nilawarxe-$(CONFIG_HWMON) += xe_hwmon.o 128fb1b7060SBadal Nilawar 129dd08ebf6SMatthew Brostobj-$(CONFIG_DRM_XE) += xe.o 130dd08ebf6SMatthew Brostobj-$(CONFIG_DRM_XE_KUNIT_TEST) += tests/ 1319a56502fSLucas De Marchi 1323856b0f7SAravind Iddamsettyxe-$(CONFIG_PERF_EVENTS) += xe_pmu.o 1333856b0f7SAravind Iddamsetty 134dd08ebf6SMatthew Brost# header test 1359a56502fSLucas De Marchihdrtest_find_args := -not -path xe_rtp_helpers.h 1369a56502fSLucas De Marchi 137dd08ebf6SMatthew Brostalways-$(CONFIG_DRM_XE_WERROR) += \ 1389a56502fSLucas De Marchi $(patsubst %.h,%.hdrtest, $(shell cd $(srctree)/$(src) && find * -name '*.h' $(hdrtest_find_args))) 139dd08ebf6SMatthew Brost 140dd08ebf6SMatthew Brostquiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@) 141dd08ebf6SMatthew Brost cmd_hdrtest = $(CC) -DHDRTEST $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@ 142dd08ebf6SMatthew Brost 143dd08ebf6SMatthew Brost$(obj)/%.hdrtest: $(src)/%.h FORCE 144dd08ebf6SMatthew Brost $(call if_changed_dep,hdrtest) 145