drm/i915: Only include i915_reg.h from .c files
authorMatt Roper <matthew.d.roper@intel.com>
Thu, 27 Jan 2022 23:43:34 +0000 (15:43 -0800)
committerMatt Roper <matthew.d.roper@intel.com>
Wed, 2 Feb 2022 15:59:54 +0000 (07:59 -0800)
Several of our i915 header files, have been including i915_reg.h.  This
means that any change to i915_reg.h will trigger a full rebuild of
pretty much every file of the driver, even those that don't have any
kind of register access.  Let's delete the i915_reg.h include from all
headers and add an explicit include from the .c files that truly
need the register definitions; those that need a definition of
i915_reg_t for a function definition can get it from i915_reg_defs.h
instead.

We also remove two non-register #define's (VLV_DISPLAY_BASE and
GEN12_SFC_DONE_MAX) into i915_reg_defs.h to allow us to drop the
i915_reg.h include from a couple of headers.

There's probably a lot more header dependency optimization possible, but
the changes here roughly cut the number of files compiled after 'touch
i915_reg.h' in half --- a good first step.

Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220127234334.4016964-7-matthew.d.roper@intel.com
56 files changed:
drivers/gpu/drm/i915/display/g4x_hdmi.h
drivers/gpu/drm/i915/display/intel_atomic.c
drivers/gpu/drm/i915/display/intel_bios.c
drivers/gpu/drm/i915/display/intel_bw.c
drivers/gpu/drm/i915/display/intel_crt.h
drivers/gpu/drm/i915/display/intel_ddi.h
drivers/gpu/drm/i915/display/intel_de.h
drivers/gpu/drm/i915/display/intel_display_power.h
drivers/gpu/drm/i915/display/intel_dmc.h
drivers/gpu/drm/i915/display/intel_dp.h
drivers/gpu/drm/i915/display/intel_dsb.h
drivers/gpu/drm/i915/display/intel_dsi_vbt.c
drivers/gpu/drm/i915/display/intel_dvo_dev.h
drivers/gpu/drm/i915/display/intel_hdmi.h
drivers/gpu/drm/i915/display/intel_lvds.h
drivers/gpu/drm/i915/display/intel_sdvo.h
drivers/gpu/drm/i915/display/intel_tc.c
drivers/gpu/drm/i915/gem/i915_gem_stolen.c
drivers/gpu/drm/i915/gem/i915_gem_tiling.c
drivers/gpu/drm/i915/gt/gen2_engine_cs.c
drivers/gpu/drm/i915/gt/intel_engine.h
drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c
drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c
drivers/gpu/drm/i915/gt/intel_llc.c
drivers/gpu/drm/i915/gt/intel_rc6.c
drivers/gpu/drm/i915/gt/intel_rc6.h
drivers/gpu/drm/i915/gt/intel_region_lmem.c
drivers/gpu/drm/i915/gt/intel_workarounds_types.h
drivers/gpu/drm/i915/gt/uc/abi/guc_actions_slpc_abi.h
drivers/gpu/drm/i915/gt/uc/intel_guc_reg.h
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
drivers/gpu/drm/i915/gt/uc/intel_huc.h
drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
drivers/gpu/drm/i915/gvt/aperture_gm.c
drivers/gpu/drm/i915/gvt/display.c
drivers/gpu/drm/i915/gvt/dmabuf.c
drivers/gpu/drm/i915/gvt/edid.c
drivers/gpu/drm/i915/gvt/fb_decoder.c
drivers/gpu/drm/i915/gvt/handlers.c
drivers/gpu/drm/i915/gvt/interrupt.c
drivers/gpu/drm/i915/gvt/interrupt.h
drivers/gpu/drm/i915/gvt/mmio.c
drivers/gpu/drm/i915/gvt/mmio_context.h
drivers/gpu/drm/i915/i915_cmd_parser.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_pci.c
drivers/gpu/drm/i915/i915_perf_types.h
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/i915_reg_defs.h
drivers/gpu/drm/i915/intel_dram.c
drivers/gpu/drm/i915/intel_pcode.c
drivers/gpu/drm/i915/intel_pm.h
drivers/gpu/drm/i915/intel_sbi.c
drivers/gpu/drm/i915/intel_uncore.h
drivers/gpu/drm/i915/vlv_sideband.c

