radv: initialize the trace BO to 0
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 13 Sep 2017 09:13:03 +0000 (11:13 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 14 Sep 2017 08:37:57 +0000 (10:37 +0200)
To avoid random initial values.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_debug.c

index d52ba5d86d82444aef1ff805ea5fe034649e797d..4f680cd1df7cc8bcd1ce10eaa6d9cbd824cd18f0 100644 (file)
 #include "radv_debug.h"
 #include "radv_shader.h"
 
+#define TRACE_BO_SIZE 4096
+
 bool
 radv_init_trace(struct radv_device *device)
 {
        struct radeon_winsys *ws = device->ws;
 
-       device->trace_bo = ws->buffer_create(ws, 4096, 8, RADEON_DOMAIN_VRAM,
+       device->trace_bo = ws->buffer_create(ws, TRACE_BO_SIZE, 8,
+                                            RADEON_DOMAIN_VRAM,
                                             RADEON_FLAG_CPU_ACCESS);
        if (!device->trace_bo)
                return false;
@@ -46,6 +49,8 @@ radv_init_trace(struct radv_device *device)
        if (!device->trace_id_ptr)
                return false;
 
+       memset(device->trace_id_ptr, 0, TRACE_BO_SIZE);
+
        ac_vm_fault_occured(device->physical_device->rad_info.chip_class,
                            &device->dmesg_timestamp, NULL);