summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_device.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-08-30 15:12:20 +0200
committerSamuel Pitoiset <[email protected]>2017-09-01 09:41:54 +0200
commitad42e2abb8507dd85f07e5aad539154b0d5c78ea (patch)
treeee3d314099e77179f70231136b8ae2d06659197d /src/amd/vulkan/radv_device.c
parentf1f2f00f6ac3eb8ccdae4ad4aedfce354ae01e41 (diff)
radv: move RADV_TRACE_FILE functions to radv_debug.c
At the moment, debugging radv is not really easy because the driver doesn't report enough information when it hangs. This new file will be the main location for all debug tools. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_device.c')
-rw-r--r--src/amd/vulkan/radv_device.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 1e3148a0432..aae34883183 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -29,6 +29,7 @@
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
+#include "radv_debug.h"
#include "radv_private.h"
#include "radv_cs.h"
#include "util/disk_cache.h"
@@ -1214,13 +1215,7 @@ VkResult radv_CreateDevice(
}
if (getenv("RADV_TRACE_FILE")) {
- device->trace_bo = device->ws->buffer_create(device->ws, 4096, 8,
- RADEON_DOMAIN_VRAM, RADEON_FLAG_CPU_ACCESS);
- if (!device->trace_bo)
- goto fail;
-
- device->trace_id_ptr = device->ws->buffer_map(device->trace_bo);
- if (!device->trace_id_ptr)
+ if (!radv_init_trace(device))
goto fail;
}
@@ -1378,21 +1373,6 @@ void radv_GetDeviceQueue(
*pQueue = radv_queue_to_handle(&device->queues[queueFamilyIndex][queueIndex]);
}
-static void radv_dump_trace(struct radv_device *device,
- struct radeon_winsys_cs *cs)
-{
- const char *filename = getenv("RADV_TRACE_FILE");
- FILE *f = fopen(filename, "w");
- if (!f) {
- fprintf(stderr, "Failed to write trace dump to %s\n", filename);
- return;
- }
-
- fprintf(f, "Trace ID: %x\n", *device->trace_id_ptr);
- device->ws->cs_dump(cs, f, (const int*)device->trace_id_ptr, 2);
- fclose(f);
-}
-
static void
fill_geom_tess_rings(struct radv_queue *queue,
uint32_t *map,