mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-22 03:10:41 +02:00
anv: implement VK_KHR_internally_synchronized_queues
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39534>
This commit is contained in:
parent
db5319fbf0
commit
8661cb12e2
5 changed files with 41 additions and 22 deletions
|
|
@ -556,7 +556,7 @@ Khronos extensions that are not part of any Vulkan version:
|
|||
VK_KHR_get_display_properties2 DONE (anv, hk, nvk, pvr, radv, tu, v3dv, vn)
|
||||
VK_KHR_get_surface_capabilities2 DONE (anv, dzn, hk, lvp, nvk, pvr, radv, tu, v3dv, vn)
|
||||
VK_KHR_incremental_present DONE (anv, hasvk, hk, lvp, nvk, pvr, radv, tu, v3dv, vn)
|
||||
VK_KHR_internally_synchronized_queues DONE (radv)
|
||||
VK_KHR_internally_synchronized_queues DONE (anv, radv)
|
||||
VK_KHR_maintenance7 DONE (anv, hk, lvp, nvk, panvk/v10+, radv, tu, vn)
|
||||
VK_KHR_maintenance8 DONE (anv, hk, lvp, nvk, panvk/v10+, radv, tu)
|
||||
VK_KHR_maintenance9 DONE (anv, hk, lvp, nvk, panvk, radv)
|
||||
|
|
|
|||
|
|
@ -350,7 +350,8 @@ VkResult anv_CreateDevice(
|
|||
* queues with flags we don't support.
|
||||
*/
|
||||
for (uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; i++) {
|
||||
if (pCreateInfo->pQueueCreateInfos[i].flags & ~VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT)
|
||||
if (pCreateInfo->pQueueCreateInfos[i].flags & ~(VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT |
|
||||
VK_DEVICE_QUEUE_CREATE_INTERNALLY_SYNCHRONIZED_BIT_KHR))
|
||||
return vk_error(physical_device, VK_ERROR_INITIALIZATION_FAILED);
|
||||
|
||||
const struct anv_queue_family *family =
|
||||
|
|
|
|||
|
|
@ -270,29 +270,35 @@ VkResult anv_QueueSetPerformanceConfigurationINTEL(
|
|||
ANV_FROM_HANDLE(anv_queue, queue, _queue);
|
||||
ANV_FROM_HANDLE(anv_performance_configuration_intel, config, _configuration);
|
||||
struct anv_device *device = queue->device;
|
||||
VkResult result = VK_SUCCESS;
|
||||
|
||||
if (queue != anv_device_get_perf_queue(device))
|
||||
return VK_ERROR_UNKNOWN;
|
||||
vk_queue_lock(&queue->vk);
|
||||
|
||||
if (!INTEL_DEBUG(DEBUG_NO_OACONFIG)) {
|
||||
if (device->perf_fd < 0) {
|
||||
device->perf_fd = anv_device_perf_open(device, queue, config->config_id);
|
||||
if (device->perf_fd < 0)
|
||||
return VK_ERROR_INITIALIZATION_FAILED;
|
||||
} else {
|
||||
uint32_t context_or_exec_queue = anv_device_perf_get_queue_context_or_exec_queue_id(device->perf_queue);
|
||||
int ret = intel_perf_stream_set_metrics_id(device->physical->perf,
|
||||
device->fd,
|
||||
device->perf_fd,
|
||||
context_or_exec_queue,
|
||||
config->config_id,
|
||||
&device->perf_timeline);
|
||||
if (ret < 0)
|
||||
return vk_device_set_lost(&device->vk, "i915-perf config failed: %m");
|
||||
if (queue == anv_device_get_perf_queue(device)) {
|
||||
if (!INTEL_DEBUG(DEBUG_NO_OACONFIG)) {
|
||||
if (device->perf_fd < 0) {
|
||||
device->perf_fd = anv_device_perf_open(device, queue, config->config_id);
|
||||
if (device->perf_fd < 0)
|
||||
result = VK_ERROR_INITIALIZATION_FAILED;
|
||||
} else {
|
||||
uint32_t context_or_exec_queue = anv_device_perf_get_queue_context_or_exec_queue_id(device->perf_queue);
|
||||
int ret = intel_perf_stream_set_metrics_id(device->physical->perf,
|
||||
device->fd,
|
||||
device->perf_fd,
|
||||
context_or_exec_queue,
|
||||
config->config_id,
|
||||
&device->perf_timeline);
|
||||
if (ret < 0)
|
||||
result = vk_device_set_lost(&device->vk, "i915-perf config failed: %m");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result = vk_error(device, VK_ERROR_UNKNOWN);
|
||||
}
|
||||
|
||||
return VK_SUCCESS;
|
||||
vk_queue_unlock(&queue->vk);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void anv_UninitializePerformanceApiINTEL(
|
||||
|
|
|
|||
|
|
@ -189,6 +189,7 @@ get_device_extensions(const struct anv_physical_device *device,
|
|||
.KHR_incremental_present = true,
|
||||
#endif
|
||||
.KHR_index_type_uint8 = true,
|
||||
.KHR_internally_synchronized_queues = true,
|
||||
.KHR_line_rasterization = true,
|
||||
.KHR_load_store_op_none = true,
|
||||
.KHR_maintenance1 = true,
|
||||
|
|
@ -1016,6 +1017,9 @@ get_features(const struct anv_physical_device *pdevice,
|
|||
.presentAtRelativeTime = true,
|
||||
.presentAtAbsoluteTime = true,
|
||||
#endif
|
||||
|
||||
/* VK_KHR_internally_synchronized_queues */
|
||||
.internallySynchronizedQueues = true,
|
||||
};
|
||||
|
||||
/* The new DOOM and Wolfenstein games require depthBounds without
|
||||
|
|
|
|||
|
|
@ -665,10 +665,14 @@ anv_QueueBeginDebugUtilsLabelEXT(
|
|||
{
|
||||
VK_FROM_HANDLE(anv_queue, queue, _queue);
|
||||
|
||||
vk_common_QueueBeginDebugUtilsLabelEXT(_queue, pLabelInfo);
|
||||
vk_queue_lock(&queue->vk);
|
||||
|
||||
vk_queue_begin_debug_utils_label(&queue->vk, pLabelInfo);
|
||||
|
||||
anv_queue_trace(queue, pLabelInfo->pLabelName,
|
||||
false /* frame */, true /* begin */);
|
||||
|
||||
vk_queue_unlock(&queue->vk);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -676,6 +680,8 @@ anv_QueueEndDebugUtilsLabelEXT(VkQueue _queue)
|
|||
{
|
||||
VK_FROM_HANDLE(anv_queue, queue, _queue);
|
||||
|
||||
vk_queue_lock(&queue->vk);
|
||||
|
||||
if (queue->vk.labels.size > 0) {
|
||||
const VkDebugUtilsLabelEXT *label =
|
||||
util_dynarray_top_ptr(&queue->vk.labels, VkDebugUtilsLabelEXT);
|
||||
|
|
@ -685,5 +691,7 @@ anv_QueueEndDebugUtilsLabelEXT(VkQueue _queue)
|
|||
intel_ds_device_process(&queue->device->ds, true);
|
||||
}
|
||||
|
||||
vk_common_QueueEndDebugUtilsLabelEXT(_queue);
|
||||
vk_queue_end_debug_utils_label(&queue->vk);
|
||||
|
||||
vk_queue_unlock(&queue->vk);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue