drm/i915: move i915_coherent_map_type() to i915_gem_pages.c and un-inline
authorJani Nikula <jani.nikula@intel.com>
Wed, 14 Sep 2022 16:35:14 +0000 (19:35 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 26 Sep 2022 09:21:08 +0000 (12:21 +0300)
The inline function has no place in i915_drv.h. Move it away, un-inline,
and untangle some header dependencies while at it.

Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220914163514.1837467-1-jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_dpt.c
drivers/gpu/drm/i915/gem/i915_gem_object.h
drivers/gpu/drm/i915/gem/i915_gem_pages.c
drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
drivers/gpu/drm/i915/gt/intel_gsc.c
drivers/gpu/drm/i915/gt/intel_migrate.c
drivers/gpu/drm/i915/gt/selftest_migrate.c
drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c

index ac587647e1f5015d393270a8aeeb7b360ef236b3..ad1a37b515fb1c8991d1832bd99a2d301bc15c20 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "gem/i915_gem_domain.h"
 #include "gem/i915_gem_internal.h"
+#include "gem/i915_gem_lmem.h"
 #include "gt/gen8_ppgtt.h"
 
 #include "i915_drv.h"
index 7317d4102955f5eb7081e805ec33cbd71e414e71..a3b7551a57fc3d52ba0a5df9a08a4d2a4b7ba3b5 100644 (file)
@@ -482,6 +482,10 @@ void *__must_check i915_gem_object_pin_map(struct drm_i915_gem_object *obj,
 void *__must_check i915_gem_object_pin_map_unlocked(struct drm_i915_gem_object *obj,
                                                    enum i915_map_type type);
 
+enum i915_map_type i915_coherent_map_type(struct drm_i915_private *i915,
+                                         struct drm_i915_gem_object *obj,
+                                         bool always_coherent);
+
 void __i915_gem_object_flush_map(struct drm_i915_gem_object *obj,
                                 unsigned long offset,
                                 unsigned long size);
index 8357dbdcab5cb0e406e2bba97a8f7f528fb85ba1..b8b6da951c7414f0914c43cf8d494825bb95e704 100644 (file)
@@ -466,6 +466,18 @@ void *i915_gem_object_pin_map_unlocked(struct drm_i915_gem_object *obj,
        return ret;
 }
 
+enum i915_map_type i915_coherent_map_type(struct drm_i915_private *i915,
+                                         struct drm_i915_gem_object *obj,
+                                         bool always_coherent)
+{
+       if (i915_gem_object_is_lmem(obj))
+               return I915_MAP_WC;
+       if (HAS_LLC(i915) || always_coherent)
+               return I915_MAP_WB;
+       else
+               return I915_MAP_WC;
+}
+
 void __i915_gem_object_flush_map(struct drm_i915_gem_object *obj,
                                 unsigned long offset,
                                 unsigned long size)
index 55bf23dc0e542be0c48db8aec59a54cad41a3b84..f16164de2482fdb9d56d61e4294ac525137d03e1 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/prime_numbers.h>
 
 #include "gem/i915_gem_internal.h"
+#include "gem/i915_gem_lmem.h"
 #include "gem/i915_gem_region.h"
 #include "gem/i915_gem_ttm.h"
 #include "gem/i915_gem_ttm_move.h"
index 7af6db3194ddbf6bd8c77c47bbd6c795b35fab0e..d56f75b605d8268298a6d05d55a04dc62e7edaff 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/mei_aux.h>
 #include "i915_drv.h"
 #include "i915_reg.h"
+#include "gem/i915_gem_lmem.h"
 #include "gem/i915_gem_region.h"
 #include "gt/intel_gsc.h"
 #include "gt/intel_gt.h"
index aaaf1906026c1351b15cb4f74608fee41478f9b9..b405a04135ca2178692284b8f743d9d6cb0246bd 100644 (file)
@@ -10,6 +10,7 @@
 #include "intel_gtt.h"
 #include "intel_migrate.h"
 #include "intel_ring.h"
+#include "gem/i915_gem_lmem.h"
 
 struct insert_pte_data {
        u64 offset;
index 2b0c8799994900312a744ef94f4ed1f642a1f962..0dc5309c90a4f5c37f175e2e68f580e8a47d2191 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/sort.h>
 
 #include "gem/i915_gem_internal.h"
+#include "gem/i915_gem_lmem.h"
 
 #include "selftests/i915_random.h"
 
index 74cbe8eaf531884f5e27fda2f413d427c6934613..657f0beb8e0642efedf75894bf6ca50db03aa2b9 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <linux/bsearch.h>
 
+#include "gem/i915_gem_lmem.h"
 #include "gt/intel_engine_regs.h"
 #include "gt/intel_gt.h"
 #include "gt/intel_gt_mcr.h"
index 22ba66e48a9b01bacd0edd16bd05df59eb5ab99b..ca6f47496869222cef3489f0e01230839ae74de7 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/circ_buf.h>
 
 #include "gem/i915_gem_context.h"
+#include "gem/i915_gem_lmem.h"
 #include "gt/gen8_engine_cs.h"
 #include "gt/intel_breadcrumbs.h"
 #include "gt/intel_context.h"
index b11c212f1b0d6a3a321cce90c8cae3da03c91a63..cf6d0c102d541a7cbeed02a90a257e1fb3c6c57d 100644 (file)
@@ -51,7 +51,6 @@
 #include "display/intel_opregion.h"
 
 #include "gem/i915_gem_context_types.h"
-#include "gem/i915_gem_lmem.h"
 #include "gem/i915_gem_shrinker.h"
 #include "gem/i915_gem_stolen.h"
 
@@ -1508,16 +1507,4 @@ mkwrite_device_info(struct drm_i915_private *dev_priv)
        return (struct intel_device_info *)INTEL_INFO(dev_priv);
 }
 
-static inline enum i915_map_type
-i915_coherent_map_type(struct drm_i915_private *i915,
-                      struct drm_i915_gem_object *obj, bool always_coherent)
-{
-       if (i915_gem_object_is_lmem(obj))
-               return I915_MAP_WC;
-       if (HAS_LLC(i915) || always_coherent)
-               return I915_MAP_WB;
-       else
-               return I915_MAP_WC;
-}
-
 #endif
index e050a2de5fd1df8fc4397f12d23256f1fbd75ac0..ea2cf1080979d62b65ea8c2c58d5c8417881fe72 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "gem/i915_gem_context.h"
 #include "gem/i915_gem_internal.h"
+#include "gem/i915_gem_lmem.h"
 #include "gem/i915_gem_region.h"
 #include "gem/selftests/mock_context.h"
 #include "gt/intel_context.h"