drm/i915: Unify intel_logical_ring_emit and intel_ring_emit
Both perform the same actions with more or less indirection, so just unify the code. v2: Add back a few intel_engine_cs locals 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-11-git-send-email-chris@chris-wilson.co.uk Link: http://patchwork.freedesktop.org/patch/msgid/1470174640-18242-1-git-send-email-chris@chris-wilson.co.uk
此提交包含在:
@@ -288,14 +288,11 @@ static int emit_mocs_control_table(struct drm_i915_gem_request *req,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
intel_logical_ring_emit(ringbuf,
|
||||
MI_LOAD_REGISTER_IMM(GEN9_NUM_MOCS_ENTRIES));
|
||||
intel_ring_emit(ringbuf, MI_LOAD_REGISTER_IMM(GEN9_NUM_MOCS_ENTRIES));
|
||||
|
||||
for (index = 0; index < table->size; index++) {
|
||||
intel_logical_ring_emit_reg(ringbuf,
|
||||
mocs_register(engine, index));
|
||||
intel_logical_ring_emit(ringbuf,
|
||||
table->table[index].control_value);
|
||||
intel_ring_emit_reg(ringbuf, mocs_register(engine, index));
|
||||
intel_ring_emit(ringbuf, table->table[index].control_value);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -307,14 +304,12 @@ 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(engine, index));
|
||||
intel_logical_ring_emit(ringbuf,
|
||||
table->table[0].control_value);
|
||||
intel_ring_emit_reg(ringbuf, mocs_register(engine, index));
|
||||
intel_ring_emit(ringbuf, table->table[0].control_value);
|
||||
}
|
||||
|
||||
intel_logical_ring_emit(ringbuf, MI_NOOP);
|
||||
intel_logical_ring_advance(ringbuf);
|
||||
intel_ring_emit(ringbuf, MI_NOOP);
|
||||
intel_ring_advance(ringbuf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -352,19 +347,18 @@ static int emit_mocs_l3cc_table(struct drm_i915_gem_request *req,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
intel_logical_ring_emit(ringbuf,
|
||||
intel_ring_emit(ringbuf,
|
||||
MI_LOAD_REGISTER_IMM(GEN9_NUM_MOCS_ENTRIES / 2));
|
||||
|
||||
for (i = 0; i < table->size/2; i++) {
|
||||
intel_logical_ring_emit_reg(ringbuf, GEN9_LNCFCMOCS(i));
|
||||
intel_logical_ring_emit(ringbuf,
|
||||
l3cc_combine(table, 2*i, 2*i+1));
|
||||
intel_ring_emit_reg(ringbuf, GEN9_LNCFCMOCS(i));
|
||||
intel_ring_emit(ringbuf, l3cc_combine(table, 2*i, 2*i+1));
|
||||
}
|
||||
|
||||
if (table->size & 0x01) {
|
||||
/* Odd table size - 1 left over */
|
||||
intel_logical_ring_emit_reg(ringbuf, GEN9_LNCFCMOCS(i));
|
||||
intel_logical_ring_emit(ringbuf, l3cc_combine(table, 2*i, 0));
|
||||
intel_ring_emit_reg(ringbuf, GEN9_LNCFCMOCS(i));
|
||||
intel_ring_emit(ringbuf, l3cc_combine(table, 2*i, 0));
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -374,12 +368,12 @@ 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, l3cc_combine(table, 0, 0));
|
||||
intel_ring_emit_reg(ringbuf, GEN9_LNCFCMOCS(i));
|
||||
intel_ring_emit(ringbuf, l3cc_combine(table, 0, 0));
|
||||
}
|
||||
|
||||
intel_logical_ring_emit(ringbuf, MI_NOOP);
|
||||
intel_logical_ring_advance(ringbuf);
|
||||
intel_ring_emit(ringbuf, MI_NOOP);
|
||||
intel_ring_advance(ringbuf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
新增問題並參考
封鎖使用者