[1/5] drm/i915: Split i915_gem_init_hw into GT and i915 parts
diff mbox series

Message ID 20190724100716.10731-1-tvrtko.ursulin@linux.intel.com
State New
Headers show
Series
  • [1/5] drm/i915: Split i915_gem_init_hw into GT and i915 parts
Related show

Commit Message

Tvrtko Ursulin July 24, 2019, 10:07 a.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

One part of the earlier upstream refactoring got undone in the meantime.

Put it back into desirable state by restoring the split between intel_gt
and i915 initialization.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 01dd0d1d9bf6..272e008c55ef 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1193,13 +1193,12 @@  static void init_unused_rings(struct intel_gt *gt)
 	}
 }
 
-int i915_gem_init_hw(struct drm_i915_private *i915)
+static int init_hw(struct intel_gt *gt)
 {
-	struct intel_uncore *uncore = &i915->uncore;
-	struct intel_gt *gt = &i915->gt;
+	struct drm_i915_private *i915 = gt->i915;
+	struct intel_uncore *uncore = gt->uncore;
 	int ret;
 
-	BUG_ON(!i915->kernel_context);
 	ret = intel_gt_terminally_wedged(gt);
 	if (ret)
 		return ret;
@@ -1261,6 +1260,19 @@  int i915_gem_init_hw(struct drm_i915_private *i915)
 	return ret;
 }
 
+int i915_gem_init_hw(struct drm_i915_private *i915)
+{
+	int ret;
+
+	BUG_ON(!i915->kernel_context);
+
+	ret = init_hw(&i915->gt);
+
+	intel_engines_set_scheduler_caps(i915);
+
+	return ret;
+}
+
 static int __intel_engines_record_defaults(struct drm_i915_private *i915)
 {
 	struct intel_engine_cs *engine;