diff options
author | Rafael Antognolli <[email protected]> | 2018-08-21 09:49:03 -0700 |
---|---|---|
committer | Rafael Antognolli <[email protected]> | 2018-08-22 12:52:41 -0700 |
commit | f8cfc7766016d0ff7d52953e7a992b1e77c521d0 (patch) | |
tree | 9d8f320d5a94cca4d641e950cb3a69a20712ceb1 | |
parent | e82d8fa9641abcad9f441a8c70ad773f4fc6baa6 (diff) |
intel/tools/aubwrite: Always use physical addresses for traces.
It looks like we can't rely on the simulator to always translate virtual
addresses to physical ones correctly. So let's use physical everywhere.
Since our current GGTT maps virtual to physical addresses in a 1:1 way,
no further changes are required.
Additionally, we have other address spaces not in use right now. So
let's make it easier to switch which one we are using but putting the
default one into the aub_file struct.
Cc: Lionel Landwerlin <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
-rw-r--r-- | src/intel/tools/aub_write.c | 23 | ||||
-rw-r--r-- | src/intel/tools/aub_write.h | 1 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/intel/tools/aub_write.c b/src/intel/tools/aub_write.c index 5d59b4ef28a..5d272f67b57 100644 --- a/src/intel/tools/aub_write.c +++ b/src/intel/tools/aub_write.c @@ -126,6 +126,7 @@ aub_file_init(struct aub_file *aub, FILE *file, uint16_t pci_id) aub->addr_bits = aub->devinfo.gen >= 8 ? 48 : 32; aub->pml4.phys_addr = PML4_PHYS_ADDR; + aub->default_addr_space = AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_PHYSICAL; } void @@ -240,7 +241,7 @@ populate_ppgtt_table(struct aub_file *aub, struct aub_ppgtt_table *table, uint64_t write_size = (dirty_end - dirty_start + 1) * sizeof(uint64_t); mem_trace_memory_write_header_out(aub, write_addr, write_size, - AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_PHYSICAL, + aub->default_addr_space, "PPGTT update"); data_out(aub, entries + dirty_start, write_size); } @@ -339,7 +340,7 @@ write_execlists_header(struct aub_file *aub, const char *name) /* RENDER_RING */ mem_trace_memory_write_header_out(aub, RENDER_RING_ADDR, RING_SIZE, - AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT, + aub->default_addr_space, "RENDER RING"); for (uint32_t i = 0; i < RING_SIZE; i += sizeof(uint32_t)) dword_out(aub, 0); @@ -348,7 +349,7 @@ write_execlists_header(struct aub_file *aub, const char *name) mem_trace_memory_write_header_out(aub, RENDER_CONTEXT_ADDR, PPHWSP_SIZE + CONTEXT_RENDER_SIZE, - AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT, + aub->default_addr_space, "RENDER PPHWSP"); for (uint32_t i = 0; i < PPHWSP_SIZE; i += sizeof(uint32_t)) dword_out(aub, 0); @@ -358,7 +359,7 @@ write_execlists_header(struct aub_file *aub, const char *name) /* BLITTER_RING */ mem_trace_memory_write_header_out(aub, BLITTER_RING_ADDR, RING_SIZE, - AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT, + aub->default_addr_space, "BLITTER RING"); for (uint32_t i = 0; i < RING_SIZE; i += sizeof(uint32_t)) dword_out(aub, 0); @@ -367,7 +368,7 @@ write_execlists_header(struct aub_file *aub, const char *name) mem_trace_memory_write_header_out(aub, BLITTER_CONTEXT_ADDR, PPHWSP_SIZE + CONTEXT_OTHER_SIZE, - AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT, + aub->default_addr_space, "BLITTER PPHWSP"); for (uint32_t i = 0; i < PPHWSP_SIZE; i += sizeof(uint32_t)) dword_out(aub, 0); @@ -377,7 +378,7 @@ write_execlists_header(struct aub_file *aub, const char *name) /* VIDEO_RING */ mem_trace_memory_write_header_out(aub, VIDEO_RING_ADDR, RING_SIZE, - AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT, + aub->default_addr_space, "VIDEO RING"); for (uint32_t i = 0; i < RING_SIZE; i += sizeof(uint32_t)) dword_out(aub, 0); @@ -386,7 +387,7 @@ write_execlists_header(struct aub_file *aub, const char *name) mem_trace_memory_write_header_out(aub, VIDEO_CONTEXT_ADDR, PPHWSP_SIZE + CONTEXT_OTHER_SIZE, - AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT, + aub->default_addr_space, "VIDEO PPHWSP"); for (uint32_t i = 0; i < PPHWSP_SIZE; i += sizeof(uint32_t)) dword_out(aub, 0); @@ -477,7 +478,7 @@ aub_write_trace_block(struct aub_file *aub, mem_trace_memory_write_header_out(aub, ppgtt_lookup(aub, gtt_offset + offset), block_size, - AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_PHYSICAL, + aub->default_addr_space, "Trace Block"); } else { dword_out(aub, CMD_AUB_TRACE_HEADER_BLOCK | @@ -542,7 +543,7 @@ aub_dump_execlist(struct aub_file *aub, uint64_t batch_offset, int ring_flag) } mem_trace_memory_write_header_out(aub, ring_addr, 16, - AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT, + aub->default_addr_space, "RING MI_BATCH_BUFFER_START user"); dword_out(aub, AUB_MI_BATCH_BUFFER_START | MI_BATCH_NON_SECURE_I965 | (3 - 2)); dword_out(aub, batch_offset & 0xFFFFFFFF); @@ -550,11 +551,11 @@ aub_dump_execlist(struct aub_file *aub, uint64_t batch_offset, int ring_flag) dword_out(aub, 0 /* MI_NOOP */); mem_trace_memory_write_header_out(aub, ring_addr + 8192 + 20, 4, - AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT, + aub->default_addr_space, "RING BUFFER HEAD"); dword_out(aub, 0); /* RING_BUFFER_HEAD */ mem_trace_memory_write_header_out(aub, ring_addr + 8192 + 28, 4, - AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT, + aub->default_addr_space, "RING BUFFER TAIL"); dword_out(aub, 16); /* RING_BUFFER_TAIL */ diff --git a/src/intel/tools/aub_write.h b/src/intel/tools/aub_write.h index 6a09c1747b9..69ad4a877d4 100644 --- a/src/intel/tools/aub_write.h +++ b/src/intel/tools/aub_write.h @@ -52,6 +52,7 @@ struct aub_file { int addr_bits; struct aub_ppgtt_table pml4; + uint32_t default_addr_space; }; void aub_file_init(struct aub_file *aub, FILE *file, uint16_t pci_id); |