Lines Matching refs:iter
67 static void etnaviv_core_dump_header(struct core_dump_iterator *iter, in etnaviv_core_dump_header() argument
70 struct etnaviv_dump_object_header *hdr = iter->hdr; in etnaviv_core_dump_header()
74 hdr->file_offset = cpu_to_le32(iter->data - iter->start); in etnaviv_core_dump_header()
75 hdr->file_size = cpu_to_le32(data_end - iter->data); in etnaviv_core_dump_header()
77 iter->hdr++; in etnaviv_core_dump_header()
78 iter->data += le32_to_cpu(hdr->file_size); in etnaviv_core_dump_header()
81 static void etnaviv_core_dump_registers(struct core_dump_iterator *iter, in etnaviv_core_dump_registers() argument
84 struct etnaviv_dump_registers *reg = iter->data; in etnaviv_core_dump_registers()
92 etnaviv_core_dump_header(iter, ETDUMP_BUF_REG, reg); in etnaviv_core_dump_registers()
95 static void etnaviv_core_dump_mmu(struct core_dump_iterator *iter, in etnaviv_core_dump_mmu() argument
98 etnaviv_iommu_dump(mmu, iter->data); in etnaviv_core_dump_mmu()
100 etnaviv_core_dump_header(iter, ETDUMP_BUF_MMU, iter->data + mmu_size); in etnaviv_core_dump_mmu()
103 static void etnaviv_core_dump_mem(struct core_dump_iterator *iter, u32 type, in etnaviv_core_dump_mem() argument
106 memcpy(iter->data, ptr, size); in etnaviv_core_dump_mem()
108 iter->hdr->iova = cpu_to_le64(iova); in etnaviv_core_dump_mem()
110 etnaviv_core_dump_header(iter, type, iter->data + size); in etnaviv_core_dump_mem()
116 struct core_dump_iterator iter; in etnaviv_core_dump() local
154 file_size += sizeof(*iter.hdr) * n_obj; in etnaviv_core_dump()
157 iter.start = __vmalloc(file_size, GFP_KERNEL | __GFP_NOWARN | in etnaviv_core_dump()
159 if (!iter.start) { in etnaviv_core_dump()
166 iter.hdr = iter.start; in etnaviv_core_dump()
167 iter.data = &iter.hdr[n_obj]; in etnaviv_core_dump()
169 memset(iter.hdr, 0, iter.data - iter.start); in etnaviv_core_dump()
171 etnaviv_core_dump_registers(&iter, gpu); in etnaviv_core_dump()
172 etnaviv_core_dump_mmu(&iter, submit->mmu_context, mmu_size); in etnaviv_core_dump()
173 etnaviv_core_dump_mem(&iter, ETDUMP_BUF_RING, gpu->buffer.vaddr, in etnaviv_core_dump()
178 etnaviv_core_dump_mem(&iter, ETDUMP_BUF_CMD, in etnaviv_core_dump()
187 bomap_start = bomap = iter.data; in etnaviv_core_dump()
189 etnaviv_core_dump_header(&iter, ETDUMP_BUF_BOMAP, in etnaviv_core_dump()
210 iter.hdr->data[0] = cpu_to_le32((bomap - bomap_start)); in etnaviv_core_dump()
216 iter.hdr->iova = cpu_to_le64(vram->iova); in etnaviv_core_dump()
220 memcpy(iter.data, vaddr, obj->base.size); in etnaviv_core_dump()
222 etnaviv_core_dump_header(&iter, ETDUMP_BUF_BO, iter.data + in etnaviv_core_dump()
226 etnaviv_core_dump_header(&iter, ETDUMP_BUF_END, iter.data); in etnaviv_core_dump()
228 dev_coredumpv(gpu->dev, iter.start, iter.data - iter.start, GFP_KERNEL); in etnaviv_core_dump()