drm/i915/guc: Move intel_guc_reserved_gtt_size to intel_wopcm_guc_size
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 11 Jun 2019 11:00:43 +0000 (12:00 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 11 Jun 2019 13:40:14 +0000 (14:40 +0100)
Reduces pointer chasing and gets more to the point.

v2:
 * Tidy whitespace.
 * Tidy comment. (Michal)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190611110044.7742-1-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/i915_gem_gtt.c
drivers/gpu/drm/i915/intel_guc.c
drivers/gpu/drm/i915/intel_guc.h
drivers/gpu/drm/i915/intel_wopcm.h

index 5f7268c33ac0f12211fd801c6d70882333e0db5b..5ca3f83ea9a6c10489332ad776c1c77de43e0b13 100644 (file)
@@ -2831,7 +2831,7 @@ int i915_gem_init_ggtt(struct drm_i915_private *dev_priv)
         * why.
         */
        ggtt->pin_bias = max_t(u32, I915_GTT_PAGE_SIZE,
-                              intel_guc_reserved_gtt_size(&dev_priv->guc));
+                              intel_wopcm_guc_size(&dev_priv->wopcm));
 
        ret = intel_vgt_balloon(dev_priv);
        if (ret)
index 43232242d16729cf61e541f433837682f8f1c7f3..d45d976244027a0635fe07a31a900b5668db2a10 100644 (file)
@@ -686,23 +686,6 @@ err:
        return vma;
 }
 
-/**
- * intel_guc_reserved_gtt_size()
- * @guc:       intel_guc structure
- *
- * The GuC WOPCM mapping shadows the lower part of the GGTT, so if we are using
- * GuC we can't have any objects pinned in that region. This function returns
- * the size of the shadowed region.
- *
- * Returns:
- * 0 if GuC is not present or not in use.
- * Otherwise, the GuC WOPCM size.
- */
-u32 intel_guc_reserved_gtt_size(struct intel_guc *guc)
-{
-       return guc_to_i915(guc)->wopcm.guc.size;
-}
-
 int intel_guc_reserve_ggtt_top(struct intel_guc *guc)
 {
        struct drm_i915_private *i915 = guc_to_i915(guc);
index e07e4c69cf08c5608d11e57d2f472040d36a2610..85c3b02a0c0822bd7781c7a10ab1097d01c0157e 100644 (file)
@@ -172,7 +172,6 @@ int intel_guc_auth_huc(struct intel_guc *guc, u32 rsa_offset);
 int intel_guc_suspend(struct intel_guc *guc);
 int intel_guc_resume(struct intel_guc *guc);
 struct i915_vma *intel_guc_allocate_vma(struct intel_guc *guc, u32 size);
-u32 intel_guc_reserved_gtt_size(struct intel_guc *guc);
 int intel_guc_reserve_ggtt_top(struct intel_guc *guc);
 void intel_guc_release_ggtt_top(struct intel_guc *guc);
 
index 6298910a384c4f74bfa88f512bcc182ba7cd061c..1144019715209ff664174f99bfc1861b2474ea25 100644 (file)
@@ -24,6 +24,21 @@ struct intel_wopcm {
        } guc;
 };
 
+/**
+ * intel_wopcm_guc_size()
+ * @wopcm:     intel_wopcm structure
+ *
+ * Returns size of the WOPCM shadowed region.
+ *
+ * Returns:
+ * 0 if GuC is not present or not in use.
+ * Otherwise, the GuC WOPCM size.
+ */
+static inline u32 intel_wopcm_guc_size(struct intel_wopcm *wopcm)
+{
+       return wopcm->guc.size;
+}
+
 void intel_wopcm_init_early(struct intel_wopcm *wopcm);
 int intel_wopcm_init(struct intel_wopcm *wopcm);
 int intel_wopcm_init_hw(struct intel_wopcm *wopcm);