drm/i915: Drop unneed i915 parameter from intel_ring_pin()
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 27 Jul 2018 15:55:01 +0000 (16:55 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 27 Jul 2018 17:22:08 +0000 (18:22 +0100)
As we now have a ring->vma available, we can just lookup our i915
pointer from inside the vm, and so not require the unsightly parameter.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180727155501.18963-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/i915/intel_ringbuffer.h

index 7879791b263bd8e99004691e2f32e8b86a242e9a..fad689efb67ad14f3e832fd3de9d2402a723c2e1 100644 (file)
@@ -1331,7 +1331,7 @@ __execlists_context_pin(struct intel_engine_cs *engine,
                goto unpin_vma;
        }
 
-       ret = intel_ring_pin(ce->ring, ctx->i915);
+       ret = intel_ring_pin(ce->ring);
        if (ret)
                goto unpin_map;
 
index b293e1dedb8e8039e6fb3678cb4982c72091ae8a..d1e03b7fbffa4d5b44bef7f8b87c8bae8f7262ce 100644 (file)
@@ -1003,10 +1003,11 @@ i915_emit_bb_start(struct i915_request *rq,
        return 0;
 }
 
-int intel_ring_pin(struct intel_ring *ring, struct drm_i915_private *i915)
+int intel_ring_pin(struct intel_ring *ring)
 {
-       enum i915_map_type map = HAS_LLC(i915) ? I915_MAP_WB : I915_MAP_WC;
        struct i915_vma *vma = ring->vma;
+       enum i915_map_type map =
+               HAS_LLC(vma->vm->i915) ? I915_MAP_WB : I915_MAP_WC;
        unsigned int flags;
        void *addr;
        int ret;
@@ -1405,7 +1406,7 @@ static int intel_init_ring_buffer(struct intel_engine_cs *engine)
                goto err;
        }
 
-       err = intel_ring_pin(ring, engine->i915);
+       err = intel_ring_pin(ring);
        if (err)
                goto err_ring;
 
index 399ec58d1f9d09b6f291eb7988b60ce2f6e5c3dd..57f3787ed6ec4014951b9f6c165b5cad046d4567 100644 (file)
@@ -797,7 +797,7 @@ struct intel_ring *
 intel_engine_create_ring(struct intel_engine_cs *engine,
                         struct i915_timeline *timeline,
                         int size);
-int intel_ring_pin(struct intel_ring *ring, struct drm_i915_private *i915);
+int intel_ring_pin(struct intel_ring *ring);
 void intel_ring_reset(struct intel_ring *ring, u32 tail);
 unsigned int intel_ring_update_space(struct intel_ring *ring);
 void intel_ring_unpin(struct intel_ring *ring);