drm/i915: Rename intel_context[engine].ringbuf
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 2 Aug 2016 21:50:20 +0000 (22:50 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 2 Aug 2016 21:58:15 +0000 (22:58 +0100)
Perform s/ringbuf/ring/ on the context struct for consistency with the
ring/engine split.

v2: Kill an outdated error_ringbuf label

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1469432687-22756-14-git-send-email-chris@chris-wilson.co.uk
Link: http://patchwork.freedesktop.org/patch/msgid/1470174640-18242-3-git-send-email-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem_context.c
drivers/gpu/drm/i915/i915_guc_submission.c
drivers/gpu/drm/i915/intel_lrc.c

index 7c42ec4612ab9bc312ec018ba15b5325a2df6b78..b67fb4c26178fd012907c15b77a140ddbfb7b018 100644 (file)
@@ -425,8 +425,8 @@ static int per_file_ctx_stats(int id, void *ptr, void *data)
        for (n = 0; n < ARRAY_SIZE(ctx->engine); n++) {
                if (ctx->engine[n].state)
                        per_file_stats(0, ctx->engine[n].state, data);
-               if (ctx->engine[n].ringbuf)
-                       per_file_stats(0, ctx->engine[n].ringbuf->obj, data);
+               if (ctx->engine[n].ring)
+                       per_file_stats(0, ctx->engine[n].ring->obj, data);
        }
 
        return 0;
@@ -2085,8 +2085,8 @@ static int i915_context_status(struct seq_file *m, void *unused)
                        seq_putc(m, ce->initialised ? 'I' : 'i');
                        if (ce->state)
                                describe_obj(m, ce->state);
-                       if (ce->ringbuf)
-                               describe_ctx_ringbuf(m, ce->ringbuf);
+                       if (ce->ring)
+                               describe_ctx_ringbuf(m, ce->ring);
                        seq_putc(m, '\n');
                }
 
