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);
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;
+}
#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);