Commit ce2fce25 authored by Matt Roper's avatar Matt Roper
Browse files

drm/i915: Only include i915_reg.h from .c files



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: default avatarMatt Roper <matthew.d.roper@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220127234334.4016964-7-matthew.d.roper@intel.com
parent 0d6419e9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@

#include <linux/types.h>

#include "i915_reg.h"
#include "i915_reg_defs.h"

enum port;
struct drm_i915_private;
+1 −0
Original line number Diff line number Diff line
@@ -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"
+1 −0
Original line number Diff line number Diff line
@@ -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"
+1 −0
Original line number Diff line number Diff line
@@ -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"
+1 −1
Original line number Diff line number Diff line
@@ -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;
Loading