* IN THE SOFTWARE.
*/
+#include <ctype.h>
+#include <stdlib.h>
#include <string.h>
+#include "util/macros.h"
#include "broadcom/cle/v3d_decoder.h"
#include "clif_dump.h"
#include "clif_private.h"
#include "broadcom/cle/v3dx_pack.h"
#include "broadcom/common/v3d_macros.h"
+static char *
+clif_name(const char *xml_name)
+{
+ char *name = malloc(strlen(xml_name) + 1);
+
+ int j = 0;
+ for (int i = 0; i < strlen(xml_name); i++) {
+ if (xml_name[i] == ' ') {
+ name[j++] = '_';
+ } else if (xml_name[i] == '(' || xml_name[i] == ')') {
+ /* skip */
+ } else {
+ name[j++] = toupper(xml_name[i]);
+ }
+ }
+ name[j++] = 0;
+
+ return name;
+}
+
bool
v3dX(clif_dump_packet)(struct clif_dump *clif, uint32_t offset,
const uint8_t *cl, uint32_t *size)
*size = v3d_group_get_length(inst);
- out(clif, "%s\n", v3d_group_get_name(inst));
- v3d_print_group(clif->out, inst, 0, cl, "");
+ char *name = clif_name(v3d_group_get_name(inst));
+ out(clif, "%s\n", name);
+ free(name);
+ v3d_print_group(clif, inst, 0, cl);
switch (*cl) {
case V3DX(GL_SHADER_STATE_opcode): {
cl += *size;
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);
*size += v3d_group_get_length(spec);
}
+ out(clif, "@format ctrllist\n");
break;
}
#else /* V3D_VERSION < 40 */
cl += *size;
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);
*size += v3d_group_get_length(spec);
}
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);
*size += v3d_group_get_length(addr);
}