public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Split uncore init into vfunc setup and mmio setup
@ 2017-10-07  8:56 Chris Wilson
  2017-10-07  8:56 ` [PATCH 2/2] drm/i915: Remove early invocations of i915_engines_cleanup() Chris Wilson
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Chris Wilson @ 2017-10-07  8:56 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

Some early initialisation functions (like intel_uc_init_early) would
like to access the table of mmio registers sorted by their powerwell,
which is currently setup later in intel_uncore_init(). Since this is a
static table that now doesn't touch hw, once upon a time we needed to
probe ivb to determine the forcewake register, but now only depends on
pciid (i.e.  gen) we can do the vfunc setup inside init_early, leaving
the mmio setup where it is.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c     | 10 ++++++----
 drivers/gpu/drm/i915/intel_uncore.c | 25 ++++++++++++++-----------
 drivers/gpu/drm/i915/intel_uncore.h |  3 ++-
 3 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 66fc156b294a..7d110797e0dc 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -898,13 +898,15 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv,
 	mutex_init(&dev_priv->wm.wm_mutex);
 	mutex_init(&dev_priv->pps_mutex);
 
-	intel_uc_init_early(dev_priv);
-	i915_memcpy_init_early(dev_priv);
-
 	ret = i915_workqueues_init(dev_priv);
 	if (ret < 0)
 		goto err_engines;
 
+	i915_memcpy_init_early(dev_priv);
+
+	intel_uncore_init_early(dev_priv);
+	intel_uc_init_early(dev_priv);
+
 	/* This must be called before any calls to HAS_PCH_* */
 	intel_detect_pch(dev_priv);
 
@@ -1014,7 +1016,7 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)
 	if (ret < 0)
 		goto err_bridge;
 
-	intel_uncore_init(dev_priv);
+	intel_uncore_init_mmio(dev_priv);
 
 	intel_uc_init_mmio(dev_priv);
 
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 3d41667919dc..4d81bc066b37 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1247,18 +1247,8 @@ static int i915_pmic_bus_access_notifier(struct notifier_block *nb,
 	return NOTIFY_OK;
 }
 
-void intel_uncore_init(struct drm_i915_private *dev_priv)
+void intel_uncore_init_early(struct drm_i915_private *dev_priv)
 {
-	i915_check_vgpu(dev_priv);
-
-	intel_uncore_edram_detect(dev_priv);
-	intel_uncore_fw_domains_init(dev_priv);
-	__intel_uncore_early_sanitize(dev_priv, false);
-
-	dev_priv->uncore.unclaimed_mmio_check = 1;
-	dev_priv->uncore.pmic_bus_access_nb.notifier_call =
-		i915_pmic_bus_access_notifier;
-
 	if (IS_GEN(dev_priv, 2, 4) || intel_vgpu_active(dev_priv)) {
 		ASSIGN_WRITE_MMIO_VFUNCS(dev_priv, gen2);
 		ASSIGN_READ_MMIO_VFUNCS(dev_priv, gen2);
@@ -1289,6 +1279,19 @@ void intel_uncore_init(struct drm_i915_private *dev_priv)
 		ASSIGN_WRITE_MMIO_VFUNCS(dev_priv, fwtable);
 		ASSIGN_READ_MMIO_VFUNCS(dev_priv, fwtable);
 	}
+}
+
+void intel_uncore_init_mmio(struct drm_i915_private *dev_priv)
+{
+	i915_check_vgpu(dev_priv);
+
+	intel_uncore_edram_detect(dev_priv);
+	intel_uncore_fw_domains_init(dev_priv);
+	__intel_uncore_early_sanitize(dev_priv, false);
+
+	dev_priv->uncore.unclaimed_mmio_check = 1;
+	dev_priv->uncore.pmic_bus_access_nb.notifier_call =
+		i915_pmic_bus_access_notifier;
 
 	iosf_mbi_register_pmic_bus_access_notifier(
 		&dev_priv->uncore.pmic_bus_access_nb);
diff --git a/drivers/gpu/drm/i915/intel_uncore.h b/drivers/gpu/drm/i915/intel_uncore.h
index 582771251b57..695ea5600469 100644
--- a/drivers/gpu/drm/i915/intel_uncore.h
+++ b/drivers/gpu/drm/i915/intel_uncore.h
@@ -128,7 +128,8 @@ struct intel_uncore {
 
 
 void intel_uncore_sanitize(struct drm_i915_private *dev_priv);
-void intel_uncore_init(struct drm_i915_private *dev_priv);
+void intel_uncore_init_early(struct drm_i915_private *dev_priv);
+void intel_uncore_init_mmio(struct drm_i915_private *dev_priv);
 bool intel_uncore_unclaimed_mmio(struct drm_i915_private *dev_priv);
 bool intel_uncore_arm_unclaimed_mmio_detection(struct drm_i915_private *dev_priv);
 void intel_uncore_fini(struct drm_i915_private *dev_priv);
-- 
2.14.2

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-10-09  9:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-07  8:56 [PATCH 1/2] drm/i915: Split uncore init into vfunc setup and mmio setup Chris Wilson
2017-10-07  8:56 ` [PATCH 2/2] drm/i915: Remove early invocations of i915_engines_cleanup() Chris Wilson
2017-10-09  9:24   ` Joonas Lahtinen
2017-10-07  9:19 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Split uncore init into vfunc setup and mmio setup Patchwork
2017-10-07 10:21 ` ✗ Fi.CI.IGT: failure " Patchwork
2017-10-07 11:14 ` [PATCH 1/2] " Michal Wajdeczko
2017-10-07 15:28   ` Chris Wilson
2017-10-09  9:19     ` Joonas Lahtinen
2017-10-09  9:23       ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox