Commit 35a57ffb authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: Only init engines once

We can do this.

And now there's finally the clean split between software setup and
hardware setup I kinda wanted since multi-ring support was merged
aeons ago. It only took almost 5 years.
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Reviewed-by: default avatarDave Gordon <david.s.gordon@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 99be1dfe
...@@ -4769,6 +4769,7 @@ int ...@@ -4769,6 +4769,7 @@ int
i915_gem_init_hw(struct drm_device *dev) i915_gem_init_hw(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_engine_cs *ring;
int ret, i; int ret, i;
if (INTEL_INFO(dev)->gen < 6 && !intel_enable_gtt()) if (INTEL_INFO(dev)->gen < 6 && !intel_enable_gtt())
...@@ -4795,9 +4796,11 @@ i915_gem_init_hw(struct drm_device *dev) ...@@ -4795,9 +4796,11 @@ i915_gem_init_hw(struct drm_device *dev)
i915_gem_init_swizzling(dev); i915_gem_init_swizzling(dev);
ret = dev_priv->gt.init_rings(dev); for_each_ring(ring, dev_priv, i) {
ret = ring->init_hw(ring);
if (ret) if (ret)
return ret; return ret;
}
for (i = 0; i < NUM_L3_SLICES(dev); i++) for (i = 0; i < NUM_L3_SLICES(dev); i++)
i915_gem_l3_remap(&dev_priv->ring[RCS], i); i915_gem_l3_remap(&dev_priv->ring[RCS], i);
...@@ -4870,6 +4873,10 @@ int i915_gem_init(struct drm_device *dev) ...@@ -4870,6 +4873,10 @@ int i915_gem_init(struct drm_device *dev)
return ret; return ret;
} }
ret = dev_priv->gt.init_rings(dev);
if (ret)
return ret;
ret = i915_gem_init_hw(dev); ret = i915_gem_init_hw(dev);
if (ret == -EIO) { if (ret == -EIO) {
/* Allow ring initialisation to fail by marking the GPU as /* Allow ring initialisation to fail by marking the GPU as
......
...@@ -1387,12 +1387,6 @@ static int logical_ring_init(struct drm_device *dev, struct intel_engine_cs *rin ...@@ -1387,12 +1387,6 @@ static int logical_ring_init(struct drm_device *dev, struct intel_engine_cs *rin
if (ret) if (ret)
return ret; return ret;
if (ring->init_hw) {
ret = ring->init_hw(ring);
if (ret)
return ret;
}
ret = intel_lr_context_deferred_create(ring->default_context, ring); ret = intel_lr_context_deferred_create(ring->default_context, ring);
return ret; return ret;
......
...@@ -1859,10 +1859,6 @@ static int intel_init_ring_buffer(struct drm_device *dev, ...@@ -1859,10 +1859,6 @@ static int intel_init_ring_buffer(struct drm_device *dev,
if (ret) if (ret)
goto error; goto error;
ret = ring->init_hw(ring);
if (ret)
goto error;
return 0; return 0;
error: error:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment