drm/i915: Downgrade incorrect engine constructor usage warnings to development
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Fri, 19 Jan 2018 10:00:03 +0000 (10:00 +0000)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Mon, 22 Jan 2018 17:15:20 +0000 (17:15 +0000)
Render engine constructor helpers must only be called from the render
engine constructors, but there is no need to burden the production
binaries with warnings which can only be triggered during development.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Michel Thierry <michel.thierry@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michel Thierry <michel.thierry@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180119100005.9072-1-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/intel_engine_cs.c
drivers/gpu/drm/i915/intel_lrc.c

index a1a67f689b3a24da8c15010287617044a6d5bc66..7eebfbb95e89974b450d633a4878c936a4b1c74a 100644 (file)
@@ -1394,7 +1394,8 @@ int init_workarounds_ring(struct intel_engine_cs *engine)
        struct drm_i915_private *dev_priv = engine->i915;
        int err;
 
-       WARN_ON(engine->id != RCS);
+       if (GEM_WARN_ON(engine->id != RCS))
+               return -EINVAL;
 
        dev_priv->workarounds.count = 0;
        dev_priv->workarounds.hw_whitelist_count[engine->id] = 0;
index ff25f209d0a5585915093ba6b2116c076ec4fe42..251311e41373d95810903f88db885a23006a3dc5 100644 (file)
@@ -1414,7 +1414,7 @@ static int intel_init_workaround_bb(struct intel_engine_cs *engine)
        unsigned int i;
        int ret;
 
-       if (WARN_ON(engine->id != RCS || !engine->scratch))
+       if (GEM_WARN_ON(engine->id != RCS || !engine->scratch))
                return -EINVAL;
 
        switch (INTEL_GEN(engine->i915)) {