asahi/decode: Only dump mapped allocations

This matches the hardware's view of memory and helps catch spurious reads. (One
symptom of messing this up -- besides broken rendering -- is a kernel warning
about a "bogus texture handle 0".)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11815>
This commit is contained in:
Alyssa Rosenzweig 2021-07-10 11:04:45 -04:00
parent ea7892a74c
commit 9b6ca87672
2 changed files with 7 additions and 3 deletions

View File

@ -426,12 +426,16 @@ agxdecode_cmdstream(unsigned cmdbuf_handle, unsigned map_handle, bool verbose)
}
void
agxdecode_dump_mappings(void)
agxdecode_dump_mappings(unsigned map_handle)
{
agxdecode_dump_file_open();
struct agx_bo *map = agxdecode_find_handle(map_handle, AGX_ALLOC_MEMMAP);
assert(map != NULL && "nonexistant mapping");
agxdecode_validate_map(map->ptr.cpu);
for (unsigned i = 0; i < mmap_count; ++i) {
if (!mmap_array[i].ptr.cpu || !mmap_array[i].size)
if (!mmap_array[i].ptr.cpu || !mmap_array[i].size || !mmap_array[i].mapped)
continue;
assert(mmap_array[i].type < AGX_NUM_ALLOC);

View File

@ -38,7 +38,7 @@ void agxdecode_dump_file_open(void);
void agxdecode_track_alloc(struct agx_bo *alloc);
void agxdecode_dump_mappings(void);
void agxdecode_dump_mappings(unsigned map_index);
void agxdecode_track_free(struct agx_bo *bo);