index 7aca14b..db9a93b 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <linux/types.h>
 
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 
 enum port;
 struct drm_i915_private;
index 1080741..0939040 100644 (file)
@@ -35,6 +35,7 @@
 #include <drm/drm_plane_helper.h>
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "intel_atomic.h"
 #include "intel_cdclk.h"
 #include "intel_display_types.h"
index 6038629..3eb7777 100644 (file)
@@ -32,6 +32,7 @@
 #include "display/intel_gmbus.h"
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 
 #define _INTEL_BIOS_PRIVATE
 #include "intel_vbt_defs.h"
index c35bad2..5dce3cf 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <drm/drm_atomic_state_helper.h>
 
+#include "i915_reg.h"
 #include "intel_atomic.h"
 #include "intel_bw.h"
 #include "intel_cdclk.h"
index 6c5c446..c6071ef 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef __INTEL_CRT_H__
 #define __INTEL_CRT_H__
 
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 
 enum pipe;
 struct drm_encoder;
index c2fea65..d39076f 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef __INTEL_DDI_H__
 #define __INTEL_DDI_H__
 
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 
 struct drm_connector_state;
 struct drm_i915_private;
index 9d8c177..9c104f6 100644 (file)
@@ -7,7 +7,6 @@
 #define __INTEL_DE_H__
 
 #include "i915_drv.h"
-#include "i915_reg.h"
 #include "i915_trace.h"
 #include "intel_uncore.h"
 
index 686d18e..930be3a 100644 (file)
@@ -7,7 +7,6 @@
 #define __INTEL_DISPLAY_POWER_H__
 
 #include "intel_runtime_pm.h"
-#include "i915_reg.h"
 
 enum dpio_channel;
 enum dpio_phy;
index b20f344..7c59030 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef __INTEL_DMC_H__
 #define __INTEL_DMC_H__
 
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 #include "intel_wakeref.h"
 #include <linux/workqueue.h>
 
index b64145a..d457e17 100644 (file)
@@ -8,8 +8,6 @@
 
 #include <linux/types.h>
 
-#include "i915_reg.h"
-
 enum intel_output_format;
 enum pipe;
 enum port;
index 654a11f..6cb9c58 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <linux/types.h>
 
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 
 struct intel_crtc_state;
 struct i915_vma;
index da0bd05..a85574c 100644 (file)
@@ -39,6 +39,7 @@
 #include <video/mipi_display.h>
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "intel_display_types.h"
 #include "intel_dsi.h"
 #include "intel_dsi_vbt.h"
