summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_debug.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-08-31 11:44:00 +0200
committerSamuel Pitoiset <[email protected]>2017-09-01 09:46:36 +0200
commit80177306d97beaafd8c5d45e6f5e633f9d8f035f (patch)
treebb1b41c7a976a75ab01ec7820ef55ef51a0e5f9e /src/amd/vulkan/radv_debug.c
parent12cbd9a13f97f67b62657728bc244b96de7f7b83 (diff)
radv: report VM faults if detected
It's fairly simple for now, but this might be quite useful. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_debug.c')
-rw-r--r--src/amd/vulkan/radv_debug.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c
index 4024f75da88..949eeea2f36 100644
--- a/src/amd/vulkan/radv_debug.c
+++ b/src/amd/vulkan/radv_debug.c
@@ -28,6 +28,7 @@
#include <stdlib.h>
#include <stdio.h>
+#include "ac_debug.h"
#include "radv_debug.h"
bool
@@ -44,6 +45,9 @@ radv_init_trace(struct radv_device *device)
if (!device->trace_id_ptr)
return false;
+ ac_vm_fault_occured(device->physical_device->rad_info.chip_class,
+ &device->dmesg_timestamp, NULL);
+
return true;
}
@@ -80,9 +84,18 @@ radv_gpu_hang_occured(struct radv_queue *queue)
void
radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_winsys_cs *cs)
{
+ struct radv_device *device = queue->device;
+ uint64_t addr;
+
if (!radv_gpu_hang_occured(queue))
return;
+ if (ac_vm_fault_occured(device->physical_device->rad_info.chip_class,
+ &device->dmesg_timestamp, &addr)) {
+ fprintf(stderr, "VM fault report.\n\n");
+ fprintf(stderr, "Failing VM page: 0x%08"PRIx64"\n\n", addr);
+ }
+
radv_dump_trace(queue->device, cs);
abort();
}