for (uint32_t i = 0; i < IR3_MAX_SO_BUFFERS; i++) {
/* note: FLUSH_BASE is always the same, so it could go in init_hw()? */
tu_cs_emit_pkt4(cs, REG_A6XX_VPC_SO_FLUSH_BASE(i), 2);
- tu_cs_emit_qw(cs, global_iova(cmd, flush_base[i]));
+ tu_cs_emit_qw(cs, global_iova_arr(cmd, flush_base, i));
tu6_emit_event_write(cmd, cs, FLUSH_SO_0 + i);
}
0x40000 | /* ??? */
CP_MEM_TO_REG_0_UNK31 |
CP_MEM_TO_REG_0_CNT(1));
- tu_cs_emit_qw(cs, global_iova(cmd, flush_base[idx]));
+ tu_cs_emit_qw(cs, global_iova_arr(cmd, flush_base, idx));
if (offset) {
tu_cs_emit_pkt7(cs, CP_REG_RMW, 3);
for (uint32_t i = 0; i < 3; i++) {
tu_cs_emit_pkt7(cs, CP_MEM_TO_MEM, 5);
tu_cs_emit(cs, 0);
- tu_cs_emit_qw(cs, global_iova(cmd, cs_indirect_xyz[i]));
+ tu_cs_emit_qw(cs, global_iova_arr(cmd, cs_indirect_xyz, i));
tu_cs_emit_qw(cs, indirect_iova + i * 4);
}
#define occlusion_query_iova(pool, query, field) \
query_iova(struct occlusion_query_slot, pool, query, field)
-#define pipeline_stat_query_iova(pool, query, field) \
- pool->bo->iova + pool->stride * (query) + \
- offsetof(struct pipeline_stat_query_slot, field)
+#define pipeline_stat_query_iova(pool, query, field, idx) \
+ pool->bo->iova + pool->stride * (query) + \
+ offsetof_arr(struct pipeline_stat_query_slot, field, (idx))
-#define primitive_query_iova(pool, query, field, i) \
- query_iova(struct primitive_query_slot, pool, query, field) + \
- offsetof(struct primitive_slot_value, values[i])
+#define primitive_query_iova(pool, query, field, stream_id, i) \
+ query_iova(struct primitive_query_slot, pool, query, field) + \
+ sizeof_field(struct primitive_query_slot, field[0]) * (stream_id) + \
+ offsetof_arr(struct primitive_slot_value, values, (i))
#define perf_query_iova(pool, query, field, i) \
pool->bo->iova + pool->stride * (query) + \
uint32_t query)
{
struct tu_cs *cs = cmdbuf->state.pass ? &cmdbuf->draw_cs : &cmdbuf->cs;
- uint64_t begin_iova = pipeline_stat_query_iova(pool, query, begin);
+ uint64_t begin_iova = pipeline_stat_query_iova(pool, query, begin, 0);
if (is_pipeline_query_with_vertex_stage(pool->pipeline_statistics)) {
bool need_cond_exec = cmdbuf->state.pass && cmdbuf->state.prim_counters_running;
uint32_t stream_id)
{
struct tu_cs *cs = cmdbuf->state.pass ? &cmdbuf->draw_cs : &cmdbuf->cs;
- uint64_t begin_iova = primitive_query_iova(pool, query, begin[0], 0);
+ uint64_t begin_iova = primitive_query_iova(pool, query, begin, 0, 0);
tu_cs_emit_regs(cs, A6XX_VPC_SO_STREAM_COUNTS(.qword = begin_iova));
tu6_emit_event_write(cmdbuf, cs, WRITE_PRIMITIVE_COUNTS);
uint32_t query)
{
struct tu_cs *cs = cmdbuf->state.pass ? &cmdbuf->draw_cs : &cmdbuf->cs;
- uint64_t end_iova = pipeline_stat_query_iova(pool, query, end);
+ uint64_t end_iova = pipeline_stat_query_iova(pool, query, end, 0);
uint64_t available_iova = query_available_iova(pool, query);
uint64_t result_iova;
uint64_t stat_start_iova;
for (int i = 0; i < STAT_COUNT; i++) {
result_iova = query_result_iova(pool, query, uint64_t, i);
- stat_start_iova = pipeline_stat_query_iova(pool, query, begin[i]);
- stat_stop_iova = pipeline_stat_query_iova(pool, query, end[i]);
+ stat_start_iova = pipeline_stat_query_iova(pool, query, begin, i);
+ stat_stop_iova = pipeline_stat_query_iova(pool, query, end, i);
tu_cs_emit_pkt7(cs, CP_MEM_TO_MEM, 9);
tu_cs_emit(cs, CP_MEM_TO_MEM_0_WAIT_FOR_MEM_WRITES |
{
struct tu_cs *cs = cmdbuf->state.pass ? &cmdbuf->draw_cs : &cmdbuf->cs;
- uint64_t end_iova = primitive_query_iova(pool, query, end[0], 0);
+ uint64_t end_iova = primitive_query_iova(pool, query, end, 0, 0);
uint64_t result_written_iova = query_result_iova(pool, query, uint64_t, 0);
uint64_t result_generated_iova = query_result_iova(pool, query, uint64_t, 1);
- uint64_t begin_written_iova = primitive_query_iova(pool, query, begin[stream_id], 0);
- uint64_t begin_generated_iova = primitive_query_iova(pool, query, begin[stream_id], 1);
- uint64_t end_written_iova = primitive_query_iova(pool, query, end[stream_id], 0);
- uint64_t end_generated_iova = primitive_query_iova(pool, query, end[stream_id], 1);
+ uint64_t begin_written_iova = primitive_query_iova(pool, query, begin, stream_id, 0);
+ uint64_t begin_generated_iova = primitive_query_iova(pool, query, begin, stream_id, 1);
+ uint64_t end_written_iova = primitive_query_iova(pool, query, end, stream_id, 0);
+ uint64_t end_generated_iova = primitive_query_iova(pool, query, end, stream_id, 1);
uint64_t available_iova = query_available_iova(pool, query);
tu_cs_emit_regs(cs, A6XX_VPC_SO_STREAM_COUNTS(.qword = end_iova));