mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 18:00:13 +01:00
panfrost: Handle Job VA cycles when decoding a dump file
When a job loop is submitted to the GPU, as in IGT panfrost_submit@pan-reset, this will trigger a DRM scheduler timeout and eventually a devcoredump. However, when pandecode traverses the list of jobs in a submit BO, it will iterate forever. Fix it by adding already-visited CPU VA's into a mesa pointer set and checking that the current job's CPU VA hasn't already been handled. Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14034>
This commit is contained in:
parent
d3642a0e02
commit
3da8c9193c
1 changed files with 19 additions and 0 deletions
|
|
@ -33,6 +33,7 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "decode.h"
|
#include "decode.h"
|
||||||
|
|
||||||
|
#include "util/set.h"
|
||||||
#include "midgard/disassemble.h"
|
#include "midgard/disassemble.h"
|
||||||
#include "bifrost/disassemble.h"
|
#include "bifrost/disassemble.h"
|
||||||
#include "bifrost/valhall/disassemble.h"
|
#include "bifrost/valhall/disassemble.h"
|
||||||
|
|
@ -1138,9 +1139,21 @@ GENX(pandecode_jc)(mali_ptr jc_gpu_va, unsigned gpu_id)
|
||||||
{
|
{
|
||||||
pandecode_dump_file_open();
|
pandecode_dump_file_open();
|
||||||
|
|
||||||
|
struct set *va_set = _mesa_pointer_set_create(NULL);
|
||||||
|
struct set_entry *entry = NULL;
|
||||||
|
|
||||||
mali_ptr next_job = 0;
|
mali_ptr next_job = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
struct pandecode_mapped_memory *mem =
|
||||||
|
pandecode_find_mapped_gpu_mem_containing(jc_gpu_va);
|
||||||
|
|
||||||
|
entry = _mesa_set_search(va_set, mem->addr);
|
||||||
|
if (entry != NULL) {
|
||||||
|
fprintf(stdout, "Job list has a cycle\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
pan_unpack(PANDECODE_PTR(jc_gpu_va, struct mali_job_header_packed),
|
pan_unpack(PANDECODE_PTR(jc_gpu_va, struct mali_job_header_packed),
|
||||||
JOB_HEADER, h);
|
JOB_HEADER, h);
|
||||||
next_job = h.next;
|
next_job = h.next;
|
||||||
|
|
@ -1189,8 +1202,14 @@ GENX(pandecode_jc)(mali_ptr jc_gpu_va, unsigned gpu_id)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add the latest visited job GPU VA to avoid cycles */
|
||||||
|
_mesa_set_add(va_set, mem->addr);
|
||||||
|
|
||||||
} while ((jc_gpu_va = next_job));
|
} while ((jc_gpu_va = next_job));
|
||||||
|
|
||||||
|
_mesa_set_destroy(va_set, NULL);
|
||||||
|
|
||||||
fflush(pandecode_dump_stream);
|
fflush(pandecode_dump_stream);
|
||||||
pandecode_map_read_write();
|
pandecode_map_read_write();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue