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()
97 etnaviv_core_dump_header(iter, ETDUMP_BUF_REG, reg); in etnaviv_core_dump_registers()
100 static void etnaviv_core_dump_mmu(struct core_dump_iterator *iter, in etnaviv_core_dump_mmu() argument
103 etnaviv_iommu_dump(mmu, iter->data); in etnaviv_core_dump_mmu()
105 etnaviv_core_dump_header(iter, ETDUMP_BUF_MMU, iter->data + mmu_size); in etnaviv_core_dump_mmu()
108 static void etnaviv_core_dump_mem(struct core_dump_iterator *iter, u32 type, in etnaviv_core_dump_mem() argument
111 memcpy(iter->data, ptr, size); in etnaviv_core_dump_mem()
113 iter->hdr->iova = cpu_to_le64(iova); in etnaviv_core_dump_mem()
115 etnaviv_core_dump_header(iter, type, iter->data + size); in etnaviv_core_dump_mem()
121 struct core_dump_iterator iter; in etnaviv_core_dump() local
159 file_size += sizeof(*iter.hdr) * n_obj; in etnaviv_core_dump()
162 iter.start = __vmalloc(file_size, GFP_NOWAIT); in etnaviv_core_dump()
163 if (!iter.start) { in etnaviv_core_dump()
170 iter.hdr = iter.start; in etnaviv_core_dump()
171 iter.data = &iter.hdr[n_obj]; in etnaviv_core_dump()
173 memset(iter.hdr, 0, iter.data - iter.start); in etnaviv_core_dump()
175 etnaviv_core_dump_registers(&iter, gpu); in etnaviv_core_dump()
176 etnaviv_core_dump_mmu(&iter, submit->mmu_context, mmu_size); in etnaviv_core_dump()
177 etnaviv_core_dump_mem(&iter, ETDUMP_BUF_RING, gpu->buffer.vaddr, in etnaviv_core_dump()
182 etnaviv_core_dump_mem(&iter, ETDUMP_BUF_CMD, in etnaviv_core_dump()
191 bomap_start = bomap = iter.data; in etnaviv_core_dump()
193 etnaviv_core_dump_header(&iter, ETDUMP_BUF_BOMAP, in etnaviv_core_dump()
214 iter.hdr->data[0] = cpu_to_le32((bomap - bomap_start)); in etnaviv_core_dump()
220 iter.hdr->iova = cpu_to_le64(vram->iova); in etnaviv_core_dump()
224 memcpy(iter.data, vaddr, obj->base.size); in etnaviv_core_dump()
226 etnaviv_core_dump_header(&iter, ETDUMP_BUF_BO, iter.data + in etnaviv_core_dump()
230 etnaviv_core_dump_header(&iter, ETDUMP_BUF_END, iter.data); in etnaviv_core_dump()
232 dev_coredumpv(gpu->dev, iter.start, iter.data - iter.start, GFP_NOWAIT); in etnaviv_core_dump()