drmSyncobjWait(dev->fd, &out_sync, 1,
INT64_MAX, 0, NULL);
- /* Trace gets priority over sync */
- bool minimal = !(dev->debug & PAN_DBG_TRACE);
- pandecode_jc(submit.jc, pan_is_bifrost(dev), dev->gpu_id, minimal);
+ if (dev->debug & PAN_DBG_TRACE)
+ pandecode_jc(submit.jc, pan_is_bifrost(dev), dev->gpu_id, false);
+
+ if (dev->debug & PAN_DBG_SYNC)
+ pandecode_abort_on_fault(submit.jc);
}
return 0;
{"trace", PAN_DBG_TRACE, "Trace the command stream"},
{"deqp", PAN_DBG_DEQP, "Hacks for dEQP"},
{"dirty", PAN_DBG_DIRTY, "Always re-emit all state"},
- {"sync", PAN_DBG_SYNC, "Wait for each job's completion and check for any GPU fault"},
+ {"sync", PAN_DBG_SYNC, "Wait for each job's completion and abort on GPU faults"},
{"precompile", PAN_DBG_PRECOMPILE, "Precompile shaders for shader-db"},
{"nofp16", PAN_DBG_NOFP16, "Disable 16-bit support"},
{"gl3", PAN_DBG_GL3, "Enable experimental GL 3.x implementation, up to 3.3"},
#include <memory.h>
#include <stdbool.h>
#include <stdarg.h>
+#include <errno.h>
#include <ctype.h>
#include "decode.h"
pandecode_map_read_write();
}
+
+void
+pandecode_abort_on_fault(mali_ptr jc_gpu_va)
+{
+ mali_ptr next_job = 0;
+
+ do {
+ struct pandecode_mapped_memory *mem =
+ pandecode_find_mapped_gpu_mem_containing(jc_gpu_va);
+
+ pan_unpack(PANDECODE_PTR(mem, jc_gpu_va, struct mali_job_header_packed),
+ JOB_HEADER, h);
+ next_job = h.next;
+
+ /* Ensure the job is marked COMPLETE */
+ if (h.exception_status != 0x1) {
+ fprintf(stderr, "Incomplete job or timeout");
+ exit(EIO);
+ }
+ } while ((jc_gpu_va = next_job));
+
+ pandecode_map_read_write();
+}
void pandecode_jc(uint64_t jc_gpu_va, bool bifrost, unsigned gpu_id, bool minimal);
+void
+pandecode_abort_on_fault(uint64_t jc_gpu_va);
+
#endif /* __MMAP_TRACE_H__ */