v3d: Pass the whole clif_dump structure to v3d_print_group().
To generate CLIF files that the v3dv3 simulator can parse, we're going to need to decode addresses, and for that we'll need the vaddr lookup function from the clif structure from within v3d_decoder.
This commit is contained in:
parent
77207e5380
commit
e92959c4e0
|
@ -37,6 +37,7 @@
|
||||||
#include "v3d_decoder.h"
|
#include "v3d_decoder.h"
|
||||||
#include "v3d_packet_helpers.h"
|
#include "v3d_packet_helpers.h"
|
||||||
#include "v3d_xml.h"
|
#include "v3d_xml.h"
|
||||||
|
#include "broadcom/clif/clif_private.h"
|
||||||
|
|
||||||
struct v3d_spec {
|
struct v3d_spec {
|
||||||
uint32_t ver;
|
uint32_t ver;
|
||||||
|
@ -924,17 +925,17 @@ v3d_field_iterator_next(struct v3d_field_iterator *iter)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
v3d_print_group(FILE *outfile, struct v3d_group *group,
|
v3d_print_group(struct clif_dump *clif, struct v3d_group *group,
|
||||||
uint64_t offset, const uint8_t *p, bool color)
|
uint64_t offset, const uint8_t *p, bool color)
|
||||||
{
|
{
|
||||||
struct v3d_field_iterator iter;
|
struct v3d_field_iterator iter;
|
||||||
|
|
||||||
v3d_field_iterator_init(&iter, group, p, color);
|
v3d_field_iterator_init(&iter, group, p, color);
|
||||||
while (v3d_field_iterator_next(&iter)) {
|
while (v3d_field_iterator_next(&iter)) {
|
||||||
fprintf(outfile, " %s: %s\n", iter.name, iter.value);
|
fprintf(clif->out, " %s: %s\n", iter.name, iter.value);
|
||||||
if (iter.struct_desc) {
|
if (iter.struct_desc) {
|
||||||
uint64_t struct_offset = offset + iter.offset;
|
uint64_t struct_offset = offset + iter.offset;
|
||||||
v3d_print_group(outfile, iter.struct_desc,
|
v3d_print_group(clif, iter.struct_desc,
|
||||||
struct_offset,
|
struct_offset,
|
||||||
&p[iter.offset], color);
|
&p[iter.offset], color);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
struct v3d_spec;
|
struct v3d_spec;
|
||||||
struct v3d_group;
|
struct v3d_group;
|
||||||
struct v3d_field;
|
struct v3d_field;
|
||||||
|
struct clif_dump;
|
||||||
|
|
||||||
struct v3d_group *v3d_spec_find_struct(struct v3d_spec *spec, const char *name);
|
struct v3d_group *v3d_spec_find_struct(struct v3d_spec *spec, const char *name);
|
||||||
struct v3d_spec *v3d_spec_load(const struct v3d_device_info *devinfo);
|
struct v3d_spec *v3d_spec_load(const struct v3d_device_info *devinfo);
|
||||||
|
@ -139,7 +140,7 @@ void v3d_field_iterator_init(struct v3d_field_iterator *iter,
|
||||||
|
|
||||||
bool v3d_field_iterator_next(struct v3d_field_iterator *iter);
|
bool v3d_field_iterator_next(struct v3d_field_iterator *iter);
|
||||||
|
|
||||||
void v3d_print_group(FILE *out,
|
void v3d_print_group(struct clif_dump *clif,
|
||||||
struct v3d_group *group,
|
struct v3d_group *group,
|
||||||
uint64_t offset, const uint8_t *p,
|
uint64_t offset, const uint8_t *p,
|
||||||
bool color);
|
bool color);
|
||||||
|
|
|
@ -131,12 +131,12 @@ clif_dump_gl_shader_state_record(struct clif_dump *clif,
|
||||||
assert(attr);
|
assert(attr);
|
||||||
|
|
||||||
out(clif, "GL Shader State Record at 0x%08x\n", reloc->addr);
|
out(clif, "GL Shader State Record at 0x%08x\n", reloc->addr);
|
||||||
v3d_print_group(clif->out, state, 0, vaddr, "");
|
v3d_print_group(clif, state, 0, vaddr, "");
|
||||||
vaddr += v3d_group_get_length(state);
|
vaddr += v3d_group_get_length(state);
|
||||||
|
|
||||||
for (int i = 0; i < reloc->shader_state.num_attrs; i++) {
|
for (int i = 0; i < reloc->shader_state.num_attrs; i++) {
|
||||||
out(clif, " Attribute %d\n", i);
|
out(clif, " Attribute %d\n", i);
|
||||||
v3d_print_group(clif->out, attr, 0, vaddr, "");
|
v3d_print_group(clif, attr, 0, vaddr, "");
|
||||||
vaddr += v3d_group_get_length(attr);
|
vaddr += v3d_group_get_length(attr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ v3dX(clif_dump_packet)(struct clif_dump *clif, uint32_t offset,
|
||||||
*size = v3d_group_get_length(inst);
|
*size = v3d_group_get_length(inst);
|
||||||
|
|
||||||
out(clif, "%s\n", v3d_group_get_name(inst));
|
out(clif, "%s\n", v3d_group_get_name(inst));
|
||||||
v3d_print_group(clif->out, inst, 0, cl, "");
|
v3d_print_group(clif, inst, 0, cl, "");
|
||||||
|
|
||||||
switch (*cl) {
|
switch (*cl) {
|
||||||
case V3DX(GL_SHADER_STATE_opcode): {
|
case V3DX(GL_SHADER_STATE_opcode): {
|
||||||
|
@ -87,7 +87,7 @@ v3dX(clif_dump_packet)(struct clif_dump *clif, uint32_t offset,
|
||||||
cl += *size;
|
cl += *size;
|
||||||
|
|
||||||
for (int i = 0; i < values.number_of_16_bit_output_data_specs_following; i++) {
|
for (int i = 0; i < values.number_of_16_bit_output_data_specs_following; i++) {
|
||||||
v3d_print_group(clif->out, spec, 0, cl, "");
|
v3d_print_group(clif, spec, 0, cl, "");
|
||||||
cl += v3d_group_get_length(spec);
|
cl += v3d_group_get_length(spec);
|
||||||
*size += v3d_group_get_length(spec);
|
*size += v3d_group_get_length(spec);
|
||||||
}
|
}
|
||||||
|
@ -107,13 +107,13 @@ v3dX(clif_dump_packet)(struct clif_dump *clif, uint32_t offset,
|
||||||
cl += *size;
|
cl += *size;
|
||||||
|
|
||||||
for (int i = 0; i < values.number_of_16_bit_output_data_specs_following; i++) {
|
for (int i = 0; i < values.number_of_16_bit_output_data_specs_following; i++) {
|
||||||
v3d_print_group(clif->out, spec, 0, cl, "");
|
v3d_print_group(clif, spec, 0, cl, "");
|
||||||
cl += v3d_group_get_length(spec);
|
cl += v3d_group_get_length(spec);
|
||||||
*size += v3d_group_get_length(spec);
|
*size += v3d_group_get_length(spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < values.number_of_32_bit_output_buffer_address_following; i++) {
|
for (int i = 0; i < values.number_of_32_bit_output_buffer_address_following; i++) {
|
||||||
v3d_print_group(clif->out, addr, 0, cl, "");
|
v3d_print_group(clif, addr, 0, cl, "");
|
||||||
cl += v3d_group_get_length(addr);
|
cl += v3d_group_get_length(addr);
|
||||||
*size += v3d_group_get_length(addr);
|
*size += v3d_group_get_length(addr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "kernel/vc4_packet.h"
|
#include "kernel/vc4_packet.h"
|
||||||
|
|
||||||
#include "broadcom/cle/v3d_decoder.h"
|
#include "broadcom/cle/v3d_decoder.h"
|
||||||
|
#include "broadcom/clif/clif_dump.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
vc4_dump_cl(void *cl, uint32_t size, bool is_render)
|
vc4_dump_cl(void *cl, uint32_t size, bool is_render)
|
||||||
|
@ -41,6 +42,8 @@ vc4_dump_cl(void *cl, uint32_t size, bool is_render)
|
||||||
};
|
};
|
||||||
struct v3d_spec *spec = v3d_spec_load(&devinfo);
|
struct v3d_spec *spec = v3d_spec_load(&devinfo);
|
||||||
|
|
||||||
|
struct clif_dump *clif = clif_dump_init(&devinfo, stderr, NULL, NULL);
|
||||||
|
|
||||||
uint32_t offset = 0, hw_offset = 0;
|
uint32_t offset = 0, hw_offset = 0;
|
||||||
uint8_t *p = cl;
|
uint8_t *p = cl;
|
||||||
|
|
||||||
|
@ -60,7 +63,7 @@ vc4_dump_cl(void *cl, uint32_t size, bool is_render)
|
||||||
fprintf(stderr, "0x%08x 0x%08x: 0x%02x %s\n",
|
fprintf(stderr, "0x%08x 0x%08x: 0x%02x %s\n",
|
||||||
offset, hw_offset, header, v3d_group_get_name(inst));
|
offset, hw_offset, header, v3d_group_get_name(inst));
|
||||||
|
|
||||||
v3d_print_group(stderr, inst, offset, p, "");
|
v3d_print_group(clif, inst, offset, p, "");
|
||||||
|
|
||||||
switch (header) {
|
switch (header) {
|
||||||
case VC4_PACKET_HALT:
|
case VC4_PACKET_HALT:
|
||||||
|
@ -75,5 +78,7 @@ vc4_dump_cl(void *cl, uint32_t size, bool is_render)
|
||||||
hw_offset += length;
|
hw_offset += length;
|
||||||
p += length;
|
p += length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clif_dump_destroy(clif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue