drm/i915: Remove duplicate intel_logical_ring_workarounds_emit
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 14 Feb 2017 15:00:17 +0000 (15:00 +0000)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Wed, 15 Feb 2017 08:16:41 +0000 (08:16 +0000)
intel_ring_workarounds_emit is exactly the same code.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20170214150017.16058-1-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/i915/intel_ringbuffer.h

index f567d4b08863c94e7592813e1b25baf37c92a6d8..ee431d39ce0691c5acc09d77f81759cca15c6b30 100644 (file)
@@ -890,39 +890,6 @@ err:
        return ret;
 }
 
-static int intel_logical_ring_workarounds_emit(struct drm_i915_gem_request *req)
-{
-       struct i915_workarounds *w = &req->i915->workarounds;
-       u32 *cs;
-       int ret, i;
-
-       if (w->count == 0)
-               return 0;
-
-       ret = req->engine->emit_flush(req, EMIT_BARRIER);
-       if (ret)
-               return ret;
-
-       cs = intel_ring_begin(req, w->count * 2 + 2);
-       if (IS_ERR(cs))
-               return PTR_ERR(cs);
-
-       *cs++ = MI_LOAD_REGISTER_IMM(w->count);
-       for (i = 0; i < w->count; i++) {
-               *cs++ = i915_mmio_reg_offset(w->reg[i].addr);
-               *cs++ = w->reg[i].value;
-       }
-       *cs++ = MI_NOOP;
-
-       intel_ring_advance(req, cs);
-
-       ret = req->engine->emit_flush(req, EMIT_BARRIER);
-       if (ret)
-               return ret;
-
-       return 0;
-}
-
 #define wa_ctx_emit(batch, index, cmd)                                 \
        do {                                                            \
                int __index = (index)++;                                \
@@ -1672,7 +1639,7 @@ static int gen8_init_rcs_context(struct drm_i915_gem_request *req)
 {
        int ret;
 
-       ret = intel_logical_ring_workarounds_emit(req);
+       ret = intel_ring_workarounds_emit(req);
        if (ret)
                return ret;
 
index 95906c45289b77f3acfdc5472125c37b22985f6f..f7499829ecc230b15cfbca6c11f3ed2677dec59a 100644 (file)
@@ -644,7 +644,7 @@ static void reset_ring_common(struct intel_engine_cs *engine,
        }
 }
 
-static int intel_ring_workarounds_emit(struct drm_i915_gem_request *req)
+int intel_ring_workarounds_emit(struct drm_i915_gem_request *req)
 {
        struct i915_workarounds *w = &req->i915->workarounds;
        u32 *cs;
index 4350713dbc580de714772bcb0e0038fc9575e03d..16714096810d58578946538ac4dc41e99d3234e2 100644 (file)
@@ -560,6 +560,7 @@ static inline u32 intel_engine_last_submit(struct intel_engine_cs *engine)
 }
 
 int init_workarounds_ring(struct intel_engine_cs *engine);
+int intel_ring_workarounds_emit(struct drm_i915_gem_request *req);
 
 void intel_engine_get_instdone(struct intel_engine_cs *engine,
                               struct intel_instdone *instdone);