Commit f6d33060 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Attribute meta decode

parent cd44e668
......@@ -342,33 +342,10 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header
panwrap_prop("flags = %d", v->flags);
#if 0
attr_mem = panwrap_find_mapped_gpu_mem_containing(v->attribute_meta);
panwrap_msg("%s shader @ " MALI_PTR_FMT " (flags 0x%x)\n",
h->job_type == JOB_TYPE_VERTEX ? "Vertex" : "Fragment",
meta_ptr, v->flags);
if (v->attribute_meta) {
panwrap_msg("Attribute list:\n");
panwrap_indent++;
for (p = v->attribute_meta;
*PANWRAP_PTR(attr_mem, p, u64) != 0;
p += sizeof(u64)) {
attr_meta = panwrap_fetch_gpu_mem(attr_mem, p,
sizeof(*attr_mem));
panwrap_msg("%x:\n", attr_meta->index);
panwrap_indent++;
panwrap_msg("flags = 0x%014" PRIx64 "\n",
(u64) attr_meta->flags);
panwrap_indent--;
}
panwrap_indent--;
} else
panwrap_msg("<no attributes>\n");
if (h->job_type == JOB_TYPE_TILER && v->block1[7]) {
panwrap_msg("GL draw mode: %s\n",
panwrap_gl_mode_name(
......@@ -441,6 +418,33 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header
panwrap_log("}};\n");
TOUCH(fmem, v->nullForVertex, *f, "nullForVertex", job_no);
}
if (v->attribute_meta) {
panwrap_log("struct mali_attr_meta attributes_%d[] = {\n", job_no);
panwrap_indent++;
size_t count = 0;
struct mali_attr_meta *attr_meta;
mali_ptr p;
attr_mem = panwrap_find_mapped_gpu_mem_containing(v->attribute_meta);
for (p = v->attribute_meta;
*PANWRAP_PTR(attr_mem, p, u64) != 0;
p += sizeof(struct mali_attr_meta), count++) {
attr_meta = panwrap_fetch_gpu_mem(attr_mem, p,
sizeof(*attr_mem));
panwrap_log("{ .index = %d, .flags = 0x%" PRIx64 "},\n",
attr_meta->index, attr_meta->flags);
}
panwrap_indent--;
panwrap_log("};\n");
TOUCH_LEN(attr_mem, v->attribute_meta, sizeof(struct mali_attr_meta) * count, "attributes", job_no);
}
}
void panwrap_decode_vertex_or_tiler_job(const struct mali_job_descriptor_header *h,
......
......@@ -45,10 +45,13 @@ struct panwrap_mapped_memory {
struct list node;
};
#define TOUCH(mem, addr, obj, ename, number) \
memset(mem->touched + ((addr - mem->gpu_va) / sizeof(uint32_t)), 1, sizeof(obj) / sizeof(uint32_t)); \
#define TOUCH_LEN(mem, addr, sz, ename, number) \
memset(mem->touched + ((addr - mem->gpu_va) / sizeof(uint32_t)), 1, sz / sizeof(uint32_t)); \
panwrap_log("memcpy(%s + %d, &%s_%d, sizeof(%s_%d));\n", mem->name, (int) ((addr - mem->gpu_va) / sizeof(uint32_t)), ename, number, ename, number);
#define TOUCH(mem, addr, obj, ename, number) \
TOUCH_LEN(mem, addr, sizeof(obj), ename, number)
void replay_memory();
char *pointer_as_memory_reference(mali_ptr ptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment