mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
asahi/decode: Turn assert into error
To allow us to debug broken fetches. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
This commit is contained in:
parent
6aa1cf6e7a
commit
5b3f4cf6f8
1 changed files with 10 additions and 1 deletions
|
|
@ -229,7 +229,16 @@ __agxdecode_fetch_gpu_mem(const struct agx_bo *mem, uint64_t gpu_va,
|
|||
}
|
||||
|
||||
assert(mem);
|
||||
assert(size + (gpu_va - mem->ptr.gpu) <= mem->size);
|
||||
|
||||
if (size + (gpu_va - mem->ptr.gpu) > mem->size) {
|
||||
fprintf(stderr,
|
||||
"Overflowing to unknown memory %" PRIx64
|
||||
" of size %zu (max size %zu) in %s:%d\n",
|
||||
gpu_va, size, mem->size - (gpu_va - mem->ptr.gpu), filename,
|
||||
line);
|
||||
fflush(agxdecode_dump_stream);
|
||||
assert(0);
|
||||
}
|
||||
|
||||
memcpy(buf, mem->ptr.cpu + gpu_va - mem->ptr.gpu, size);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue