Exemplo n.º 1
0
static void
fail_instr(uint64_t inst, const char *msg)
{
        fprintf(stderr, "vc4_qpu_validate: %s: ", msg);
        vc4_qpu_disasm(&inst, 1);
        fprintf(stderr, "\n");
        abort();
}
Exemplo n.º 2
0
static void
vc4_dump_program(struct vc4_compile *c)
{
        fprintf(stderr, "%s prog %d/%d QPU:\n",
                qir_get_stage_name(c->stage),
                c->program_id, c->variant_id);

        for (int i = 0; i < c->qpu_inst_count; i++) {
                fprintf(stderr, "0x%016"PRIx64" ", c->qpu_insts[i]);
                vc4_qpu_disasm(&c->qpu_insts[i], 1);
                fprintf(stderr, "\n");
        }
}
Exemplo n.º 3
0
static void
parse_shaders(void)
{
        list_for_each_entry(struct vc4_mem_area_rec, rec, &dump.mem_areas,
                            link) {
                const char *type = NULL;

                switch (rec->type) {
                case VC4_MEM_AREA_CS:
                        type = "CS";
                        break;
                case VC4_MEM_AREA_VS:
                        type = "VS";
                        break;
                case VC4_MEM_AREA_FS:
                        type = "FS";
                        break;
                default:
                        continue;
                }

                printf("%s at 0x%08x:\n", type, rec->paddr);

                if (!rec->addr) {
                        printf("    No mapping found\n");
                        continue;
                }

                uint32_t end_offset = ~0;
                for (uint32_t offset = 0;
                     offset < end_offset;
                     offset += sizeof(uint64_t)) {
                        uint64_t inst = *(uint64_t *)(rec->addr + offset);

                        printf("0x%08x: ", rec->paddr + offset);
                        vc4_qpu_disasm(stdout, &inst, 1);
                        printf("\n");

                        if (QPU_GET_FIELD(inst, QPU_SIG) == QPU_SIG_PROG_END) {
                                /* Parse two more instructions (the delay
                                 * slots), then stop.
                                 */
                                end_offset = offset + 12;
                        }
                }
                printf("\n");
        }
}