[Mesa-dev] [PATCH 6/9] intel: aubinator: move handle trace function around
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Thu Jun 14 17:11:42 UTC 2018
No functional changes.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
src/intel/tools/aubinator.c | 95 +++++++++++++++++++------------------
1 file changed, 49 insertions(+), 46 deletions(-)
diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index 99cd010dd9d..2a1b91c0e54 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -321,54 +321,8 @@ get_gen_batch_bo(void *user_data, uint64_t address)
};
}
-static void
-handle_trace_block(uint32_t *p)
-{
- int operation = p[1] & AUB_TRACE_OPERATION_MASK;
- int type = p[1] & AUB_TRACE_TYPE_MASK;
- int address_space = p[1] & AUB_TRACE_ADDRESS_SPACE_MASK;
- uint64_t offset = p[3];
- uint32_t size = p[4];
- int header_length = p[0] & 0xffff;
- uint32_t *data = p + header_length + 2;
- int engine = GEN_ENGINE_RENDER;
-
- if (devinfo.gen >= 8)
- offset += (uint64_t) p[5] << 32;
-
- switch (operation) {
- case AUB_TRACE_OP_DATA_WRITE:
- if (address_space != AUB_TRACE_MEMTYPE_GTT)
- break;
- if (gtt_size < offset + size) {
- fprintf(stderr, "overflow gtt space: %s\n", strerror(errno));
- exit(EXIT_FAILURE);
- }
- memcpy((char *) gtt + offset, data, size);
- if (gtt_end < offset + size)
- gtt_end = offset + size;
- break;
- case AUB_TRACE_OP_COMMAND_WRITE:
- switch (type) {
- case AUB_TRACE_TYPE_RING_PRB0:
- engine = GEN_ENGINE_RENDER;
- break;
- case AUB_TRACE_TYPE_RING_PRB2:
- engine = GEN_ENGINE_BLITTER;
- break;
- default:
- fprintf(outfile, "command write to unknown ring %d\n", type);
- break;
- }
- (void)engine; /* TODO */
- batch_ctx.get_bo = get_gen_batch_bo;
- gen_print_batch(&batch_ctx, data, size, 0);
- gtt_end = 0;
- break;
- }
-}
static struct gen_batch_decode_bo
get_ggtt_batch_bo(void *user_data, uint64_t address)
@@ -470,6 +424,55 @@ clear_bo_maps(void)
}
}
+static void
+handle_trace_block(uint32_t *p)
+{
+ int operation = p[1] & AUB_TRACE_OPERATION_MASK;
+ int type = p[1] & AUB_TRACE_TYPE_MASK;
+ int address_space = p[1] & AUB_TRACE_ADDRESS_SPACE_MASK;
+ uint64_t offset = p[3];
+ uint32_t size = p[4];
+ int header_length = p[0] & 0xffff;
+ uint32_t *data = p + header_length + 2;
+ int engine = GEN_ENGINE_RENDER;
+
+ if (devinfo.gen >= 8)
+ offset += (uint64_t) p[5] << 32;
+
+ switch (operation) {
+ case AUB_TRACE_OP_DATA_WRITE:
+ if (address_space != AUB_TRACE_MEMTYPE_GTT)
+ break;
+ if (gtt_size < offset + size) {
+ fprintf(stderr, "overflow gtt space: %s\n", strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+ memcpy((char *) gtt + offset, data, size);
+ if (gtt_end < offset + size)
+ gtt_end = offset + size;
+ break;
+ case AUB_TRACE_OP_COMMAND_WRITE:
+ switch (type) {
+ case AUB_TRACE_TYPE_RING_PRB0:
+ engine = GEN_ENGINE_RENDER;
+ break;
+ case AUB_TRACE_TYPE_RING_PRB2:
+ engine = GEN_ENGINE_BLITTER;
+ break;
+ default:
+ fprintf(outfile, "command write to unknown ring %d\n", type);
+ break;
+ }
+
+ (void)engine; /* TODO */
+ batch_ctx.get_bo = get_gen_batch_bo;
+ gen_print_batch(&batch_ctx, data, size, 0);
+
+ gtt_end = 0;
+ break;
+ }
+}
+
static void
aubinator_init(uint16_t aub_pci_id, const char *app_name)
{
--
2.17.1
More information about the mesa-dev
mailing list