index 65ada5d2f88c2ab511fff0deacfda43c6517670b..db43ced6f5e607f9e3a166fa8b1a8a32e85978c6 100644 (file)
@@ -894,7 +894,7 @@ struct i915_gem_context {
 
        struct intel_context {
                struct drm_i915_gem_object *state;
-               struct intel_ringbuffer *ringbuf;
+               struct intel_ringbuffer *ring;
                struct i915_vma *lrc_vma;
                uint32_t *lrc_reg_state;
                u64 lrc_desc;
index f7f4a8c40afea852688ec92028385d6868551607..f825b1e4aadf412ebdf0e2070fbf5027bcf636dc 100644 (file)
@@ -173,8 +173,8 @@ void i915_gem_context_free(struct kref *ctx_ref)
                        continue;
 
                WARN_ON(ce->pin_count);
-               if (ce->ringbuf)
-                       intel_ringbuffer_free(ce->ringbuf);
+               if (ce->ring)
+                       intel_ringbuffer_free(ce->ring);
 
                i915_gem_object_put(ce->state);
        }
index 01c1c16718111058411f9499c385dc340a062b47..eccd34832fe67d642124bdeff14d63f3880cf916 100644 (file)
@@ -363,7 +363,7 @@ static void guc_init_ctx_desc(struct intel_guc *guc,
                lrc->context_id = (client->ctx_index << GUC_ELC_CTXID_OFFSET) |
                                (engine->guc_id << GUC_ELC_ENGINE_OFFSET);
 
-               obj = ce->ringbuf->obj;
+               obj = ce->ring->obj;
                gfx_addr = i915_gem_obj_ggtt_offset(obj);
 
                lrc->ring_begin = gfx_addr;
index 041868c1ee9e3ce75f487e1417a9d0b85c0d4a66..5dce6fa5179aea16e3d1c7ea39b954ad61e0856d 100644 (file)
@@ -482,11 +482,8 @@ static void execlists_context_unqueue(struct intel_engine_cs *engine)
                 * resubmit the request. See gen8_emit_request() for where we
                 * prepare the padding after the end of the request.
                 */
-               struct intel_ringbuffer *ringbuf;
-
-               ringbuf = req0->ctx->engine[engine->id].ringbuf;
                req0->tail += 8;
-               req0->tail &= ringbuf->size - 1;
+               req0->tail &= req0->ring->size - 1;
        }
 
        execlists_submit_requests(req0, req1);
@@ -714,7 +711,7 @@ int intel_logical_ring_alloc_request_extras(struct drm_i915_gem_request *request
                        return ret;
        }
 
-       request->ring = ce->ringbuf;
+       request->ring = ce->ring;
 
        if (i915.enable_guc_submission) {
                /*
@@ -976,14 +973,14 @@ static int intel_lr_context_pin(struct i915_gem_context *ctx,
 
        lrc_reg_state = vaddr + LRC_STATE_PN * PAGE_SIZE;
 
-       ret = intel_pin_and_map_ringbuffer_obj(dev_priv, ce->ringbuf);
+       ret = intel_pin_and_map_ringbuffer_obj(dev_priv, ce->ring);
        if (ret)
                goto unpin_map;
 
        ce->lrc_vma = i915_gem_obj_to_ggtt(ce->state);
        intel_lr_context_descriptor_update(ctx, engine);
 
-       lrc_reg_state[CTX_RING_BUFFER_START+1] = ce->ringbuf->vma->node.start;
+       lrc_reg_state[CTX_RING_BUFFER_START+1] = ce->ring->vma->node.start;
        ce->lrc_reg_state = lrc_reg_state;
        ce->state->dirty = true;
 
@@ -1014,7 +1011,7 @@ void intel_lr_context_unpin(struct i915_gem_context *ctx,
        if (--ce->pin_count)
                return;
 
-       intel_unpin_ringbuffer_obj(ce->ringbuf);
+       intel_unpin_ringbuffer_obj(ce->ring);
 
        i915_gem_object_unpin_map(ce->state);
        i915_gem_object_ggtt_unpin(ce->state);
@@ -2346,7 +2343,7 @@ static int execlists_context_deferred_alloc(struct i915_gem_context *ctx,
        struct drm_i915_gem_object *ctx_obj;
        struct intel_context *ce = &ctx->engine[engine->id];
        uint32_t context_size;
-       struct intel_ringbuffer *ringbuf;
+       struct intel_ringbuffer *ring;
        int ret;
 
        WARN_ON(ce->state);
@@ -2362,29 +2359,29 @@ static int execlists_context_deferred_alloc(struct i915_gem_context *ctx,
                return PTR_ERR(ctx_obj);
        }
 
-       ringbuf = intel_engine_create_ringbuffer(engine, ctx->ring_size);
-       if (IS_ERR(ringbuf)) {
-               ret = PTR_ERR(ringbuf);
+       ring = intel_engine_create_ringbuffer(engine, ctx->ring_size);
+       if (IS_ERR(ring)) {
+               ret = PTR_ERR(ring);
                goto error_deref_obj;
        }
 
-       ret = populate_lr_context(ctx, ctx_obj, engine, ringbuf);
+       ret = populate_lr_context(ctx, ctx_obj, engine, ring);
        if (ret) {
                DRM_DEBUG_DRIVER("Failed to populate LRC: %d\n", ret);
-               goto error_ringbuf;
+               goto error_ring_free;
        }
 
-       ce->ringbuf = ringbuf;
+       ce->ring = ring;
        ce->state = ctx_obj;
        ce->initialised = engine->init_context == NULL;
 
        return 0;
 
-error_ringbuf:
-       intel_ringbuffer_free(ringbuf);
+error_ring_free:
+       intel_ringbuffer_free(ring);
 error_deref_obj:
        i915_gem_object_put(ctx_obj);
-       ce->ringbuf = NULL;
+       ce->ring = NULL;
        ce->state = NULL;
        return ret;
 }
@@ -2415,7 +2412,7 @@ void intel_lr_context_reset(struct drm_i915_private *dev_priv,
 
                i915_gem_object_unpin_map(ctx_obj);
 
-               ce->ringbuf->head = 0;
-               ce->ringbuf->tail = 0;
+               ce->ring->head = 0;
+               ce->ring->tail = 0;
        }
 }