anv: Implement Xe version of check_status()

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
This commit is contained in:
José Roberto de Souza
2023-02-09 12:34:50 -08:00
committed by Marge Bot
parent 13874840bf
commit 45cb2819f6
3 changed files with 36 additions and 1 deletions
+11 -1
View File
@@ -3036,8 +3036,18 @@ VkResult anv_CreateDevice(
goto fail_device;
}
switch (device->info->kmd_type) {
case INTEL_KMD_TYPE_I915:
device->vk.check_status = anv_i915_device_check_status;
break;
case INTEL_KMD_TYPE_XE:
device->vk.check_status = anv_xe_device_check_status;
break;
default:
unreachable("Missing");
}
device->vk.command_buffer_ops = &anv_cmd_buffer_ops;
device->vk.check_status = anv_i915_device_check_status;
device->vk.create_sync_for_memory = anv_create_sync_for_memory;
vk_device_set_drm_fd(&device->vk, device->fd);
+23
View File
@@ -55,3 +55,26 @@ anv_xe_physical_device_get_parameters(struct anv_physical_device *device)
return VK_SUCCESS;
}
VkResult
anv_xe_device_check_status(struct vk_device *vk_device)
{
struct anv_device *device = container_of(vk_device, struct anv_device, vk);
VkResult result = VK_SUCCESS;
for (uint32_t i = 0; i < device->queue_count; i++) {
struct drm_xe_engine_get_property engine_get_property = {
.engine_id = device->queues[i].engine_id,
.property = XE_ENGINE_GET_PROPERTY_BAN,
};
int ret = intel_ioctl(device->fd, DRM_IOCTL_XE_ENGINE_GET_PROPERTY,
&engine_get_property);
if (ret || engine_get_property.value) {
result = vk_device_set_lost(&device->vk, "One or more queues banned");
break;
}
}
return result;
}
+2
View File
@@ -25,12 +25,14 @@
#include <stdbool.h>
#include "vulkan/vulkan_core.h"
#include "vk_device.h"
struct anv_device;
struct anv_physical_device;
bool anv_xe_device_destroy_vm(struct anv_device *device);
VkResult anv_xe_device_setup_vm(struct anv_device *device);
VkResult anv_xe_device_check_status(struct vk_device *vk_device);
VkResult
anv_xe_physical_device_get_parameters(struct anv_physical_device *device);