[Intel-gfx] [PATCH] drm/i915/gt: remove a static inline that requires including i915_drv.h

Jani Nikula jani.nikula at intel.com
Thu Sep 21 16:24:56 UTC 2023


It's actively harmful to add static inlines in headers that require you
to pull in more headers. Remove the include added in commit f1530f912ed8
("drm/i915/gt: Apply workaround 22016122933 correctly"). We see that
there's already an implicit dependency on the i915_drv.h that we need to
address too.

Cc: Andi Shyti <andi.shyti at linux.intel.com>
Cc: Fei Yang <fei.yang at intel.com>
Cc: Jonathan Cavitt <jonathan.cavitt at intel.com>
Cc: Matt Roper <matthew.d.roper at intel.com>
Signed-off-by: Jani Nikula <jani.nikula at intel.com>

---

As a reminder, a significant portion of the headers in the driver cause
a rebuild of the *entire* driver when changed. We need to reduce the
header interdependencies, not add more.
---
 drivers/gpu/drm/i915/gt/intel_gt.c     | 5 +++++
 drivers/gpu/drm/i915/gt/intel_gt.h     | 6 +-----
 drivers/gpu/drm/i915/gt/intel_gt_mcr.c | 1 +
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
index 449f0b7fc843..93062c35e072 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
@@ -1019,3 +1019,8 @@ enum i915_map_type intel_gt_coherent_map_type(struct intel_gt *gt,
 	else
 		return I915_MAP_WC;
 }
+
+bool intel_gt_needs_wa_22016122933(struct intel_gt *gt)
+{
+	return MEDIA_VER_FULL(gt->i915) == IP_VER(13, 0) && gt->type == GT_MEDIA;
+}
diff --git a/drivers/gpu/drm/i915/gt/intel_gt.h b/drivers/gpu/drm/i915/gt/intel_gt.h
index 239848bcb2a4..2cac499d5aa3 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt.h
+++ b/drivers/gpu/drm/i915/gt/intel_gt.h
@@ -6,7 +6,6 @@
 #ifndef __INTEL_GT__
 #define __INTEL_GT__
 
-#include "i915_drv.h"
 #include "intel_engine_types.h"
 #include "intel_gt_types.h"
 #include "intel_reset.h"
@@ -88,10 +87,7 @@ static inline bool gt_is_root(struct intel_gt *gt)
 	return !gt->info.id;
 }
 
-static inline bool intel_gt_needs_wa_22016122933(struct intel_gt *gt)
-{
-	return MEDIA_VER_FULL(gt->i915) == IP_VER(13, 0) && gt->type == GT_MEDIA;
-}
+bool intel_gt_needs_wa_22016122933(struct intel_gt *gt);
 
 static inline struct intel_gt *uc_to_gt(struct intel_uc *uc)
 {
diff --git a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
index 11d181b1cc7a..bf4a933de03a 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
@@ -3,6 +3,7 @@
  * Copyright © 2022 Intel Corporation
  */
 
+#include "i915_drv.h"
 #include "intel_gt.h"
 #include "intel_gt_mcr.h"
 #include "intel_gt_print.h"
-- 
2.39.2



More information about the Intel-gfx mailing list