index 94a6ae1..d96c3cc 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <drm/drm_crtc.h>
 
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 
 struct intel_dvo_device {
        const char *name;
index b577c38..b0804b8 100644 (file)
@@ -9,8 +9,6 @@
 #include <linux/hdmi.h>
 #include <linux/types.h>
 
-#include "i915_reg.h"
-
 struct drm_connector;
 struct drm_encoder;
 struct drm_i915_private;
index bc9c8b8..9d3372d 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <linux/types.h>
 
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 
 enum pipe;
 struct drm_i915_private;
index 72065e4..2868852 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <linux/types.h>
 
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 
 struct drm_i915_private;
 enum pipe;
index 3291124..feead08 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "intel_display.h"
 #include "intel_display_types.h"
 #include "intel_dp_mst.h"
index 7df50fd..4dfed34 100644 (file)
@@ -14,6 +14,7 @@
 #include "gem/i915_gem_region.h"
 #include "i915_drv.h"
 #include "i915_gem_stolen.h"
+#include "i915_reg.h"
 #include "i915_vgpu.h"
 
 /*
index cf32432..0e0e480 100644 (file)
@@ -13,6 +13,7 @@
 #include "i915_gem_mman.h"
 #include "i915_gem_object.h"
 #include "i915_gem_tiling.h"
+#include "i915_reg.h"
 
 /**
  * DOC: buffer object tiling
index e0e8d22..1c82caf 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "gen2_engine_cs.h"
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "intel_engine.h"
 #include "intel_engine_regs.h"
 #include "intel_gpu_commands.h"
index 08559ac..0e353d8 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/seqlock.h>
 
 #include "i915_pmu.h"
-#include "i915_reg.h"
 #include "i915_request.h"
 #include "i915_selftest.h"
 #include "intel_engine_types.h"
index 3fd4789..95c9145 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "i915_scatterlist.h"
 #include "i915_pvinfo.h"
 #include "i915_vgpu.h"
index c7321c9..0db822c 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "intel_gt.h"
 #include "intel_gt_clock_utils.h"
 #include "intel_gt_regs.h"
index 47ec4b2..4e448c1 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/seq_file.h>
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "intel_gt.h"
 #include "intel_gt_clock_utils.h"
 #include "intel_gt_debugfs.h"
index 63f1883..335c657 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/cpufreq.h>
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "intel_gt.h"
 #include "intel_llc.h"
 #include "intel_pcode.h"
index 5458e66..6df359c 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/pm_runtime.h>
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "i915_vgpu.h"
 #include "intel_engine_regs.h"
 #include "intel_gt.h"
index e119ec4..b6fea71 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef INTEL_RC6_H
 #define INTEL_RC6_H
 
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 
 struct intel_engine_cs;
 struct intel_rc6;
index fde2dcb..cb5a67c 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "intel_memory_region.h"
 #include "intel_region_lmem.h"
 #include "intel_region_ttm.h"
index 1e87368..8a4b6de 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <linux/types.h>
 
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 
 struct i915_wa {
        i915_reg_t      reg;
index 7a8d4bf..62cb425 100644 (file)
@@ -7,7 +7,6 @@
 #define _GUC_ACTIONS_SLPC_ABI_H_
 
 #include <linux/types.h>
-#include "i915_reg.h"
 
 /**
  * DOC: SLPC SHARED DATA STRUCTURE
index b37fc2f..85846c5 100644 (file)
@@ -9,7 +9,7 @@
 #include <linux/compiler.h>
 #include <linux/types.h>
 
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 
 /* Definitions of GuC H/W registers, bits, etc */
 
index 57ae9ac..ddbea93 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "intel_guc_slpc.h"
 #include "gt/intel_gt.h"
 #include "gt/intel_gt_regs.h"
index ae8c8a6..73ec670 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INTEL_HUC_H_
 #define _INTEL_HUC_H_
 
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 #include "intel_uc_fw.h"
 #include "intel_huc_fw.h"
 
index a5af05b..dd588ec 100644 (file)
@@ -11,6 +11,7 @@
 #include "intel_uc_fw.h"
 #include "intel_uc_fw_abi.h"
 #include "i915_drv.h"
+#include "i915_reg.h"
 
 static inline struct intel_gt *
 ____uc_fw_to_gt(struct intel_uc_fw *uc_fw, enum intel_uc_fw_type type)
index 0d6d598..6b3dedd 100644 (file)
@@ -35,6 +35,7 @@
  */
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "gt/intel_ggtt_fencing.h"
 #include "gvt.h"
 
index 3ce88de..c7722c8 100644 (file)
@@ -33,6 +33,7 @@
  */
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "gvt.h"
 
 static int get_edp_pipe(struct intel_vgpu *vgpu)
index ebe1ecd..d02a48a 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/vfio.h>
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "gvt.h"
 
 #define GEN8_DECODE_PTE(pte) (pte & GENMASK_ULL(63, 12))
index 2224780..a30ba2d 100644 (file)
@@ -33,6 +33,7 @@
  */
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "gvt.h"
 
 #define GMBUS1_TOTAL_BYTES_SHIFT 16
index f2a2163..835c3fd 100644 (file)
@@ -37,6 +37,7 @@
 #include "i915_drv.h"
 #include "gvt.h"
 #include "i915_pvinfo.h"
+#include "i915_reg.h"
 
 #define PRIMARY_FORMAT_NUM     16
 struct pixel_format {
index 02271b9..c2ae790 100644 (file)
@@ -37,6 +37,7 @@
  */
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "gvt.h"
 #include "i915_pvinfo.h"
 #include "display/intel_display_types.h"
index 9ccc6b1..228f623 100644 (file)
@@ -30,6 +30,7 @@
  */
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "gvt.h"
 #include "trace.h"
 
index 0989e18..b62f04a 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/hrtimer.h>
 #include <linux/kernel.h>
 
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 
 enum intel_gvt_event_type {
        RCS_MI_USER_INTERRUPT = 0,
index 0215e1e..5db0ef8 100644 (file)
@@ -34,6 +34,7 @@
  */
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "gvt.h"
 
 #include "gt/intel_gt_regs.h"
index 128fd7f..9540813 100644 (file)
@@ -41,7 +41,6 @@
 #include "gt/intel_engine_regs.h"
 #include "gt/intel_engine_types.h"
 #include "gt/intel_lrc_reg.h"
-#include "i915_reg.h"
 
 struct i915_request;
 struct intel_context;
index b394b3c..aea4c30 100644 (file)
@@ -33,6 +33,7 @@
 #include "i915_cmd_parser.h"
 #include "i915_drv.h"
 #include "i915_memcpy.h"
+#include "i915_reg.h"
 
 /**
  * DOC: batch buffer command parser
index 512ba03..f7bdb97 100644 (file)
@@ -61,7 +61,6 @@
 #include <drm/ttm/ttm_device.h>
 
 #include "i915_params.h"
-#include "i915_reg.h"
 #include "i915_utils.h"
 
 #include "display/intel_bios.h"
index 8261b64..189d3bb 100644 (file)
@@ -28,6 +28,7 @@
 #include "i915_driver.h"
 #include "i915_drv.h"
 #include "i915_pci.h"
+#include "i915_reg.h"
 
 #define PLATFORM(x) .platform = (x)
 #define GEN(x) \
index aa14354..473a3c0 100644 (file)
@@ -18,7 +18,7 @@
 #include <uapi/drm/i915_drm.h>
 
 #include "gt/intel_sseu.h"
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 #include "intel_wakeref.h"
 
 struct drm_i915_private;
index 33aa005..081aad5 100644 (file)
  *  #define GEN8_BAR                    _MMIO(0xb888)
  */
 
-#define VLV_DISPLAY_BASE               0x180000
 #define VLV_MIPI_BASE                  VLV_DISPLAY_BASE
 #define BXT_MIPI_BASE                  0x60000
 
 #define _MASKED_BIT_ENABLE(a)  ({ typeof(a) _a = (a); _MASKED_FIELD(_a, _a); })
 #define _MASKED_BIT_DISABLE(a) (_MASKED_FIELD((a), 0))
 
-#define GEN12_SFC_DONE_MAX             4
-
 #define GU_CNTL                                _MMIO(0x101010)
 #define   LMEM_INIT                    REG_BIT(7)
 
index 6ee51d4..34d37bb 100644 (file)
@@ -94,4 +94,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
        return !i915_mmio_reg_equal(reg, INVALID_MMIO_REG);
 }
 
+#define VLV_DISPLAY_BASE               0x180000
+
+#define GEN12_SFC_DONE_MAX             4
+
 #endif /* __I915_REG_DEFS__ */
index 3e26cca..723bd04 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "intel_dram.h"
 #include "intel_pcode.h"
 
index db4403f..391a374 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include "i915_drv.h"
+#include "i915_reg.h"
 #include "intel_pcode.h"
 
 static int gen6_check_mailbox_status(u32 mbox)
index 990cdca..ae821e3 100644 (file)
@@ -12,7 +12,6 @@
 #include "display/intel_global_state.h"
 
 #include "i915_drv.h"
-#include "i915_reg.h"
 
 struct drm_device;
 struct drm_i915_private;
index 5ba8490..5c6e517 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "i915_drv.h"
 #include "intel_sbi.h"
+#include "i915_reg.h"
 
 /* SBI access */
 static int intel_sbi_rw(struct drm_i915_private *i915, u16 reg,
index 2a15b2b..6ff56d6 100644 (file)
@@ -30,7 +30,7 @@
 #include <linux/hrtimer.h>
 #include <linux/io-64-nonatomic-lo-hi.h>
 
-#include "i915_reg.h"
+#include "i915_reg_defs.h"
 
 struct drm_i915_private;
 struct intel_runtime_pm;
index ed2ac57..c260013 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "i915_drv.h"
 #include "i915_iosf_mbi.h"
+#include "i915_reg.h"
 #include "vlv_sideband.h"
 
 /*