Commit 5f9be054 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Bail if we do not setup the RCS engine

In places, we assume that RCS exists. This has been true forever, but
let us catch this failure during bringup by adding an explicit check
that we do have an RCS engine.

v2: Make use of HAS_ENGINE (Tvrtko)
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170411165658.23828-1-chris@chris-wilson.co.uk
parent 27dbefb9
...@@ -153,10 +153,10 @@ intel_engine_setup(struct drm_i915_private *dev_priv, ...@@ -153,10 +153,10 @@ intel_engine_setup(struct drm_i915_private *dev_priv,
int intel_engines_init_early(struct drm_i915_private *dev_priv) int intel_engines_init_early(struct drm_i915_private *dev_priv)
{ {
struct intel_device_info *device_info = mkwrite_device_info(dev_priv); struct intel_device_info *device_info = mkwrite_device_info(dev_priv);
unsigned int ring_mask = INTEL_INFO(dev_priv)->ring_mask; const unsigned int ring_mask = INTEL_INFO(dev_priv)->ring_mask;
unsigned int mask = 0;
struct intel_engine_cs *engine; struct intel_engine_cs *engine;
enum intel_engine_id id; enum intel_engine_id id;
unsigned int mask = 0;
unsigned int i; unsigned int i;
int err; int err;
...@@ -183,6 +183,12 @@ int intel_engines_init_early(struct drm_i915_private *dev_priv) ...@@ -183,6 +183,12 @@ int intel_engines_init_early(struct drm_i915_private *dev_priv)
if (WARN_ON(mask != ring_mask)) if (WARN_ON(mask != ring_mask))
device_info->ring_mask = mask; device_info->ring_mask = mask;
/* We always presume we have at least RCS available for later probing */
if (WARN_ON(!HAS_ENGINE(dev_priv, RCS))) {
err = -ENODEV;
goto cleanup;
}
device_info->num_rings = hweight32(mask); device_info->num_rings = hweight32(mask);
return 0; return 0;
......
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