radv: Return hang status from radv_check_gpu_hangs()
Return VK_ERROR_DEVICE_LOST if a hang is detected. This is necessary because the application needs to know if it should call vkGetDeviceFaultInfoEXT(). Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29921>
This commit is contained in:
@@ -706,7 +706,7 @@ enum radv_device_fault_chunk {
|
||||
RADV_DEVICE_FAULT_CHUNK_COUNT,
|
||||
};
|
||||
|
||||
void
|
||||
VkResult
|
||||
radv_check_gpu_hangs(struct radv_queue *queue, const struct radv_winsys_submit_info *submit_info)
|
||||
{
|
||||
enum amd_ip_type ring;
|
||||
@@ -715,7 +715,7 @@ radv_check_gpu_hangs(struct radv_queue *queue, const struct radv_winsys_submit_i
|
||||
|
||||
bool hang_occurred = radv_gpu_hang_occurred(queue, ring);
|
||||
if (!hang_occurred)
|
||||
return;
|
||||
return VK_SUCCESS;
|
||||
|
||||
fprintf(stderr, "radv: GPU hang detected...\n");
|
||||
|
||||
@@ -849,6 +849,7 @@ radv_check_gpu_hangs(struct radv_queue *queue, const struct radv_winsys_submit_i
|
||||
}
|
||||
|
||||
#endif
|
||||
return VK_ERROR_DEVICE_LOST;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -85,7 +85,7 @@ enum {
|
||||
bool radv_init_trace(struct radv_device *device);
|
||||
void radv_finish_trace(struct radv_device *device);
|
||||
|
||||
void radv_check_gpu_hangs(struct radv_queue *queue, const struct radv_winsys_submit_info *submit_info);
|
||||
VkResult radv_check_gpu_hangs(struct radv_queue *queue, const struct radv_winsys_submit_info *submit_info);
|
||||
|
||||
void radv_print_spirv(const char *data, uint32_t size, FILE *fp);
|
||||
|
||||
|
||||
@@ -2162,7 +2162,7 @@ radv_queue_submit_normal(struct radv_queue *queue, struct vk_queue_submit *submi
|
||||
goto fail;
|
||||
|
||||
if (radv_device_fault_detection_enabled(device)) {
|
||||
radv_check_gpu_hangs(queue, &submit);
|
||||
result = radv_check_gpu_hangs(queue, &submit);
|
||||
}
|
||||
|
||||
if (device->tma_bo) {
|
||||
|
||||
Reference in New Issue
Block a user