[PATCH 4/5] Revert "drm/i915: create memory regions before ggtt probe"

Robert Beckett bob.beckett at collabora.com
Mon Feb 28 18:24:51 UTC 2022


This reverts commit bdcdaa12f75fc1eb7ca1be180b4db26154a0bb6d.
---
 drivers/gpu/drm/i915/i915_driver.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index 71991e2d7aba..62b3f332bbf5 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -577,17 +577,13 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
 
 	i915_perf_init(dev_priv);
 
-	ret = intel_memory_regions_hw_probe(dev_priv);
-	if (ret)
-		goto err_perf;
-
 	ret = intel_gt_assign_ggtt(to_gt(dev_priv));
 	if (ret)
-		goto err_mem_regions;
+		goto err_perf;
 
 	ret = i915_ggtt_probe_hw(dev_priv);
 	if (ret)
-		goto err_mem_regions;
+		goto err_perf;
 
 	ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, dev_priv->drm.driver);
 	if (ret)
@@ -597,6 +593,10 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
 	if (ret)
 		goto err_ggtt;
 
+	ret = intel_memory_regions_hw_probe(dev_priv);
+	if (ret)
+		goto err_ggtt;
+
 	ret = intel_gt_probe_lmem(to_gt(dev_priv));
 	if (ret)
 		goto err_mem_regions;
@@ -656,12 +656,12 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
 err_msi:
 	if (pdev->msi_enabled)
 		pci_disable_msi(pdev);
+err_mem_regions:
+	intel_memory_regions_driver_release(dev_priv);
 err_ggtt:
 	i915_ggtt_driver_release(dev_priv);
 	i915_gem_drain_freed_objects(dev_priv);
 	i915_ggtt_driver_late_release(dev_priv);
-err_mem_regions:
-	intel_memory_regions_driver_release(dev_priv);
 err_perf:
 	i915_perf_fini(dev_priv);
 	return ret;
@@ -901,10 +901,10 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	intel_modeset_driver_remove_nogem(i915);
 out_cleanup_hw:
 	i915_driver_hw_remove(i915);
+	intel_memory_regions_driver_release(i915);
 	i915_ggtt_driver_release(i915);
 	i915_gem_drain_freed_objects(i915);
 	i915_ggtt_driver_late_release(i915);
-	intel_memory_regions_driver_release(i915);
 out_cleanup_mmio:
 	i915_driver_mmio_release(i915);
 out_runtime_pm_put:
@@ -958,10 +958,10 @@ static void i915_driver_release(struct drm_device *dev)
 
 	i915_gem_driver_release(dev_priv);
 
+	intel_memory_regions_driver_release(dev_priv);
 	i915_ggtt_driver_release(dev_priv);
 	i915_gem_drain_freed_objects(dev_priv);
 	i915_ggtt_driver_late_release(dev_priv);
-	intel_memory_regions_driver_release(dev_priv);
 
 	i915_driver_mmio_release(dev_priv);
 
-- 
2.25.1



More information about the Intel-gfx-trybot mailing list