drm/i915: Remove vestigal i915_gem_context locals from cmdparser
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 4 Dec 2019 23:26:16 +0000 (23:26 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 5 Dec 2019 10:27:29 +0000 (10:27 +0000)
The use GEM context itself was removed in commit cd30a5031704
("drm/i915/gem: Excise the per-batch whitelist from the context"), but
the locals were left in place as an oversight. Remove the parameters and
clean up.

References: cd30a5031704 ("drm/i915/gem: Excise the per-batch whitelist from the context")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191204232616.94397-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
drivers/gpu/drm/i915/i915_cmd_parser.c
drivers/gpu/drm/i915/i915_drv.h

index 459f4d40b69bcdca17c4e054abc5aca5f498863f..34044c6203a5704a995af494419937e68b767dec 100644 (file)
@@ -2022,8 +2022,7 @@ static struct i915_vma *eb_parse(struct i915_execbuffer *eb)
 
        shadow_batch_start = gen8_canonical_addr(vma->node.start);
 
-       err = intel_engine_cmd_parser(eb->gem_context,
-                                     eb->engine,
+       err = intel_engine_cmd_parser(eb->engine,
                                      eb->batch->obj,
                                      batch_start,
                                      eb->batch_start_offset,
index 9125e89a9e7f45f7ad48874aeb91e64cc0d002dd..2ed497e7c9fd81da4ddfa7ec9dc18f73fe9da299 100644 (file)
@@ -1306,8 +1306,7 @@ static bool check_cmd(const struct intel_engine_cs *engine,
        return true;
 }
 
-static int check_bbstart(const struct i915_gem_context *ctx,
-                        u32 *cmd, u32 offset, u32 length,
+static int check_bbstart(u32 *cmd, u32 offset, u32 length,
                         u32 batch_len,
                         u64 batch_start,
                         u64 shadow_batch_start,
@@ -1392,7 +1391,6 @@ alloc_whitelist(struct drm_i915_private *i915, u32 batch_len)
 
 /**
  * i915_parse_cmds() - parse a submitted batch buffer for privilege violations
- * @ctx: the context in which the batch is to execute
  * @engine: the engine on which the batch is to execute
  * @batch_obj: the batch buffer in question
  * @batch_start: Canonical base address of batch
@@ -1408,8 +1406,7 @@ alloc_whitelist(struct drm_i915_private *i915, u32 batch_len)
  * if the batch appears legal but should use hardware parsing
  */
 
-int intel_engine_cmd_parser(struct i915_gem_context *ctx,
-                           struct intel_engine_cs *engine,
+int intel_engine_cmd_parser(struct intel_engine_cs *engine,
                            struct drm_i915_gem_object *batch_obj,
                            u64 batch_start,
                            u32 batch_start_offset,
@@ -1433,7 +1430,7 @@ int intel_engine_cmd_parser(struct i915_gem_context *ctx,
        }
 
        /* Defer failure until attempted use */
-       jump_whitelist = alloc_whitelist(ctx->i915, batch_len);
+       jump_whitelist = alloc_whitelist(engine->i915, batch_len);
 
        /*
         * We use the batch length as size because the shadow object is as
@@ -1475,7 +1472,7 @@ int intel_engine_cmd_parser(struct i915_gem_context *ctx,
                }
 
                if (desc->cmd.value == MI_BATCH_BUFFER_START) {
-                       ret = check_bbstart(ctx, cmd, offset, length,
+                       ret = check_bbstart(cmd, offset, length,
                                            batch_len, batch_start,
                                            shadow_batch_start,
                                            jump_whitelist);
index 0d4ad18e10dd7c3cde987f5636f7d67057f41e2f..c3d8af28bfc199332cc50cdd4e821a5ddc8a437d 100644 (file)
@@ -1947,8 +1947,7 @@ const char *i915_cache_level_str(struct drm_i915_private *i915, int type);
 int i915_cmd_parser_get_version(struct drm_i915_private *dev_priv);
 void intel_engine_init_cmd_parser(struct intel_engine_cs *engine);
 void intel_engine_cleanup_cmd_parser(struct intel_engine_cs *engine);
-int intel_engine_cmd_parser(struct i915_gem_context *cxt,
-                           struct intel_engine_cs *engine,
+int intel_engine_cmd_parser(struct intel_engine_cs *engine,
                            struct drm_i915_gem_object *batch_obj,
                            u64 user_batch_start,
                            u32 batch_start_offset,