[PATCH 03/28] drm/i915: Keep ggtt->probe() as a local

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The ggtt->probe() vfunc is only called once during GGTT initialisation.
We can keep it in a local for the function, sparing a few bytes in our
i915_ggtt persistent struct.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 15 ++++++++-------
 drivers/gpu/drm/i915/i915_gem_gtt.h |  2 --
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 3fc77776d89b..70178a77d0c8 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -3215,13 +3215,17 @@ int i915_ggtt_probe_hw(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	struct i915_ggtt *ggtt = &dev_priv->ggtt;
+	int (*probe)(struct i915_ggtt *ggtt);
 	int ret;
 
+	ggtt->base.dev = dev;
+	ggtt->base.is_ggtt = true;
+
 	if (INTEL_INFO(dev)->gen <= 5) {
-		ggtt->probe = i915_gmch_probe;
+		probe = i915_gmch_probe;
 		ggtt->base.cleanup = i915_gmch_remove;
 	} else if (INTEL_INFO(dev)->gen < 8) {
-		ggtt->probe = gen6_gmch_probe;
+		probe = gen6_gmch_probe;
 		ggtt->base.cleanup = gen6_gmch_remove;
 
 		if (HAS_EDRAM(dev))
@@ -3235,14 +3239,11 @@ int i915_ggtt_probe_hw(struct drm_device *dev)
 		else
 			ggtt->base.pte_encode = snb_pte_encode;
 	} else {
-		ggtt->probe = gen8_gmch_probe;
+		probe = gen8_gmch_probe;
 		ggtt->base.cleanup = gen6_gmch_remove;
 	}
 
-	ggtt->base.dev = dev;
-	ggtt->base.is_ggtt = true;
-
-	ret = ggtt->probe(ggtt);
+	ret = probe(ggtt);
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h
index 5b6744a5c944..defb274f3ba5 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.h
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
@@ -365,8 +365,6 @@ struct i915_ggtt {
 	bool do_idle_maps;
 
 	int mtrr;
-
-	int (*probe)(struct i915_ggtt *ggtt);
 };
 
 struct i915_hw_ppgtt {
-- 
2.8.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux