drm/i915: Remove useless error return from intel_init_mocs_engine()
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 15 Aug 2018 18:42:51 +0000 (19:42 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 15 Aug 2018 22:25:43 +0000 (23:25 +0100)
As the only error is for a programming error in constructing the static
tables describing the register values, replace the error code
propagation with an assert.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180815184251.5850-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_mocs.c
drivers/gpu/drm/i915/intel_mocs.h

index 3f90c74..841895c 100644 (file)
@@ -1769,11 +1769,7 @@ static bool unexpected_starting_state(struct intel_engine_cs *engine)
 
 static int gen8_init_common_ring(struct intel_engine_cs *engine)
 {
-       int ret;
-
-       ret = intel_mocs_init_engine(engine);
-       if (ret)
-               return ret;
+       intel_mocs_init_engine(engine);
 
        intel_engine_reset_breadcrumbs(engine);
 
index 9f0bd6a..77e9871 100644 (file)
@@ -232,20 +232,17 @@ static i915_reg_t mocs_register(enum intel_engine_id engine_id, int index)
  *
  * This function simply emits a MI_LOAD_REGISTER_IMM command for the
  * given table starting at the given address.
- *
- * Return: 0 on success, otherwise the error status.
  */
-int intel_mocs_init_engine(struct intel_engine_cs *engine)
+void intel_mocs_init_engine(struct intel_engine_cs *engine)
 {
        struct drm_i915_private *dev_priv = engine->i915;
        struct drm_i915_mocs_table table;
        unsigned int index;
 
        if (!get_mocs_settings(dev_priv, &table))
-               return 0;
+               return;
 
-       if (WARN_ON(table.size > GEN9_NUM_MOCS_ENTRIES))
-               return -ENODEV;
+       GEM_BUG_ON(table.size > GEN9_NUM_MOCS_ENTRIES);
 
        for (index = 0; index < table.size; index++)
                I915_WRITE(mocs_register(engine->id, index),
@@ -262,8 +259,6 @@ int intel_mocs_init_engine(struct intel_engine_cs *engine)
        for (; index < GEN9_NUM_MOCS_ENTRIES; index++)
                I915_WRITE(mocs_register(engine->id, index),
                           table.table[0].control_value);
-
-       return 0;
 }
 
 /**
index d1751f9..d89080d 100644 (file)
@@ -54,6 +54,6 @@
 
 int intel_rcs_context_init_mocs(struct i915_request *rq);
 void intel_mocs_init_l3cc_table(struct drm_i915_private *dev_priv);
-int intel_mocs_init_engine(struct intel_engine_cs *engine);
+void intel_mocs_init_engine(struct intel_engine_cs *engine);
 
 #endif