• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright © 2024 Collabora Ltd.
3  * SPDX-License-Identifier: MIT
4  */
5 
6 #include "panvk_device.h"
7 #include "panvk_queue.h"
8 
9 VkResult
panvk_per_arch(device_check_status)10 panvk_per_arch(device_check_status)(struct vk_device *vk_dev)
11 {
12    struct panvk_device *dev = to_panvk_device(vk_dev);
13    VkResult result = VK_SUCCESS;
14 
15    for (uint32_t qfi = 0; qfi < PANVK_MAX_QUEUE_FAMILIES; qfi++) {
16       for (uint32_t q = 0; q < dev->queue_count[qfi]; q++) {
17          struct panvk_queue *queue = &dev->queues[qfi][q];
18          if (panvk_per_arch(queue_check_status)(queue) != VK_SUCCESS)
19             result = VK_ERROR_DEVICE_LOST;
20       }
21    }
22 
23    if (pan_kmod_vm_query_state(dev->kmod.vm) != PAN_KMOD_VM_USABLE) {
24       vk_device_set_lost(&dev->vk, "vm state: not usable");
25       result = VK_ERROR_DEVICE_LOST;
26    }
27 
28    return result;
29 }
30