"Dump the contents of the control stream buffer on every job submit." },
{ "bo_track", PVR_DEBUG_TRACK_BOS,
"Track all buffer objects with at least one reference." },
+ { "bo_zero", PVR_DEBUG_ZERO_BOS,
+ "Zero all buffer objects at allocation to make them deterministic." },
DEBUG_NAMED_VALUE_END
};
/* clang-format on */
* implies another it should be set here.
*/
- if (PVR_IS_DEBUG_SET(DUMP_CONTROL_STREAM))
+ if (PVR_IS_DEBUG_SET(DUMP_CONTROL_STREAM)) {
PVR_DEBUG_SET(TRACK_BOS);
+ PVR_DEBUG_SET(ZERO_BOS);
+ }
}
#define PVR_DEBUG_DUMP_CONTROL_STREAM BITFIELD_BIT(0)
#define PVR_DEBUG_TRACK_BOS BITFIELD_BIT(1)
+#define PVR_DEBUG_ZERO_BOS BITFIELD_BIT(2)
void pvr_process_debug_variable(void);
uint64_t flags,
struct pvr_bo **const pvr_bo_out)
{
- const uint32_t ws_flags = pvr_bo_alloc_to_winsys_flags(flags);
struct pvr_bo *pvr_bo;
pvr_dev_addr_t addr;
VkResult result;
+ if (PVR_IS_DEBUG_SET(ZERO_BOS))
+ flags |= PVR_BO_ALLOC_FLAG_ZERO_ON_ALLOC;
+
pvr_bo = pvr_bo_alloc_bo(device);
if (!pvr_bo)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
size,
alignment,
PVR_WINSYS_BO_TYPE_GPU,
- ws_flags,
+ pvr_bo_alloc_to_winsys_flags(flags),
&pvr_bo->bo);
if (result != VK_SUCCESS)
goto err_free_bo;
sizeof(uint32_t);
const uint32_t cache_line_size =
rogue_get_slc_cache_line_size(&csb->device->pdevice->dev_info);
- uint64_t alloc_flags = PVR_BO_ALLOC_FLAG_CPU_MAPPED;
struct pvr_bo *pvr_bo;
VkResult result;
- /* If we're dumping the control stream, ensure the buffer is zeroed to make
- * the contents deterministic. This keeps valgrind happy and makes for
- * cleaner dump output.
- */
- if (PVR_IS_DEBUG_SET(DUMP_CONTROL_STREAM))
- alloc_flags |= PVR_BO_ALLOC_FLAG_ZERO_ON_ALLOC;
-
/* Make sure extra space allocated for stream links is sufficient for both
* stream types.
*/
csb->device->heaps.general_heap,
PVR_CMD_BUFFER_CSB_BO_SIZE,
cache_line_size,
- alloc_flags,
+ PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&pvr_bo);
if (result != VK_SUCCESS) {
vk_error(csb->device, result);