anv: track the current frame and write it into the driver identifier BO

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2201>
This commit is contained in:
Lionel Landwerlin 2020-03-05 01:15:57 +02:00 committed by Marge Bot
parent 42cb068d9f
commit 9f0db069d3
5 changed files with 35 additions and 4 deletions

View file

@ -176,6 +176,18 @@ intel_debug_write_identifiers(void *_output,
break;
}
case GEN_DEBUG_BLOCK_TYPE_FRAME: {
struct gen_debug_block_frame frame_desc = {
.base = {
.type = GEN_DEBUG_BLOCK_TYPE_FRAME,
.length = sizeof(frame_desc),
},
};
memcpy(output, &frame_desc, sizeof(frame_desc));
output += sizeof(frame_desc);
break;
}
default:
unreachable("Missing identifier write");
}

View file

@ -134,6 +134,9 @@ enum gen_debug_block_type {
/* Driver identifier (struct gen_debug_block_driver) */
GEN_DEBUG_BLOCK_TYPE_DRIVER,
/* Frame identifier (struct gen_debug_block_frame) */
GEN_DEBUG_BLOCK_TYPE_FRAME,
/* Internal, never to be written out */
GEN_DEBUG_BLOCK_TYPE_MAX,
};
@ -148,6 +151,11 @@ struct gen_debug_block_driver {
uint8_t description[];
};
struct gen_debug_block_frame {
struct gen_debug_block_base base;
uint64_t frame_id;
};
extern void *intel_debug_identifier(void);
extern uint32_t intel_debug_identifier_size(void);

View file

@ -2970,10 +2970,10 @@ VkResult anv_CreateDevice(
"Anv") + 8, 8),
};
if (!device->info.has_llc) {
gen_clflush_range(device->workaround_bo->map,
device->workaround_address.offset);
}
device->debug_frame_desc =
intel_debug_get_identifier_block(device->workaround_bo->map,
device->workaround_bo->size,
GEN_DEBUG_BLOCK_TYPE_FRAME);
result = anv_device_init_trivial_batch(device);
if (result != VK_SUCCESS)

View file

@ -1391,6 +1391,8 @@ struct anv_device {
uint64_t perf_metric; /* 0 if unset */
struct gen_aux_map_context *aux_map_ctx;
struct gen_debug_block_frame *debug_frame_desc;
};
static inline struct anv_instance *

View file

@ -288,6 +288,15 @@ VkResult anv_QueuePresentKHR(
const VkPresentInfoKHR* pPresentInfo)
{
ANV_FROM_HANDLE(anv_queue, queue, _queue);
struct anv_device *device = queue->device;
if (device->debug_frame_desc) {
device->debug_frame_desc->frame_id++;
if (!device->info.has_llc) {
gen_clflush_range(device->debug_frame_desc,
sizeof(*device->debug_frame_desc));
}
}
return wsi_common_queue_present(&queue->device->physical->wsi_device,
anv_device_to_handle(queue->device),