drm/i915: Name all intel_ringbuffer instances ring
Subsystems (2)
PATCH v3 1/1 drm/i915: Name all intel_ringbuffer instances ring
From: Tvrtko Ursulin <[email protected]>
A mix of Coccinelle, sed and manual editing.
v2: Rename engine->buffer as well.
v3: Rebased.
--- drivers/gpu/drm/i915/i915_debugfs.c | 14 +- drivers/gpu/drm/i915/i915_drv.h | 4 +- drivers/gpu/drm/i915/i915_gem.c | 26 ++-- drivers/gpu/drm/i915/i915_gpu_error.c | 6 +- drivers/gpu/drm/i915/i915_guc_submission.c | 4 +- drivers/gpu/drm/i915/i915_irq.c | 12 +- drivers/gpu/drm/i915/intel_lrc.c | 239 +++++++++++++++-------------- drivers/gpu/drm/i915/intel_lrc.h | 14 +- drivers/gpu/drm/i915/intel_mocs.c | 38 ++--- drivers/gpu/drm/i915/intel_ringbuffer.c | 193 +++++++++++------------ drivers/gpu/drm/i915/intel_ringbuffer.h | 33 ++-- 11 files changed, 295 insertions(+), 288 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +7 -7
@@ -1933,11 +1933,11 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data) }static void describe_ctx_ringbuf (struct seq_file *m, -struct intel_ringbuffer *ringbuf) +struct intel_ringbuffer *ring) {seq_printf (m," (ringbuffer, space: %d, head: %u, tail: %u, last head: %d)" , - ringbuf->space, ringbuf->head, ringbuf->tail, - ringbuf->last_retired_head); + ring->space, ring->head, ring->tail, + ring->last_retired_head); }static int i915_context_status (struct seq_file *m,void *unused)
@@ -1968,14 +1968,14 @@ static int i915_context_status(struct seq_file *m, void *unused)for_each_engine (engine, dev_priv, i) {struct drm_i915_gem_object *ctx_obj = ctx->engine[i].state; -struct intel_ringbuffer *ringbuf = - ctx->engine[i].ringbuf; +struct intel_ringbuffer *ring = + ctx->engine[i].ring;seq_printf (m,"%s: " , engine->name);if (ctx_obj)describe_obj (m, ctx_obj); -if (ringbuf) -describe_ctx_ringbuf (m, ringbuf); +if (ring) +describe_ctx_ringbuf (m, ring);seq_putc (m,'\n' ); } }else {
drivers/gpu/drm/i915/i915_drv.h +2 -2
@@ -842,7 +842,7 @@ struct intel_context {/* Execlists */ struct {struct drm_i915_gem_object *state; -struct intel_ringbuffer *ringbuf; +struct intel_ringbuffer *ring;int pin_count;struct i915_vma *lrc_vma;u64 lrc_desc;
@@ -2247,7 +2247,7 @@ struct drm_i915_gem_request {* context. */ struct intel_context *ctx; -struct intel_ringbuffer *ringbuf; +struct intel_ringbuffer *ring;/** Batch buffer related to this request if any (used for error state dump only) */
drivers/gpu/drm/i915/i915_gem.c +13 -13
@@ -1423,7 +1423,7 @@ static void i915_gem_request_retire(struct drm_i915_gem_request *request)* Note this requires that we are always called in request * completion order. */ - request->ringbuf->last_retired_head = request->postfix; + request->ring->last_retired_head = request->postfix;list_del_init (&request->list);i915_gem_request_remove_from_client (request);
@@ -2544,7 +2544,7 @@ void __i915_add_request(struct drm_i915_gem_request *request, {struct intel_engine_cs *engine;struct drm_i915_private *dev_priv; -struct intel_ringbuffer *ringbuf; +struct intel_ringbuffer *ring;u32 request_start;int ret;
@@ -2553,16 +2553,16 @@ void __i915_add_request(struct drm_i915_gem_request *request, engine = request->engine; dev_priv = engine->dev->dev_private; - ringbuf = request->ringbuf; + ring = request->ring;/* * To ensure that this call will not fail, space for its emissions * should already have been reserved in the ring buffer. Let the ring * know that it is time to use that space up. */ -intel_ring_reserved_space_use (ringbuf); +intel_ring_reserved_space_use (ring); - request_start =intel_ring_get_tail (ringbuf); + request_start =intel_ring_get_tail (ring);/* * Emit any outstanding flushes - execbuf can fail to emit the flush * after having emitted the batchbuffer command. Hence we need to fix
@@ -2584,14 +2584,14 @@ void __i915_add_request(struct drm_i915_gem_request *request,* GPU processing the request, we never over-estimate the * position of the head. */ - request->postfix =intel_ring_get_tail (ringbuf); + request->postfix =intel_ring_get_tail (ring);if (i915.enable_execlists) ret = engine->emit_request (request);else { ret = engine->add_request (request); - request->tail =intel_ring_get_tail (ringbuf); + request->tail =intel_ring_get_tail (ring); }/* Not allowed to fail! */ WARN (ret,"emit|add_request failed: %d!\n" , ret);
@@ -2621,7 +2621,7 @@ void __i915_add_request(struct drm_i915_gem_request *request,intel_mark_busy (dev_priv->dev);/* Sanity check that the reserved size was large enough. */ -intel_ring_reserved_space_end (ringbuf); +intel_ring_reserved_space_end (ring); } static bool i915_context_is_banned(struct drm_i915_private *dev_priv,
@@ -2781,7 +2781,7 @@ i915_gem_request_alloc(struct intel_engine_cs *engine,void i915_gem_request_cancel (struct drm_i915_gem_request *req) { -intel_ring_reserved_space_cancel (req->ringbuf); +intel_ring_reserved_space_cancel (req->ring);i915_gem_request_unreference (req); }
@@ -2823,7 +2823,7 @@ static void i915_gem_reset_engine_status(struct drm_i915_private *dev_priv,static void i915_gem_reset_engine_cleanup (struct drm_i915_private *dev_priv,struct intel_engine_cs *engine) { -struct intel_ringbuffer *buffer; +struct intel_ringbuffer *ring;while (!list_empty (&engine->active_list)) {struct drm_i915_gem_object *obj;
@@ -2876,9 +2876,9 @@ static void i915_gem_reset_engine_cleanup(struct drm_i915_private *dev_priv,* upon reset is less than when we start. Do one more pass over * all the ringbuffers to reset last_retired_head. */ -list_for_each_entry (buffer, &engine->buffers, link) { - buffer->last_retired_head = buffer->tail; -intel_ring_update_space (buffer); +list_for_each_entry (ring, &engine->buffers, link) { + ring->last_retired_head = ring->tail; +intel_ring_update_space (ring); } }
drivers/gpu/drm/i915/i915_gpu_error.c +3 -3
@@ -1074,11 +1074,11 @@ static void i915_gem_record_rings(struct drm_device *dev,* executed). */ if (request) - rbuf = request->ctx->engine[engine->id].ringbuf; + rbuf = request->ctx->engine[engine->id].ring;else - rbuf = dev_priv->kernel_context->engine[engine->id].ringbuf; + rbuf = dev_priv->kernel_context->engine[engine->id].ring; }else - rbuf = engine->buffer; + rbuf = engine->ring; error->ring[i].cpu_ring_head = rbuf->head; error->ring[i].cpu_ring_tail = rbuf->tail;
drivers/gpu/drm/i915/i915_guc_submission.c +2 -2
@@ -415,7 +415,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 = ctx->engine[i].ringbuf->obj; + obj = ctx->engine[i].ring->obj; lrc->ring_begin =i915_gem_obj_ggtt_offset (obj); lrc->ring_end = lrc->ring_begin + obj->base.size -1 ;
@@ -550,7 +550,7 @@ static int guc_add_workqueue_item(struct i915_guc_client *gc, rq->engine);/* The GuC firmware wants the tail index in QWords, not bytes */ - tail = rq->ringbuf->tail >>3 ; + tail = rq->ring->tail >>3 ; wqi->ring_tail = tail <<WQ_RING_TAIL_SHIFT ; wqi->fence_id =0 ;/*XXX: what fence to be here */
drivers/gpu/drm/i915/i915_irq.c +6 -6
@@ -2882,7 +2882,7 @@ semaphore_waits_for(struct intel_engine_cs *engine, u32 *seqno)* Therefore, this function does not support execlist mode in its * current form. Just return NULL and move on. */ -if (engine->buffer ==NULL ) +if (engine->ring ==NULL )return NULL ; ipehr =I915_READ (RING_IPEHR (engine->mmio_base));
@@ -2906,10 +2906,10 @@ semaphore_waits_for(struct intel_engine_cs *engine, u32 *seqno)* our ring is smaller than what the hardware (and hence * HEAD_ADDR) allows. Also handles wrap-around. */ - head &= engine->buffer->size -1 ; + head &= engine->ring->size -1 ;/* This here seems to blow up */ - cmd =ioread32 (engine->buffer->virtual_start + head); + cmd =ioread32 (engine->ring->virtual_start + head);if (cmd == ipehr)break ;
@@ -2919,11 +2919,11 @@ semaphore_waits_for(struct intel_engine_cs *engine, u32 *seqno)if (!i)return NULL ; - *seqno =ioread32 (engine->buffer->virtual_start + head +4 ) +1 ; + *seqno =ioread32 (engine->ring->virtual_start + head +4 ) +1 ;if (INTEL_INFO (engine->dev)->gen >=8 ) { - offset =ioread32 (engine->buffer->virtual_start + head +12 ); + offset =ioread32 (engine->ring->virtual_start + head +12 ); offset <<=32 ; - offset =ioread32 (engine->buffer->virtual_start + head +8 ); + offset =ioread32 (engine->ring->virtual_start + head +8 ); }return semaphore_wait_to_signaller_ring (engine, ipehr, offset); }
drivers/gpu/drm/i915/intel_lrc.c +120 -119
563 lines not on this page · raw message
drivers/gpu/drm/i915/intel_lrc.h +7 -7
@@ -69,25 +69,25 @@ int logical_ring_flush_all_caches(struct drm_i915_gem_request *req);* * The tail is only updated in our logical ringbuffer struct. */ -static inline void intel_logical_ring_advance (struct intel_ringbuffer *ringbuf) +static inline void intel_logical_ring_advance (struct intel_ringbuffer *ring) { - ringbuf->tail &= ringbuf->size -1 ; + ring->tail &= ring->size -1 ; }/** * intel_logical_ring_emit() - write a DWORD to the ringbuffer. * @ringbuf: Ringbuffer to write to. * @data: DWORD to write. */ -static inline void intel_logical_ring_emit (struct intel_ringbuffer *ringbuf, +static inline void intel_logical_ring_emit (struct intel_ringbuffer *ring,u32 data) { -iowrite32 (data, ringbuf->virtual_start + ringbuf->tail); - ringbuf->tail +=4 ; +iowrite32 (data, ring->virtual_start + ring->tail); + ring->tail +=4 ; } -static inline void intel_logical_ring_emit_reg (struct intel_ringbuffer *ringbuf, +static inline void intel_logical_ring_emit_reg (struct intel_ringbuffer *ring,i915_reg_t reg) { -intel_logical_ring_emit (ringbuf,i915_mmio_reg_offset (reg)); +intel_logical_ring_emit (ring,i915_mmio_reg_offset (reg)); }/* Logical Ring Contexts */
drivers/gpu/drm/i915/intel_mocs.c +20 -18
@@ -191,9 +191,9 @@ static i915_reg_t mocs_register(enum intel_engine_id ring, int index)*/ static int emit_mocs_control_table (struct drm_i915_gem_request *req,const struct drm_i915_mocs_table *table, -enum intel_engine_id ring) +enum intel_engine_id engine_id) { -struct intel_ringbuffer *ringbuf = req->ringbuf; +struct intel_ringbuffer *ring = req->ring;unsigned int index;int ret;
@@ -206,12 +206,13 @@ static int emit_mocs_control_table(struct drm_i915_gem_request *req,return ret; } -intel_logical_ring_emit (ringbuf, +intel_logical_ring_emit (ring,MI_LOAD_REGISTER_IMM (GEN9_NUM_MOCS_ENTRIES ));for (index =0 ; index < table->size; index++) { -intel_logical_ring_emit_reg (ringbuf,mocs_register (ring, index)); -intel_logical_ring_emit (ringbuf, +intel_logical_ring_emit_reg (ring, +mocs_register (engine_id, index)); +intel_logical_ring_emit (ring, table->table[index].control_value); }
@@ -224,12 +225,13 @@ static int emit_mocs_control_table(struct drm_i915_gem_request *req,* that value to all the used entries. */ for (; index <GEN9_NUM_MOCS_ENTRIES ; index++) { -intel_logical_ring_emit_reg (ringbuf,mocs_register (ring, index)); -intel_logical_ring_emit (ringbuf, table->table[0 ].control_value); +intel_logical_ring_emit_reg (ring, +mocs_register (engine_id, index)); +intel_logical_ring_emit (ring, table->table[0 ].control_value); } -intel_logical_ring_emit (ringbuf,MI_NOOP ); -intel_logical_ring_advance (ringbuf); +intel_logical_ring_emit (ring,MI_NOOP ); +intel_logical_ring_advance (ring);return 0 ; }
@@ -248,7 +250,7 @@ static int emit_mocs_control_table(struct drm_i915_gem_request *req,static int emit_mocs_l3cc_table (struct drm_i915_gem_request *req,const struct drm_i915_mocs_table *table) { -struct intel_ringbuffer *ringbuf = req->ringbuf; +struct intel_ringbuffer *ring = req->ring;unsigned int count;unsigned int i;u32 value;
@@ -265,15 +267,15 @@ static int emit_mocs_l3cc_table(struct drm_i915_gem_request *req,return ret; } -intel_logical_ring_emit (ringbuf, -MI_LOAD_REGISTER_IMM (GEN9_NUM_MOCS_ENTRIES /2 )); +intel_logical_ring_emit (ring, +MI_LOAD_REGISTER_IMM (GEN9_NUM_MOCS_ENTRIES /2 ));for (i =0 , count =0 ; i < table->size /2 ; i++, count +=2 ) { value = (table->table[count].l3cc_value &0xffff ) | ((table->table[count +1 ].l3cc_value &0xffff ) <<16 ); -intel_logical_ring_emit_reg (ringbuf,GEN9_LNCFCMOCS (i)); -intel_logical_ring_emit (ringbuf, value); +intel_logical_ring_emit_reg (ring,GEN9_LNCFCMOCS (i)); +intel_logical_ring_emit (ring, value); }if (table->size &0x01 ) {
@@ -289,14 +291,14 @@ static int emit_mocs_l3cc_table(struct drm_i915_gem_request *req,* they are reserved by the hardware. */ for (; i <GEN9_NUM_MOCS_ENTRIES /2 ; i++) { -intel_logical_ring_emit_reg (ringbuf,GEN9_LNCFCMOCS (i)); -intel_logical_ring_emit (ringbuf, value); +intel_logical_ring_emit_reg (ring,GEN9_LNCFCMOCS (i)); +intel_logical_ring_emit (ring, value); value = filler; } -intel_logical_ring_emit (ringbuf,MI_NOOP ); -intel_logical_ring_advance (ringbuf); +intel_logical_ring_emit (ring,MI_NOOP ); +intel_logical_ring_advance (ring);return 0 ; }
drivers/gpu/drm/i915/intel_ringbuffer.c +98 -95
419 lines not on this page · raw message
drivers/gpu/drm/i915/intel_ringbuffer.h +17 -16
@@ -159,7 +159,7 @@ struct intel_engine_cs {unsigned int guc_id;u32 mmio_base;struct drm_device *dev; -struct intel_ringbuffer *buffer; +struct intel_ringbuffer *ring;struct list_head buffers;/*
@@ -434,8 +434,8 @@ intel_write_status_page(struct intel_engine_cs *engine,struct intel_ringbuffer *intel_engine_create_ringbuffer (struct intel_engine_cs *engine,int size);int intel_pin_and_map_ringbuffer_obj (struct drm_device *dev, -struct intel_ringbuffer *ringbuf); -void intel_unpin_ringbuffer_obj (struct intel_ringbuffer *ringbuf); +struct intel_ringbuffer *ring); +void intel_unpin_ringbuffer_obj (struct intel_ringbuffer *ring);void intel_ringbuffer_free (struct intel_ringbuffer *ring);void intel_stop_engine (struct intel_engine_cs *engine);
@@ -448,9 +448,9 @@ int __must_check intel_ring_cacheline_align(struct drm_i915_gem_request *req);static inline void intel_ring_emit (struct intel_engine_cs *engine,u32 data) { -struct intel_ringbuffer *ringbuf = engine->buffer; -iowrite32 (data, ringbuf->virtual_start + ringbuf->tail); - ringbuf->tail +=4 ; +struct intel_ringbuffer *ring = engine->ring; +iowrite32 (data, ring->virtual_start + ring->tail); + ring->tail +=4 ; }static inline void intel_ring_emit_reg (struct intel_engine_cs *engine,i915_reg_t reg)
@@ -459,12 +459,12 @@ static inline void intel_ring_emit_reg(struct intel_engine_cs *engine, }static inline void intel_ring_advance (struct intel_engine_cs *engine) { -struct intel_ringbuffer *ringbuf = engine->buffer; - ringbuf->tail &= ringbuf->size -1 ; +struct intel_ringbuffer *ring = engine->ring; + ring->tail &= ring->size -1 ; }int __intel_ring_space (int head,int tail,int size); -void intel_ring_update_space (struct intel_ringbuffer *ringbuf); -int intel_ring_space (struct intel_ringbuffer *ringbuf); +void intel_ring_update_space (struct intel_ringbuffer *ring); +int intel_ring_space (struct intel_ringbuffer *ring);bool intel_engine_stopped (struct intel_engine_cs *engine);int __must_check intel_engine_idle (struct intel_engine_cs *engine);
@@ -485,9 +485,9 @@ u64 intel_ring_get_active_head(struct intel_engine_cs *engine);int init_workarounds_ring (struct intel_engine_cs *engine); -static inline u32 intel_ring_get_tail (struct intel_ringbuffer *ringbuf) +static inline u32 intel_ring_get_tail (struct intel_ringbuffer *ring) { -return ringbuf->tail; +return ring->tail; }/*
@@ -504,13 +504,14 @@ static inline u32 intel_ring_get_tail(struct intel_ringbuffer *ringbuf)* will always have sufficient room to do its stuff. The request creation * code calls this automatically. */ -void intel_ring_reserved_space_reserve (struct intel_ringbuffer *ringbuf,int size); +void intel_ring_reserved_space_reserve (struct intel_ringbuffer *ring, +int size);/* Cancel the reservation, e.g. because the request is being discarded. */ -void intel_ring_reserved_space_cancel (struct intel_ringbuffer *ringbuf); +void intel_ring_reserved_space_cancel (struct intel_ringbuffer *ring);/* Use the reserved space - for use by i915_add_request() only. */ -void intel_ring_reserved_space_use (struct intel_ringbuffer *ringbuf); +void intel_ring_reserved_space_use (struct intel_ringbuffer *ring);/* Finish with the reserved space - for use by i915_add_request() only. */ -void intel_ring_reserved_space_end (struct intel_ringbuffer *ringbuf); +void intel_ring_reserved_space_end (struct intel_ringbuffer *ring);/* Legacy ringbuffer specific portion of reservation code: */ int intel_ring_reserve_space (struct drm_i915_gem_request *request);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
drivers/gpu/drm/i915/intel_ringbuffer.h struct intel_engine_cs { · line 163
Quoted 11 lines · Tvrtko Ursulin
drivers/gpu/drm/i915/intel_ringbuffer.h +1
-1@@ -159,7 +159,7 @@ struct intel_engine_cs {unsigned int guc_id;u32 mmio_base;struct drm_device *dev; -struct intel_ringbuffer *buffer; +struct intel_ringbuffer *ring;struct list_head buffers;
I was thinking this should be legacy_ring for distinctness. It only actually gets referred to in a few places so shouldn't be too much of a nuisance (and mostly it is via local intel_ring).
I did this in a few more steps trying to merge code as I went, but this should reduce the churn I have in a nice mechanical fashion, so from that perspective:
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915: Name all intel_ringbuffer instances ring
In reply to Tvrtko Ursulin== Series Details ==
== Series Details ==
Series: drm/i915: Name all intel_ringbuffer instances ring
URL : https://patchwork.freedesktop.org/series/4595/
State : failure
== Summary ==
Series 4595v1 drm/i915: Name all intel_ringbuffer instances ring
http://patchwork.freedesktop.org/api/1.0/series/4595/revisions/1/mbox/
Test gem_ringfill:
Subgroup basic-default-s3:
dmesg-warn -> PASS (skl-nuci5)
Test gem_storedw_loop:
Subgroup basic-default:
dmesg-warn -> PASS (skl-nuci5)
Test gem_sync:
Subgroup basic-vebox:
dmesg-warn -> PASS (skl-nuci5)
Test kms_flip:
Subgroup basic-flip-vs-wf_vblank:
pass -> DMESG-WARN (hsw-gt2)
Test kms_frontbuffer_tracking:
Subgroup basic:
dmesg-warn -> PASS (hsw-gt2)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-c:
dmesg-warn -> PASS (bsw-nuc-2)bdw-ultra total:194 pass:172 dwarn:1 dfail:0 fail:0 skip:21 bsw-nuc-2 total:194 pass:156 dwarn:1 dfail:0 fail:0 skip:37 byt-nuc total:194 pass:155 dwarn:4 dfail:0 fail:0 skip:35 hsw-brixbox total:194 pass:171 dwarn:1 dfail:0 fail:0 skip:22 hsw-gt2 total:194 pass:174 dwarn:3 dfail:0 fail:0 skip:17 ivb-t430s total:194 pass:168 dwarn:1 dfail:0 fail:0 skip:25 skl-i5k-2 total:194 pass:170 dwarn:1 dfail:0 fail:0 skip:23 skl-i7k-2 total:194 pass:170 dwarn:1 dfail:0 fail:0 skip:23 skl-nuci5 total:194 pass:182 dwarn:1 dfail:0 fail:0 skip:11
Results at /archive/results/CI_IGT_test/Patchwork_1638/
10e913a48ca36790da9b58bed8729598ea79ebdb drm-intel-nightly: 2016y-03m-17d-13h-22m-41s UTC integration manifest 80f938bad14dbde1cd0b01836881ae875bc5da88 drm/i915: Name all intel_ringbuffer instances ring
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx